[Trigger] wage trigger

Level 13
Joined
Sep 24, 2007
Messages
1,023
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
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
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
 
Level 13
Joined
Sep 24, 2007
Messages
1,023
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:
Level 29
Joined
Jul 29, 2007
Messages
5,174
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.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
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
Level 13
Joined
Sep 24, 2007
Messages
1,023
  • 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
 
Top