Looking at this If, Then, Else Statement, I need to find a different Action for the Else Statement to begin Level 3 or I end up in the same loop of problems.
In the case that you want to have several stages you are better of with a Switch statement. Just add a case for each stage you want and set the corresponding actions for that state i.e. Create Archon in stage 3. When you reach the last stage you turn off the switch.
Remember to initialize the switch variable to 1 or else, this won't work.
The "switch" variable type is no longer being used because they added some transparency to the data type and there for a lot more knowledge about what an actual "switch" is in terms of programming is required... But it still exists.
Try this...
Actions:
General - Switch (intVariableUsedForSwitch)
Cases
General - If (1)
Actions
{Your Actions Go Here}
General - If (2)
Actions
{Your Actions Go Here}
General - If (3)
Actions
{Your Actions Go Here}
Default
Actions
{Your Actions Go Here}
To do this, you create an action of type General - Switch
Then, it will give you something looking like...
General - Switch
Cases
Default
after that, right-click on Cases, and do (New - New Action) It's weird, but it will then ask you for a value. Pick the value you want those actions to execute during
then don't forget you need to make sure to increment the variable you are checking (intVariableUsedForSwitch = intVariableUsedForSwitch + 1)
What this does is essentially string togethera long "if-then-elseif" statement that checks the given "intVariableUsedForSwitch" variable to see if it's equal to any values.
NOTE: Default gets used if none of the conditions are true (lets say the variable equals 6 and there is no "General - If (6). You might want to make it spawn something rediculous for default so you know you mixed something up somewhere.
You dont need a trigger for that, that is a value on units where can set what you should get as a reward for killing them
Its called Combat - Kill Resources
@Mesden: Go
What do I add to these Conditions and/or Actions if I want the 3rd round to have an Archon or something..?
@thefreaklord: Go
Looking at this If, Then, Else Statement, I need to find a different Action for the Else Statement to begin Level 3 or I end up in the same loop of problems.
I called no one wrong. I was providing advice. You should be more discriminating with your accusations.
@Mesden: Go
In the case that you want to have several stages you are better of with a Switch statement. Just add a case for each stage you want and set the corresponding actions for that state i.e. Create Archon in stage 3. When you reach the last stage you turn off the switch.
Remember to initialize the switch variable to 1 or else, this won't work.
TheFreak
@Sceptilesolarbeam: Go
Think your @ is pointing to the wrong person...
@Mesden: Go
It's kind of working. Getting a big red diamond on one of the Trigger commands and round 2 / round 3 only send out 1 unit, not the specified number =/
http://www.sc2x.net/Trigger.png
@Mesden: Go
Ahh wait, I see what's going on. It's not making it to the second Trigger. It's just stopping on the first one.
@Mesden: Go
Yeah, You have to update your switch variable outside of the switch statement. Also, don't forget to turn off the trigger in the last stage.
TheFreak
@thefreaklord: Go
Yeah, I was just coming back onto the Forums to post that I had that Variable in the wrong spot but you beat me to it.
If I may interject...
The "switch" variable type is no longer being used because they added some transparency to the data type and there for a lot more knowledge about what an actual "switch" is in terms of programming is required... But it still exists.
Try this...
Actions:
To do this, you create an action of type General - Switch
Then, it will give you something looking like...
after that, right-click on Cases, and do (New - New Action) It's weird, but it will then ask you for a value. Pick the value you want those actions to execute during
then don't forget you need to make sure to increment the variable you are checking (intVariableUsedForSwitch = intVariableUsedForSwitch + 1) What this does is essentially string togethera long "if-then-elseif" statement that checks the given "intVariableUsedForSwitch" variable to see if it's equal to any values. NOTE: Default gets used if none of the conditions are true (lets say the variable equals 6 and there is no "General - If (6). You might want to make it spawn something rediculous for default so you know you mixed something up somewhere.
@Mesden: Go
Visuals are so much more helpful :)
Works like a charm, thanks.
@Mesden: Go
No problem and GL with your map.
TheFreak
@Mesden: Go
You dont need a trigger for that, that is a value on units where can set what you should get as a reward for killing them Its called Combat - Kill Resources
Hope that works for you :)
Simplest way I can think of is...
Hayena's answer is better :(
But I really only meant giving resources as an example... I really meant to point out the
Owner of unit (Killing Unit) part as a way of retrieving the player index
you can have it spawn units, or play a song for the player or what ever...