How does one go about making structures "produce" or "grant" resources to the player (through Triggers)?
For Example I want a Structure that when constructed will "produce" say 10 terrazine every minute and the more of that structure you have it stacks the resource gained.
Note: I used to know how to do this but too much time passed and I lost the map files
Except you have non standard resources, managed with an integer variable in triggers, I don't recommend you to use triggers.
The perfect example is the Terran Automatic Refinery. It owns 2 distinctive behaviors :
- A "Resource" Behavior to set the quantity of resources it holds. This behavior has fields for a harvester (if we stay standard ;) ).
- A "Bonus" Behavior which periodically executes an "Modify Unit" Effect. This effect subtracts resources (negative value) to the Unit holding a "Resource" Behavior.
And that's all.
If you really want to play with triggers :
- Non standard resources : You need to allocate variables for your players.
- Standard resources : Make sure to show the resource. In Data Editor, open tab "Races" and change "Show Resources" value. For example, add "Terrazine".
Then, execute periodically your function (Function name : "Modify Player Property") to add resources to your Player Group.
Of course, for your goal, you must count player's buildings. I presume you can do that.
Have a nice day.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
How does one go about making structures "produce" or "grant" resources to the player (through Triggers)?
For Example I want a Structure that when constructed will "produce" say 10 terrazine every minute and the more of that structure you have it stacks the resource gained.
Note: I used to know how to do this but too much time passed and I lost the map files
Hello,
Except you have non standard resources, managed with an integer variable in triggers, I don't recommend you to use triggers.
The perfect example is the Terran Automatic Refinery. It owns 2 distinctive behaviors :
- A "Resource" Behavior to set the quantity of resources it holds. This behavior has fields for a harvester (if we stay standard ;) ).
- A "Bonus" Behavior which periodically executes an "Modify Unit" Effect. This effect subtracts resources (negative value) to the Unit holding a "Resource" Behavior.
And that's all.
If you really want to play with triggers :
- Non standard resources : You need to allocate variables for your players.
- Standard resources : Make sure to show the resource. In Data Editor, open tab "Races" and change "Show Resources" value. For example, add "Terrazine".
Then, execute periodically your function (Function name : "Modify Player Property") to add resources to your Player Group.
Of course, for your goal, you must count player's buildings. I presume you can do that.
Have a nice day.