how do i get periodic income from a trained unit?

Status
Not open for further replies.
Level 2
Joined
Jul 2, 2009
Messages
11
I know to handle trigers but not this wel,how do i make that after a train a unit ex:peasant ,to give me a periodical income ????:cq:
 
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

First you need a variable - Name: Income - Type: Integer - Array: [Number of Players]

1) The normal income trigger:
  • Income
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Player - Add Income to Player 1 (Red) Current gold
      • -------- Edit for each Player on your map --------
2) The trigger that sets the income
  • Finished training
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Peasant
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Trained unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set Income = (Income + 5)
        • Else - Actions
      • -------- Edit for each Player on your map --------
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
  • Events
    • Time - Every 20.00 seconds of game time
  • Conditions
  • Actions
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Player - Add ((Number of living Peasant units owned by (Picked player)) x 5) to (Picked player) current Gold
Dr.Boom's trigger should work too, but i guess this one is much easier, it will by now give 5 gold for each living peasant to every player. change it according to your needs
 
Status
Not open for further replies.
Top