- Joined
- Jun 28, 2008
- Messages
- 776
I heard of the bug where you declare a local variable in gui with the same name as the global variable and then you can use the local in the gui trigger instead of the global.
Now what I want to know is how to declare it
is it
Here is my spell that I am making and it uses the above mentioned
The problem with the spell is that Pos_Local_1 is always the center of the map.
Thanks for your help.
Now what I want to know is how to declare it
is it
-
Custom script: local location udg_Pos_Local_1 = null
-
Custom script: local location Pos_Local_1 = null
Here is my spell that I am making and it uses the above mentioned
-
Cast Sand Storm
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


(Ability being cast) Equal to Sand Storm
-
-

Actions
-


Custom script: local location udg_Pos_Local_1 = null
-


Custom script: local location udg_Pos_Local_2 = null
-


Custom script: local unit u = GetTriggerUnit()
-


Custom script: local integer x = 0
-


-------- ---------------- --------
-


Set Pos_Local_1 = (Position of (Triggering unit))
-


-------- ---------------- --------
-


Custom script: loop
-


-------- ---------------- --------
-


Custom script: exitwhen GetUnitCurrentOrder(u) != String2OrderIdBJ("chemicalrage")
-


Custom script: exitwhen x == 50
-


Set Pos_Local_2 = (Pos_Local_1 offset by (Random real number between 0.00 and 400.00) towards (Random angle) degrees)
-


Special Effect - Create a special effect at Pos_Local_2 using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
-


Special Effect - Destroy (Last created special effect)
-


Wait 0.01 seconds
-


Custom script: set x = x + 1
-


Custom script: call RemoveLocation(udg_Pos_Local_2)
-


-------- ---------------- --------
-


Custom script: endloop
-


-------- ---------------- --------
-


Custom script: call RemoveLocation(udg_Pos_Local_1)
-
-
The problem with the spell is that Pos_Local_1 is always the center of the map.
Thanks for your help.





