Give gold to player trigger HELP!

safetoss

New Member
Reaction score
0
I have tried so many times now to make a good trigger that will give a player gold for every [Insert building] that they have, but it just doesn't work. You'd think that doing such a thing would be easy, but I just can't figure it out.

I want a player independent of other players to get gold fore every [Insert building] that he owns.

I want that building to be upgradable, and thus, I want to do a new trigger for the upgrades that gives more gold.

In my map there are different races, I want each to have their own unique money-generating building.

If a player has a building, I don't want the other players to get the gold.

If you uograded, I don't want you to get the previous amount of gold + the new amount, I only want you to get the new amount.

It has to work for many gold producing buildings producing gold together.

I want gold to be generated from the buildings every 20 seconds

I've tried everything, and it just doesn't work, it makes me so incredibly frustrated that the editor won't let me do something so simple as gold generating buildings.

This thread is my last hope before I give up. Please help me.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
I'm assuming that each race can only build their own race's money-generating building.

Trigger:
  • Untitled Trigger 001
    • Events
      • Time - Every 20.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Tornado) and do (Actions)
        • Loop - Actions
          • Player - Add 2 to (Owner of (Picked unit)) Current gold
      • Unit Group - Pick every unit in (Units of type Spirit Hawk (Level 3)) and do (Actions)
        • Loop - Actions
          • Player - Add 5 to (Owner of (Picked unit)) Current gold


Just loop through each money-generating building type and add gold to its owner's gold.

Of course, it leaks.

Tornado could be a unit-type that upgrades into a Spirit Hawk (Level 3), and this would work.
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
@darthfett
Wouldn't creating those unit groups create dumps which would result in a gradual increase of lag?
 

safetoss

New Member
Reaction score
0
Thank you so much :D I had almost given up all hope.

A race can indeed only build their own gold producing buildings.

I tried the triggger out in single player and it works flawlessly.

I have to wait until I can try it out in multiplayer until tomorrow, but since it has [Owner of picked unit] in it, I guess there will be no problem in multiplayer either.

About the lag. How do I make a trigger that does not create dumps that gradually increase lag? Does the dumps dissapear after a certain number of time?

Just wondering since the map I'm making could make for pretty long games.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top