• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Income with Units

Status
Not open for further replies.
Level 1
Joined
Dec 7, 2008
Messages
2
Hello, I'm making a map and having a big problem, i'm trying to make a income with units, and every unit add a diferent quantity to the income, can anyone help me?
 
Level 5
Joined
Dec 18, 2007
Messages
205
you need an integer for every player )or an array) that is the amount of the income.

then you need to make a trigger like this:
event: a unit finishes training a unit or a unit sold a unit (dont know what you make)

action: check the unit type via if-then-else and add a specific income to the player.
the next trigger contaisn the income.

example:

  • Unbezeichneter Auslöser 002
    • Events
      • Unit - A unit finishes training a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • IF-Conditions
          • (Unit-type of (Trained unit)) Equal To Footman
        • THEN-Actions
          • Set Income[PlayerNumber of (owner of trained unit)] = (Income[PlayerNumber of (owner of trained unit)] + 12)
        • ELSE-Actions
  • Unbezeichneter Ausloeser 000
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Player - Add Income[Player(Integer A)] to (Player((Integer A))) current gold
 
Level 1
Joined
Dec 7, 2008
Messages
2
breath i tried to make this trigger but i have problems in the variable

the variable i used in the first trigger i can't use in the second
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
I played very outstanding character named Mort in DnD and the nickname kinda stayed. The character was named after Mort from Discworld.

topic: save the values to an array so you don't have to put tons of IFs to the trigger( create two arrays, one with unit types, other with integers and save unit income values in the second under the same index)
 
Status
Not open for further replies.
Top