- Joined
- Mar 24, 2013
- Messages
- 1,105
Hio, I'm trying to make a spell that makes a unit at a location and this unit has a lighting effect between it and the caster up to 600 range upon which it "breaks" upon reentering the lightning should be recreated.
I have this so far, but it crashes because I'm moving a destroyed lightning but I'm not understanding precisely why its destroyed, I'm probably making some wrong presumptions with the scripts, but I don't claim to have a clue xD.
I have this so far, but it crashes because I'm moving a destroyed lightning but I'm not understanding precisely why its destroyed, I'm probably making some wrong presumptions with the scripts, but I don't claim to have a clue xD.
-
Battery
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to [ES] Battery
-
-
Actions
-
Set Battery_Caster = (Triggering unit)
-
Set Battery_CasterLoc = (Position of (Triggering unit))
-
Set TempPoint = (Target point of ability being cast)
-
Unit - Create 1 [Dummy] Battery for (Triggering player) at TempPoint facing Default building facing degrees
-
Set Battery = (Last created unit)
-
Set Battery_Loc = (Position of Battery)
-
Custom script: call RemoveLocation(udg_TempPoint)
-
Lightning - Create a Mana Flare lightning effect from source Battery_Loc to target Battery_CasterLoc
-
Set Battery_Lightning = (Last created lightning effect)
-
Trigger - Turn on Battery Lightning <gen>
-
Countdown Timer - Start Battery_Timer as a One-shot timer that will expire in 15.00 seconds
-
-
-
Battery Lightning
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
Set Battery_CasterLoc = (Position of Battery_Caster)
-
Set Battery_Loc = (Position of Battery)
-
Custom script: if udg_Battery_Lightning == null then
-
Game - Display to (All players) the text: Lighting null/makin...
-
Lightning - Create a Mana Flare lightning effect from source Battery_Loc to target Battery_CasterLoc
-
Set Battery_Lightning = (Last created lightning effect)
-
Custom script: endif
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Battery_CasterLoc and Battery_Loc) Less than or equal to 600.00
-
-
Then - Actions
-
Custom script: if udg_Battery_Lightning != null then
-
Lightning - Move Battery_Lightning to source Battery_Loc and target Battery_CasterLoc
-
Custom script: endif
-
-
Else - Actions
-
Game - Display to (All players) the text: Killing Lightning
-
Lightning - Destroy Battery_Lightning
-
-
-
Custom script: call RemoveLocation(udg_Battery_Loc)
-
Custom script: call RemoveLocation(udg_Battery_CasterLoc)
-
-
-
Battery End
-
Events
-
Time - Battery_Timer expires
-
-
Conditions
-
Actions
-
Trigger - Turn off Battery Lightning <gen>
-
Lightning - Destroy Battery_Lightning
-
Unit - Kill Battery
-
-