# [Trigger]wage trigger

Status
Not open for further replies.

#### Gallin

Level 13
well i dont no if this is possible but if it is could u plz tell me.
what i want is for the number of a certian kind of unit take about 10 gold and maybe 1 lumber and if u dont hvae enough for all of them they people then turn kinda of like creeps or maybe just die

#### GhostWolf

Level 29
maybe explain in more then 10 words ?

Well anyway, I guess you mean something like this

• Taxes
• Events
• Time - Every 120.00 seconds of game time
• Conditions
• Actions
• For each (Integer A) from 1 to 10, do (Actions)
• Loop - Actions
• Set Taxes[(Integer A)] = ((Count non-structure units controlled by (Player((Integer A))) (Exclude incomplete units)) x 5)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• ((Player((Integer A))) Current gold) Greater than or equal to Taxes[(Integer A)]
• Then - Actions
• Player - Set (Player((Integer A))) Current gold to (((Player((Integer A))) Current gold) - Taxes[(Integer A)])
• Else - Actions
• Set Taxes[(Integer A)] = (Taxes[(Integer A)] - ((Player((Integer A))) Current gold))
• Set Taxes[(Integer A)] = (Taxes[(Integer A)] / 5)
• Custom script: set bj_wantDestroyGroup = true
• Unit Group - Pick every unit in (Random Taxes[(Integer A)] units from (Units in (Playable map area) owned by (Player((Integer A))))) and do (Actions)
• Loop - Actions
• Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color

#### Gallin

Level 13
ya thanks alot for like all the help u have helped my with but would this work for just a type of unit not just every unit?also what kind of varible is it? also does this hcnage all of the units or just the amount u dont have of money?

Last edited:

#### GhostWolf

Level 29
• Set Taxes[(Integer A)] = ((Number of living Footman units owned by (Player((Integer A)))) x 5)

And Taxes is a Integer.

#### Gallin

Level 13
how do u get that integer a thing?

#### GhostWolf

Level 29
Make your Integer variable with array (just let the value stay at 1) and then in the array (beetwin the []) put the "For Loop Integer A" value which is the second one in that list.

#### Gallin

Level 13
i still dont see where u do this

#### GhostWolf

Level 29
Go and make a Integer variable, now when you make it you have 4 things you can change and it looks like this

Variable Name: Box

Variable Type: Box

[_] Array Size: [_]

Right ?
Now in the "[_] Array" put a V, the Size will then open. Just leave it at 1 (default).
now continue the instructions I told you before.

#### Gallin

Level 13
is there any way that u could just make the trigger put it in a map and then send it to me?

#### GhostWolf

Level 29
Ok, I put this trigger inside the map.
Now check this parts - x5 and /5. If you change one of them change also the other !
So, if every unit has 10 gold for taxes, change BOTH to 10 ! If you'll not do that, the number of units changed to netural hostile won't be the right number.

• Untitled Trigger 001
• Events
• Time - Every 120.00 seconds of game time
• Conditions
• Actions
• For each (Integer A) from 1 to 10, do (Actions)
• Loop - Actions
• Set Integer[(Integer A)] = ((Number of living Footman units owned by (Player((Integer A)))) x 5)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• Integer[(Integer A)] Less than or equal to ((Player((Integer A))) Current gold)
• Then - Actions
• Player - Set (Player((Integer A))) Current gold to (((Player((Integer A))) Current gold) - Integer[(Integer A)])
• Else - Actions
• Set Integer[(Integer A)] = (Integer[(Integer A)] - ((Player((Integer A))) Current gold))
• Set Integer[(Integer A)] = (Integer[(Integer A)] / 5)
• Custom script: set bj_wantDestroyGroup = true
• Unit Group - Pick every unit in (Random Integer[(Integer A)] units from (Units in (Playable map area) owned by (Player((Integer A))))) and do (Actions)
• Loop - Actions
• Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color

And I got your problem... you don't know how to create variables at all, do you ?
Enter the Trigger Editor, now next to the yellow "case" where you create a new Category, next to it is the white page for a new Trigger, go left a bit and you'll see a yellow X, click on it and you'll see what I meant in my previous posts.

#### Attachments

• Whatever.w3x
16.5 KB · Views: 41

#### Gallin

Level 13
its not working once it goes below the number needed to pay its like the trigger stops

#### Gallin

Level 13
and another question i got is a need a trigger so that for the number of a certin an unit u have make it spawn units at another area then kill them when the units are spawned

#### Gallin

Level 13
what does the custom text mean????

#### Need_O2

Level 19
lolz tripple post and a spam (this post)

#### GhostWolf

Level 29
The "set bj_wantDestroyGroup = true" deletes the unit group the moment it ended its actions.
This is needed because unit groups leak like points.

#### Gallin

Level 13
is that y it isnt working??

#### GhostWolf

Level 29
I don't know what is "that".

Now tell me what happens and show me your trigger.

#### Gallin

Level 13
• Untitled Trigger 001
• Events
• Time - Every 10.00 seconds of game time
• Conditions
• Actions
• For each (Integer A) from 1 to 10, do (Actions)
• Loop - Actions
• Set Integer[(Integer A)] = ((Number of living Patroit units owned by (Player((Integer A)))) x 5)
• If (All Conditions are True) then do (Then Actions) else do (Else Actions)
• If - Conditions
• Integer[(Integer A)] Less than or equal to ((Player((Integer A))) Current gold)
• Then - Actions
• Player - Set (Player((Integer A))) Current gold to (((Player((Integer A))) Current gold) - Integer[(Integer A)])
• Else - Actions
• Set Integer[(Integer A)] = (Integer[(Integer A)] - ((Player((Integer A))) Current gold))
• Set Integer[(Integer A)] = (Integer[(Integer A)] / 5)
• Custom script: set bj_wantDestroyGroup = true
• Unit Group - Pick every unit in (Random Integer[(Integer A)] units from (Units in (Playable map area) owned by (Player((Integer A))))) and do (Actions)
• Loop - Actions
• Unit - Change ownership of (Picked unit) to Neutral Hostile and Change color
it takes the money but as soon as it dropps below the money u need to pay it just stops

Status
Not open for further replies.

[Trigger] enimie waves
Replies
5
Views
513
Replies
20
Views
962
Replies
3
Views
691
Replies
1
Views
408
[Trigger] multi-connecting
Replies
14
Views
630