I suck with triggers but how do you make a trigger that every 30 seconds if a unit is in the region it gives minerals to the player that owns the unit?
please help
I've worked out a very simple possibility of doing this. Note I haven't tested anything.
I don't like just handing out fully working and efficient triggers since the best way to learn something is by figuring it out yourself, not copy pasting.
But here's something to give you a start.
Requirements: 1 Global Variable with the type as Unit to track which unit was first to enter the region so you can track who is currently in control.
Unit Enters Region
Events
Unit - Any Unit Enters (Entire map)
Local Variables
Conditions
Actions
Variable - Set Current Unit in Region = (Triggering unit)
General - Repeat (Actions) forever
Actions
General - Wait 30.0 Game Time seconds
Player - Modify player (Owner of (Triggering unit)) Minerals: Add 100
Unit Leaves Region
Events
Unit - Any Unit Leaves (Entire map)
Local Variables
Conditions
(Triggering unit) == Current Unit in Region
Actions
Trigger - Stop all instances of Unit Enters Region
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I suck with triggers but how do you make a trigger that every 30 seconds if a unit is in the region it gives minerals to the player that owns the unit? please help
@staggy666
I've worked out a very simple possibility of doing this. Note I haven't tested anything.
I don't like just handing out fully working and efficient triggers since the best way to learn something is by figuring it out yourself, not copy pasting.
But here's something to give you a start.
Requirements: 1 Global Variable with the type as Unit to track which unit was first to enter the region so you can track who is currently in control.
Unit Enters Region
Events
Unit - Any Unit Enters (Entire map)
Local Variables
Conditions
Actions
Variable - Set Current Unit in Region = (Triggering unit)
General - Repeat (Actions) forever
Actions
General - Wait 30.0 Game Time seconds
Player - Modify player (Owner of (Triggering unit)) Minerals: Add 100
Unit Leaves Region
Events
Unit - Any Unit Leaves (Entire map)
Local Variables
Conditions
(Triggering unit) == Current Unit in Region
Actions
Trigger - Stop all instances of Unit Enters Region