Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
Does anyone know how to make a trigger that will give each player gold depending on how many 'income buildings' they have built? Any help will be greatly appreciated, thanks! I will include your name in the credits
every x seconds pick every unit/building of your type and add X gold to the player.
or, if you want each unit/building give gold every x seconds starting from being built/trained you just set an integer array to X (the seconds) and reduce that value every second by 1 and if the integer reaches 0 you give the gold to the owner and set the integer value to X again.
There are already many threads regarding this topic in WEHZ.
And then you've got Spellsandsystems forum.
Try searching a little bit first .
If you only have 1 building-type that increases income:
Build Town Hall
Events
Unit - A unit Finishes construction
Conditions
(Unit-type of (Triggering unit)) Equal to Town Hall
Actions
Set TempInt = (Player number of (Owner of (Triggering unit)))
Set CountTownHalls[TempInt] = (CountTownHalls[TempInt] + 1)
Gather Income
Events
Time - Every 30.00 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 12, do (Actions)
Loop - Actions
Player - Add (100 x CountTownHalls[(Integer A)]) to (Player((Integer A))) Current gold
This example gives 100 gold for every "Town Hall" that's been built.
(I must add that I made this specifically so it does not use any unit groups).
If you have multiple building-types that increase income, the easiest method would be with a simple table and a unit group loop.
Example of the simple table:
Set BuildingType[1] = Mine 1
Set BuildingIncome[1] = 100
Set BuildingType[2] = Mine 2
Set BuildingIncome[2] = 250
Then loop through all buildings, check if they're the correct type and if it's done constructing, then add BuildingIncome[loop int] to the player owning that building.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.