I was trying to build a multi-stage script using variables as a switch. I do not understand what I am doing wrong, even what I am doing right either. I am a veteran of making simple scripts to do really complicated in SC1 editor but this SC2 editor has me completely confused on things.
initiation of battle p1
Events
Unit - Caravan [242.37, 7.46] is attacked
Local Variables
Untitled Variable 001 = 0 <Integer>
Conditions
And
Conditions
(Owner of (Triggering unit)) == 1
Actions
UI - Display "We have been attacked! " for (Player group((Triggering player))) to Subtitle area
Variable - Set Untitled Variable 001 = 1
Point - Move battle point p1 To (Position of (Triggering unit))
Region - Move battle area gain to battle point p1
Unit - Move (Triggering unit) instantly to (Position of (Unit attached to caravan wait)) (No Blend)
Unit - Move (Attacking Unit) instantly to enemies warp entrence (No Blend)
second part of battle p1
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Untitled Variable 001 = 1 <Integer>
Conditions
And
Conditions
((Triggering unit) is in battle area gain) == true
Or
Conditions
(Owner of (Triggering unit)) == 7
(Owner of (Triggering unit)) == 0
Actions
UI - Display "DEBUG battle part 2" for (Player group((Triggering player))) to Subtitle area
Unit - Move (Triggering unit) instantly to enemies warp entrence (No Blend)
Variable - Set Untitled Variable 001 = 2
First off, their is no triggering player in the first part, so that should be 'owner of triggering unit'.
in the second, there still is no triggering player or triggering unit.
it also seems like you are trying to use local vars (vars inside a trigger) across 2 triggers, which doesnt work. You'd need a global var in order for the triggers to share the variable.
Triggering Unit and Triggering Player can only be used the that player or unit actually causes the even to occur.
UI - Display "We have been attacked! " for (Player group((Triggering player)))
Change the above to:
UI - Display "We have been attacked! " for (Player group((Player Owner of Triggering player)))
In the second trigger, this condition will return FALSE preventing the whole trigger from running, because triggering unit does not exist.
((--Triggering unit--) is in battle area gain) == true
Same with this:
UI - Display "DEBUG battle part 2" for (Player group((--Triggering player--)))
And with these:
Conditions
(Owner of (--Triggering unit--)) == 7
(Owner of (--Triggering unit--)) == 0
And finally these:
UI - Display "DEBUG battle part 2" for (Player group((--Triggering player--))) to Subtitle area
Unit - Move (--Triggering unit--) instantly to enemies warp entrence (No Blend)
Simply because Triggering Unit and Triggering Player do not exist, they need an event.
To fix those, you would need to create a variable in the first trigger for the attacking and attacked player.
second part of battle p1
First off, their is no triggering player in the first part, so that should be 'owner of triggering unit'.
in the second, there still is no triggering player or triggering unit.
it also seems like you are trying to use local vars (vars inside a trigger) across 2 triggers, which doesnt work. You'd need a global var in order for the triggers to share the variable.
Triggering Unit and Triggering Player can only be used the that player or unit actually causes the even to occur.
UI - Display "DEBUG battle part 2" for (Player group((--Triggering player--)))
And with these:Conditions (Owner of (--Triggering unit--)) == 7 (Owner of (--Triggering unit--)) == 0
And finally these:UI - Display "DEBUG battle part 2" for (Player group((--Triggering player--))) to Subtitle area Unit - Move (--Triggering unit--) instantly to enemies warp entrence (No Blend)
Simply because Triggering Unit and Triggering Player do not exist, they need an event. To fix those, you would need to create a variable in the first trigger for the attacking and attacked player.