• 🏆 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!

Building Producing Income

Status
Not open for further replies.
Level 9
Joined
Jul 20, 2009
Messages
427
I need triggers that does the following:
1. Certain buildings that are built gives a certain amount of gold for every x seconds.
2. Same as no. 1 but this time the income is dependent upon the total number of living and already built building.(Grain Warehouse income=total number of living and already built farms times X gold for evey x seconds.
3. Whenever the building's hp is below 30% of its maximum hp, it won't generate income unless it is repaired, only then will it give gold periodically..
Trigger tags please, thanks in advance..I WILL CREDIT ANYONE WHO COULD HELP ME WITH THIS ONE ON MY MAP..
 
Level 6
Joined
May 1, 2009
Messages
215
  • Events
    • Every X Seconds
  • Conditions
    • None
  • Actions
    • Player - Add (Arithmetic: (Number of Building Y Owned By Player Z) x [Value of Gold Generated Per Building]) to Player's Current Gold
If you want each building to generate 2 gold, replace [Value of Gold Genereated Per Building] to 2. To get "Number of Unit Y Owned By Player Z" you'll need to use the function "Count units in unit group".

2. Can't follow what you're asking. Are you saying you want gold to be generated by existing buildings AND buildings that don't exist anymore? I misunderstood you then. If you want to do that you'll have to do the above trigger as number two and this trigger will be what #1 is:

  • Events
    • Generic Unit Event - A Building Is Fished Construction
  • Conditions
    • Building = Type of Building
  • Actions
    • Set Variable PLAYERINCOME + 1
and
  • Events
    • Every X seconds
  • Condtions
    • None
  • Actions
    • Add (Playerincome x some constant) to Player's Current Gold
3. You'll have to make the first #1's trigger more complicated. "Number of Building Type Y owned by player Z" becomes "Number of Building Type Y over 30% hp owned by player Z" I don't have a working editor with me so I'm going off by memory, but that's the jist of it.

Sounds like one hell of an income system though.
 
Level 2
Joined
Jan 18, 2009
Messages
29
OR we can do this without complicated triggers (for the daft) and give your building and auto-cast type ability that generates gold when it finishes research. not reccomending you make it a research ability. just giving an idea, no examples, because there are too many ways to do this, all of them mostly simple.
 
Level 7
Joined
Aug 30, 2008
Messages
347
or select the type of building in a if then else function then give its owner gold periodically
 
Status
Not open for further replies.
Top