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!
Gold
Events
Time - Every 20.00 seconds of game time
Conditions
Actions
Set farms = (Number of living Farm units owned by Player 1 (Red))
Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) + farms)
This trigger counts your number of owned units of certain type, and adds one gold per every unit every 20 seconds. So if you have 2 farms, you get 2 gold every 20 seconds. If you have 10 farms, you get 10 gold every 20 seconds.
As an action, pick "Set Variable", then pick your int variable to set, then for value, pick "Unit - Count Living Units Owned By Player"...change the "Footman" to "Farm". Don't forget to also edit the player variable.
As an action, pick "Set Variable", then pick your int variable to set, then for value, pick "Unit - Count Living Units Owned By Player"...change the "Footman" to "Farm". Don't forget to also edit the player variable.
As i think you won't understand it from this explanation, i'll elaborate a bit just to be sure.
Since the variable "farms" contains a number, you need an "integer" variable. There's two ways to edit variables, go to the trigger editor's "edit" tab, all the way at the bottom, there's the "edit variables" button. The other way is by making an action called "Set variable" and go from there.
When you have the variables window opened, there's three buttons in the bottom right, a green, yellow and red one. Click the green one to make a new variable. (yellow = edit variable, red = delete)
First, you set the name for the variable, in this case "farms". Now you can choose what kind of variable you wish to make, make this an "integer". If there's more than one player in your map, you might want to use an "array", there's a checkbox which allows you to enable the array, when doing this, you will notice that a box becomes white, there you can set the array size.
(intermezzo; Arrays are simply put multiple instances of the same variable. When a variable has an array set to two, it makes two instances of the variable, so you can set the same variable for two different purposes, with two different values)
I would recommend you to set this to the number of players you have, that way, you have a variable which can hold data about the farms every player has.
When this is done, you can click ok and the variable will be ready for use.
Since you used an array in this variable, every time you use it, you'll have to set the number of the array in the brackets ( (x) ) behind the variable. You set these to the player number. If you did everything right, the trigger will look like this:
Code:
Gold
Events
Time - Every 20.00 seconds of game time
Conditions
Actions
Set farms(1) = (Number of living Farm units owned by Player 1 (Red))
Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) + farms(1))
Now you can repeat these two actions for every player and everyone will recieve gold proportional to the amount of farms they have.
Goodluck!
(please correct me if i said anything wrong, it's been quite a while since i explained things, have to get used again )
First choose "Arithmetic" on the list, then click on "value" and select "player property" and set the player there. Then you get the "+", now click on the "1" and select "arithmetic again. Then change the "value" to farms-variable and the + to "x" and the 1 to 5 or whatever number.
Now you have action like this
Actions
Set farms[1] = (Number of living Farm units owned by Player 1 (Red))
Player - Set Player 1 (Red) Current gold to ((Player 1 (Red) Current gold) + (farms[1] x 5))
It adds 5 gold per every farm you have, and uses integer array to easily allow the same thing done for other players.
=================================================
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.