I need some help, im trying to create triggers that detect when you have a chooser on a beacon and will subtract minerals, add gas, spawn the unit correlating to the beacon you're on.
I got all of the above to work however i need 2 extra things that i cant figure out:
1.) i need it to check your mineral amount and not give you gas if you dont have the minerals to pay the price
2.) Make it so you dont have to move your unit on and off to keep spawning, i want it to auto detect if chooser is in the region instead of when unit enters region.
For part 1, you simply need an if statement. I won't go into the exact syntax as I don't recall it, but let's assume unit costs 200 minerals for this. If picked player's minerals is greater than or equal to 200, subtract 200 minerals for picked player, add 200 gas (or whatever) for picked player.
For part 2, I'd recommend a recurring trigger that does checks every .2 seconds or something at that specific location. Be yet another if statement inside that recurring trigger, if location contains at least 1 unit picker for picked player, then:
If picked player's minerals is greater than or equal to 200, subtract 200 minerals for picked player, add 200 gas (or whatever) for picked player.
So you would actually nest part 1 inside part 2 to make this work. Is a few ways to make a recurring trigger, I'd get good at part 1 before starting to mess w/ that though!
Thanks for the info, however due to the time it took for a response i changed to a building with spawn unit buttons and a teleport region. I really do appreciate the attemted assist however
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I need some help, im trying to create triggers that detect when you have a chooser on a beacon and will subtract minerals, add gas, spawn the unit correlating to the beacon you're on. I got all of the above to work however i need 2 extra things that i cant figure out: 1.) i need it to check your mineral amount and not give you gas if you dont have the minerals to pay the price 2.) Make it so you dont have to move your unit on and off to keep spawning, i want it to auto detect if chooser is in the region instead of when unit enters region.
@UltimaNecros: Go
For part 1, you simply need an if statement. I won't go into the exact syntax as I don't recall it, but let's assume unit costs 200 minerals for this. If picked player's minerals is greater than or equal to 200, subtract 200 minerals for picked player, add 200 gas (or whatever) for picked player.
For part 2, I'd recommend a recurring trigger that does checks every .2 seconds or something at that specific location. Be yet another if statement inside that recurring trigger, if location contains at least 1 unit picker for picked player, then:
If picked player's minerals is greater than or equal to 200, subtract 200 minerals for picked player, add 200 gas (or whatever) for picked player.
So you would actually nest part 1 inside part 2 to make this work. Is a few ways to make a recurring trigger, I'd get good at part 1 before starting to mess w/ that though!
@Deadzergling: Go
Thanks for the info, however due to the time it took for a response i changed to a building with spawn unit buttons and a teleport region. I really do appreciate the attemted assist however