- Joined
- Mar 27, 2008
- Messages
- 8,035
Hey, tell me why does this trigger won't work;
This trigger is mostly about those setting of local variable, when I deleted all of them, this trigger does not compile any error oh and the error said "Expected a variable name".
What amazed me was that if I put all those set values of local variable outside of the IF/THEN/ELSE block, it works.
Is there any way to do this or do I really have to create 6 TempReal variable just so I can store those values for use with MoveLightningEx ?
EDIT:
I noticed it could not function within Unit Group, not with IF/THEN/ELSE as I tried to put those functions just below the Unit Group Pick function.
But how can I set those each local variable for Unit in that Group then ?
-
SD Loop
- Events
- Conditions
-
Actions
- Custom script: local real x1
- Custom script: local real x2
- Custom script: local real y1
- Custom script: local real y2
- Custom script: local real z1
- Custom script: local real z2
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (SD_Group is empty) Equal to True
-
Then - Actions
- Trigger - Turn off (This trigger)
-
Else - Actions
-
Unit Group - Pick every unit in SD_Group and do (Actions)
-
Loop - Actions
- Set TempUnit = (Picked unit)
- Custom script: set udg_SD_Key = GetHandleId(udg_TempUnit)
- Set SD_Duration = (Load 3 of SD_Key from SD_Hashtable)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SD_Duration Greater than 0.00
-
Then - Actions
- Set SD_Caster = (Load 1 of SD_Key in SD_Hashtable)
- Set SD_Lightning = (Load 0 of SD_Key in SD_Hashtable)
- Set TempLoc = (Position of TempUnit)
- Set TempLoc2 = (Position of SD_Caster)
- Custom script: set x1 = GetUnitX(udg_SD_Caster)
- Custom script: set y1 = GetUnitY(udg_SD_Caster)
- Custom script: set z1 = GetLocationZ(udg_TempLoc2) + GetUnitFlyHeight(udg_SD_Caster)
- Custom script: set x2 = GetUnitX(udg_TempUnit)
- Custom script: set y2 = GetUnitY(udg_TempUnit)
- Custom script: set z2 = GetLocationZ(udg_TempLoc) + GetUnitFlyHeight(udg_TempUnit)
- Custom script: call MoveLightningEx(udg_SD_Lightning, true, x1, y1, z1, x2, y2, z2)
- Hashtable - Save (SD_Duration - SD_Interval) as 3 of SD_Key in SD_Hashtable
-
Else - Actions
- Unit - Kill TempUnit
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in SD_Group and do (Actions)
-
If - Conditions
What amazed me was that if I put all those set values of local variable outside of the IF/THEN/ELSE block, it works.
Is there any way to do this or do I really have to create 6 TempReal variable just so I can store those values for use with MoveLightningEx ?
EDIT:
I noticed it could not function within Unit Group, not with IF/THEN/ELSE as I tried to put those functions just below the Unit Group Pick function.
But how can I set those each local variable for Unit in that Group then ?