| 05-08-2004, 10:11 AM | #1 |
I'm trying to write some code for a group of teleporters I have, and since all the teleporters's code is the same except for a few objects I thought to make 1big trigger with all the code in it but with the objects replaced by variables. The variables are set by smaller triggers which after setting run the big trigger. Now my problem is that I have several waits in my big trigger, and the variables are still being used after the wait. So while the big trigger is waiting, another small could get run, changing the variables, and blowing my teleportation system to bits. What I'd like to use is locals, but I don't know anything about jass, I tried to use em, but it doesn't work. One of the small triggers: Code:
West to Left
Events
Unit - A unit comes within 128.00 of Circle of Power (medium) 0080 <gen>
Conditions
((Owner of (Triggering unit)) controller) Equal to User
Actions
Set UNIT_Temp = Circle of Power (medium) 0080 <gen>
Set UNIT_Temp2 = Circle of Power (medium) 0082 <gen>
Game - Display to (All players) the text: (String((Unit-type of UNIT_Temp))) //just for testing
Trigger - Run Teleportation <gen> (checking conditions)The big trigger: Code:
Teleportation
Events
Conditions
Actions
Custom script: local unit udg_UNIT_Temp4
Custom script: local unit udg_UNIT_Temp3
Game - Display to (All players) the text: (String((Unit-type of UNIT_Temp))) //just for testing, it displays the unit_type of unit_temp, just like it should.
Set UNIT_Temp4 = UNIT_Temp2
Set UNIT_Temp3 = UNIT_Temp
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
FLAG_Warp[(Player number of (Triggering player))] Equal to True
Then - Actions
Set FLAG_Warp[(Player number of (Triggering player))] = False
Else - Actions
Wait 2.00 seconds
Unit - Change ownership of UNIT_Temp3 to Player 1 (Red) and Change color //this is just for testing, and nothing went red:(
Unit - Change ownership of UNIT_Temp4 to Player 2 (Blue) and Change color // for testing, stringe thing here is that unit_temp1 becomes blue, while earlier I set unit_temp4 to unit_temp2 and not unit_temp1, only unit_temp3 is set to unit_temp1.
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Is (Triggering unit) near UNIT_Temp3 and withing a range of 128.00) Equal to True
Then - Actions
Cinematic - Turn cinematic mode On for (Player group((Triggering player)))
Set FLAG_Warp[(Player number of (Triggering player))] = True
Wait 1.00 seconds
Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
Unit - Hide (Triggering unit)
Unit - Move (Triggering unit) instantly to (Position of UNIT_Temp4), facing 180.00 degrees
Trigger - Run Effect Processor <gen> (ignoring conditions)
Wait 1.00 seconds
Camera - Pan camera for (Owner of (Triggering unit)) to (Position of UNIT_Temp4) over 0.00 seconds
Wait 1.00 seconds
Unit - Unhide (Triggering unit)
Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
Trigger - Run Effect Processor <gen> (ignoring conditions)
Cinematic - Turn cinematic mode Off for (Player group((Triggering player)))
Else - ActionsPlz help me, thanks |
| 05-08-2004, 05:08 PM | #2 |
That's hard to read, can you use the [code*] and [/code*] tags? Thanks. |
