Gold Gathering Unit(Help)

Troll_Killer

New Member
Reaction score
0
I'm trying to make a unit that gives you gold every 60 seconds depending on how many you have of them.
I know how to make it wait 60 seconds but im not sure how to make the gold multiplier eg "every unit gives 12 gold per min"
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Give the units the faerie fire ability, make the ability cast range to 9999999 make it target only allied units, duration set to 0.01, effect = 0 armor reduction, cooldown == 60 seconds.
When the unit enters the playable map area order it to enable autocast of faerie fire.
When the unit casts an ability and the ability is equal to your copy of faerie fire give the owner of the triggering unit 12 gold.

Why faerie fire? Its an auto-cast ability which WILL be used against friendly units whenever possible. Other auto-cast abilities need some kind of trigger for it. Heal will not be cast unless the unit has lost hitpoints, inner fire, bloodlust and Co will only be cast if the unit is engaged in battle. The faerie fire ability will really be cast every now and then when the cooldown is off.
Why target friendly units only? The ability will not be auto-casted against self unfortunately. If casted against enemy units it will generate alarm messages and it might pull attacks.

One sidenote, for the faerie fire ability you can set the sound data path to a number, like for example, set the sound file to be "12". Now in your trigger, when the ability is cast, give the owner of the ability gold equal to the sound path of the ability being cast converted to an integer value. This way you can modify the amount of gold given directly in the editor.
You can also use ability levels to change the amount of gold gained for each use.
 

StEaLtHmAn

New Member
Reaction score
2
That sounds weird to me. Why not just do this:

Trigger:
  • EveryMin
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
      • Loop - Actions
      • Player - Add 12 to (Owner of (Picked unit)) Current gold


This will give 12 gold for each footman on the map to the owner of the footman every minute
 

Smitty

Member
Reaction score
20
Or even just add 12x number of units in the group, and remember to have a trigger which adds them every time a new one is created.
 

Inflicted

Currently inactive
Reaction score
63
Depends on whether he wants the gold per second to increase or flat increases every minute.
Eg, +600 gold ever 60 seconds. Or +10 gold every second for 60 seconds.

Other suggestions have been made that work, but I'm sure there are other methods than the solution that are more customizable, with less difficulty if the player ones more than one type of unit giving different values.

Also, doesn't faery fire leave a buff?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
That sounds weird to me. Why not just do this:

Trigger:
  • EveryMin
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
      • Loop - Actions
      • Player - Add 12 to (Owner of (Picked unit)) Current gold


This will give 12 gold for each footman on the map to the owner of the footman every minute
Memory leaks, performance loss, additional triggers which tend to slow down the map, you wont get the gold 60 seconds after you have build the building, might happen right the moment after the building is finished. Might be you even count unfinished buildings if you didnt specify the trigger clearly enough. You might maybe want the possibility to turn it off? who knows?

The method i described works with mostly object editor data, is thus fast and efficient compared to GUI triggering.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top