Aujourd’hui je m’intéresse a un script trouver sur le net :
(http://www.creationk...Example_Scripts)
Citation
- The below will summon YourSummonREF from wherever they are to the player. In this example, it's dealt with by a spell, but the function could be placed and/or called elsweyr. If as a spell, be sure to set the cooldown time to about 3.0 seconds so the caster can't cast it again until it's worked itself out.
ScriptName RepeatableSummonEffectScript extends ActiveMagicEffect Actor Property YourSummonREF Auto ; An ObjectReference will also work with the summon function Event OnEffectStart(Actor akTarget, Actor akCaster) Summon(akCaster, YourSummonREF) EndEvent ; GetFormFromFile below to enable 'Global' flag Function Summon(ObjectReference akSummoner = None, ObjectReference akSummon = None, Float afDistance = 150.0, Float afZOffset = 0.0, ObjectReference arPortal = None, Int aiStage = 0) Global While aiStage < 6 aiStage += 1 If aiStage == 1 ; Shroud summon with portal arPortal = akSummon.PlaceAtMe(Game.GetFormFromFile(0x0007CD55, "Skyrim.ESM")) ; SummonTargetFXActivator disables and deletes itself shortly after stage 5 ElseIf aiStage == 2 ; Disable Summon akSummon.Disable() ElseIf aiStage == 3 ; Move portal in front of summoner arPortal.MoveTo(akSummoner, Math.Sin(akSummoner.GetAngleZ()) * afDistance, Math.Cos(akSummoner.GetAngleZ()) * afDistance, afZOffset) ElseIf aiStage == 4 ; Move summon to portal akSummon.MoveTo(arPortal) ElseIf aiStage == 5 ; Enable summon as the portal dissipates akSummon.Enable() EndIf Utility.Wait(0.6) EndWhile EndFunction
Mais après un long moment passé à me gratter la tête je dois admettre que certaine chose m’échappe. Je me tourne donc vers vous dans l’espoir de trouver une âme charitable qui puisse m’aider à comprendre ce script.
1) Je n’arrive pas à comprendre ce que fais réellement cette ligne :
arPortal = akSummon.PlaceAtMe(Game.GetFormFromFile(0x0007CD55, "Skyrim.ESM"))
2) Une explication du fonctionnement globale du script serait également la bien venu.
Pour le moment j’ai compris ceci :
- aiStage=1 : ??
- aiStage=2 : la ref akSummon qui contient notre invocation est désactivé
- aiStage=3 : la ref arPortal est déplacé de je ne sais ou vers la ref akSummon
- aiStage=4 : la ref akSummon est déplacé de je ne sais ou vers la ref arPortal
- aiStage=5 : la ref akSummon qui contient notre invocation est activé
Daan