Wow i don't know why i didn't think of this before... why not just change the cost of it in the data editor to 0 then just subtract the resources in the triggers after the unit is created >.< Thanks for the input soulcarverr
Sorry if the title is confusing but i will try my hardest to explain what my problem is. I have a building that spawns units that cost 1 custom resource, I am trying to link those buttons to triggers because i need to spawn a random amount of units. So i have my buttons set up to train (None) and i use (Player (Triggering player) Custom Resource) > 0 under conditions so it wont run if my custom resources are gone. But my problem is when i click the train button with my resources at 1, the resource switches to 0 before the trigger can run. here is how my trigger is set up.
Events -
UI - Player Any Player presses Train Roach (Short Range)
Wow i don't know why i didn't think of this before... why not just change the cost of it in the data editor to 0 then just subtract the resources in the triggers after the unit is created >.< Thanks for the input soulcarverr
@SouLCarveRR: Go
I gave it a try and none of the stages seemed to work, so here is a pic of my trigger if you can help me out.
Sorry if the title is confusing but i will try my hardest to explain what my problem is. I have a building that spawns units that cost 1 custom resource, I am trying to link those buttons to triggers because i need to spawn a random amount of units. So i have my buttons set up to train (None) and i use (Player (Triggering player) Custom Resource) > 0 under conditions so it wont run if my custom resources are gone. But my problem is when i click the train button with my resources at 1, the resource switches to 0 before the trigger can run. here is how my trigger is set up.
Events - UI - Player Any Player presses Train Roach (Short Range)
Conditions - (Player (Triggering player) Custom Resource) > 0
Actions - Variable - Set Randomization = (Random real between 0.0 and 200.0)
General - If (Conditions) then do (Actions) else do (Actions)
If - (Triggering player) == 1
Then - General - If (Conditions) then do (Actions) else do (Actions)
If - Randomization <= 12.5
Then - Unit - Create 1 Roach Hero (Short Range) for player 1 at (Center of Unit Spawn Region P1) facing 270.0 degrees (No Options)
UI - Display "Hero!" for (Player group((Triggering player))) to Error area
Else - General - If (Conditions) then do (Actions) else do (Actions)
If - Randomization > 12.5
And Conditions - Randomization <= 75.0
Then - Unit - Create 2 Roach (Short Range) for player 1 at (Center of Unit Spawn Region P1) facing 270.0 degrees (No Options)
UI - Display "x2" for (Player group((Triggering player))) to Error area
Else - General - If (Conditions) then do (Actions) else do (Actions)
If - Randomization > 75.0
And Conditions - Randomization <= 200.0
Then - Unit - Create 1 Roach (Short Range) for player 1 at (Center of Unit Spawn Region P1) facing 270.0 degrees (No Options)
Else
Big thanks in advance!