• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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