So here's what I'm trying to do. Player moves his Civilian to a Beacon to start a level. In SC1 I would create a Switch so the next time he went to the Beacon it wouldn't prompt the same Trigger again but would rather start Level 2.
Switches seem a bit more difficult in SC2. In SC1 I would make a Trigger that basically says Player 1 Brings Civilian to "Location 1", Set Switch 1.
Then in the next Trigger I would make a Condition that says if Switch 1 is Set, such and such happens.
Can someone talk me through this for SC2? I've been told I need to make an Integer or a Boolean or something or another, but I'm not doing something right... Because rather than sending my Civlian to the beacon and sending out one unit, then sending it to the beacon again to send out the next unit, they're all coming at the same time....
Sounds like you're doing it right. But make sure that you set the boolean back to false after you do the 'if boolean is true' trigger so that the event doesn't keep on occurring repeatedly.
This is how I have it set up. But rather than sending out Unit A when I move the Civilian to the Beacon the first time, and the sending out Unit B when I move the Civilian to the beacon the second time. It's just sending them both out at the same time...
Your problem is that you are using local variables to keep track of states and you can not do that since local variables are gone after the trigger is completed. What you want to do is create a global variable and set it to a default, say "1" and then make just 1 trigger that checks whether the variable is 1 or not. If the variable is 1 you spawn the appropriate unit and increment the variable then if the variable is anything else/or 2 you spawn the appropriate unit
and increment the variable/disable the trigger.
You are using 2 variables. You only need one and only 1 Trigger. Say your Variable is called Switch. then in your trigger you go like "if switch == 1" do this ( Including spawning units and incrementing switch) else ( spawn the other type of units and disable the trigger). For this to work you have to initialize the global variable "switch" to 1.
It's like this, you only need 1 variable to act as the switch. Like this:
Name the variable Levels or something like that. Each time the unit moves to the beacon we'll add +1 to the value of Levels.
Trigger 1: Map initialization
Events: Map Initialization
Conditions: (none)
Actions: Set variable "Levels" == 0
Ok, this is your second trigger:
Trigger2: Levels
Events: Player brings any unit to "region" (whatever region you've paced on the beacon)
Conditions: Levels == 0
Actions: Start Level 1 (or do whatever other actions you want to do for the first level)
Set value of "Levels" = Levels + 1
So basically you are making a variable to act as a level counter. The same thing as setting multiple switches in SC1 but a bit more efficient.
You will need to make a new trigger for each level and make the value of "Levels" in the Conditions go up by 1 each time. Ex: Level 2 trigger will have a condition of "Levels == 1", level three trigger will be "Levels == 2" and so on.
I just started using that If, Then, Else statement. It still creates both units at the same time.
You certainly do it wrong.. First you create a unit a, then you set a variable to 2, then you check if the veriable is 2 and if that is true you create a unit b.
Do you see, what's wrong?
Well, it wasn't like that originally. But yeah, your current trigger is off. I don't know what the original problem is, but you've been getting some bad advice. Of course if you do 'if switch = 1, create unit and set switch = 2, and then if switch = 2, create unit' will do both at the same time.
It's like this, you only need 1 variable to act as the switch. Like this:
Name the variable Levels or something like that. Each time the unit moves to the beacon we'll add +1 to the value of Levels.
Trigger 1: Map initialization
Events: Map Initialization
Conditions: (none)
Actions: Set variable "Levels" == 0
Ok, this is your second trigger:
Trigger2: Levels
Events: Player brings any unit to "region" (whatever region you've paced on the beacon)
Conditions: Levels == 0
Actions: Start Level 1 (or do whatever other actions you want to do for the first level)
Set value of "Levels" = Levels + 1
So basically you are making a variable to act as a level counter. The same thing as setting multiple switches in SC1 but a bit more efficient.
You will need to make a new trigger for each level and make the value of "Levels" in the Conditions go up by 1 each time. Ex: Level 2 trigger will have a condition of "Levels == 1", level three trigger will be "Levels == 2" and so on.
I would like you to try this and tell me what you get ;)
I'm thinking that the Triggers are getting confused that when the Civilian steps on the Beacon, it creates all the Units specified in the Trigger Menus, but the Conditions and the If, Then, Else Statements should be preventing that. Not only that but I even added a "Turn Current Trigger Off" statement at the end of the "Then" statement and it still wants to send out every unit as soon as that civilian starts the level...
So here's what I'm trying to do. Player moves his Civilian to a Beacon to start a level. In SC1 I would create a Switch so the next time he went to the Beacon it wouldn't prompt the same Trigger again but would rather start Level 2.
Switches seem a bit more difficult in SC2. In SC1 I would make a Trigger that basically says Player 1 Brings Civilian to "Location 1", Set Switch 1.
Then in the next Trigger I would make a Condition that says if Switch 1 is Set, such and such happens.
Can someone talk me through this for SC2? I've been told I need to make an Integer or a Boolean or something or another, but I'm not doing something right... Because rather than sending my Civlian to the beacon and sending out one unit, then sending it to the beacon again to send out the next unit, they're all coming at the same time....
Sounds like you're doing it right. But make sure that you set the boolean back to false after you do the 'if boolean is true' trigger so that the event doesn't keep on occurring repeatedly.
@Sceptilesolarbeam: Go
http://www.sc2x.net/Trigger.png http://www.sc2x.net/Trigger2.png
This is how I have it set up. But rather than sending out Unit A when I move the Civilian to the Beacon the first time, and the sending out Unit B when I move the Civilian to the beacon the second time. It's just sending them both out at the same time...
@Mesden: Go
Hello there.
Your problem is that you are using local variables to keep track of states and you can not do that since local variables are gone after the trigger is completed. What you want to do is create a global variable and set it to a default, say "1" and then make just 1 trigger that checks whether the variable is 1 or not. If the variable is 1 you spawn the appropriate unit and increment the variable then if the variable is anything else/or 2 you spawn the appropriate unit and increment the variable/disable the trigger.
Hope it helps.
TheFreak
@thefreaklord: Go
Updated the two links in my previous post. It's still doing the same thing when I make Global Variables...
Hmm. What about the triggers you're using to set the variables to 1/2? Could you post those too? I can't see the problem myself.
@Sceptilesolarbeam: Go
http://www.sc2x.net/Var1.png http://www.sc2x.net/Var2.png
You are using 2 variables. You only need one and only 1 Trigger. Say your Variable is called Switch. then in your trigger you go like "if switch == 1" do this ( Including spawning units and incrementing switch) else ( spawn the other type of units and disable the trigger). For this to work you have to initialize the global variable "switch" to 1.
TheFreak
@thefreaklord: Go
I'm not sure I understand what you mean....
@Mesden: Go
Okay, I think I did the to what you suggested. Still creates both units at the same time...
http://www.sc2x.net/Trigger.png http://www.sc2x.net/Var1.png
If you want it as a real switch you could set your switch variable to a boolean type.
Afterwards when you spawn a unit you use an if then else action.
If switch == false Then spawn unit a; switch = true Else spawn unit b; switch = false
@Mesden: Go
It's like this, you only need 1 variable to act as the switch. Like this:
Name the variable Levels or something like that. Each time the unit moves to the beacon we'll add +1 to the value of Levels. Trigger 1: Map initialization
Ok, this is your second trigger:
Trigger2: Levels
So basically you are making a variable to act as a level counter. The same thing as setting multiple switches in SC1 but a bit more efficient.
You will need to make a new trigger for each level and make the value of "Levels" in the Conditions go up by 1 each time. Ex: Level 2 trigger will have a condition of "Levels == 1", level three trigger will be "Levels == 2" and so on.
@Xolsom: Go
I just started using that If, Then, Else statement. It still creates both units at the same time.
You certainly do it wrong.. First you create a unit a, then you set a variable to 2, then you check if the veriable is 2 and if that is true you create a unit b. Do you see, what's wrong?
Well, it wasn't like that originally. But yeah, your current trigger is off. I don't know what the original problem is, but you've been getting some bad advice. Of course if you do 'if switch = 1, create unit and set switch = 2, and then if switch = 2, create unit' will do both at the same time.
I would like you to try this and tell me what you get ;)
@Sceptilesolarbeam: Go
The Events / Conditions / Actions and even the Global Variable seems clear as day, but it still sends out all units at the same time... -_-
http://www.sc2x.net/Trigger.png http://www.sc2x.net/Trigger2.png
@Mesden: Go
I'm thinking that the Triggers are getting confused that when the Civilian steps on the Beacon, it creates all the Units specified in the Trigger Menus, but the Conditions and the If, Then, Else Statements should be preventing that. Not only that but I even added a "Turn Current Trigger Off" statement at the end of the "Then" statement and it still wants to send out every unit as soon as that civilian starts the level...
@Mesden: Go
Ok sorry for that I am back.
I attached a picture of what it should look like.
@Sceptilesolarbeam: you should be more careful/specific when calling others wrong.
TheFreak
That worked nicely. :D