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"
 
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.
 
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
 
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.
 
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?
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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