I have countlessly tried loads of ways to allow the trigger to count the amount of [Supply Depots] and then +1 onto a global variable.
--------------------
SupplyCount = 0 < Integer >
SupplyDepots = ("Supply Depot" from the Global data table) <Unit>
Count # of Supply
--- Events
Timer - Every 1.0 seconds of Game Time
--- Actions
----General - If (Conditions) then do (Actions) else do (Actions)
If
--- (Triggering unit) == SupplyDepots
Then
--- Variable - Modify SupplyCount + 1
---------------
It just doesn't work also please note I have not listed every method I have tried - but I am seriously stuck which is why I am posting here, please help.
what are you tring to do? increase global variable every second if count of supply depots > 0?
there are standard functions "Count units in group" and "Units in region with condition" (not exactly name, have Russian localization) in UnitGroup category
--- Events
Timer - Every 1.0 seconds of Game Time
--- Actions
----General - If (Conditions) then do (Actions) else do (Actions)
If
--- Count units in ( Supply Depots in (Entire Map) of (Player1 or AnyPlayer); ...condition(leave default)...) > 0
Then
--- Variable - Modify SupplyCount + 1
(Triggering unit) will not work, timer event not linked to unit
Supply Depots
Events
Timer - Every 1.0 seconds of Game Time
Local Variables
Conditions
Actions
Variable - Set Supply Depot Total = (Supply Depot count for player 1, counting Queued Or Better)
It sets the Supply Depot Total variable to the number of Supply Depots for player 1, including ones that are queued/under construction.
The only Variable used is 'Supply Depot Total.'
P.S. You can't use 'Triggering Unit' if such a unit doesn't exist.
For example, if I used "Event - A Unit Gained an Experience Level," Triggering Unit would return the unit that leveled up.
Your trigger is initiated when a second passes in-game - no unit is *triggering* anything.
Supply Depots Events Timer - Every 1.0 seconds of Game Time Local Variables Conditions Actions Variable - Set Supply Depot Total = (Supply Depot count for player 1, counting Queued Or Better)
It sets the Supply Depot Total variable to the number of Supply Depots for player 1, including ones that are queued/under construction.
The only Variable used is 'Supply Depot Total.'
P.S. You can't use 'Triggering Unit' if such a unit doesn't exist.
For example, if I used "Event - A Unit Gained an Experience Level," Triggering Unit would return the unit that leveled up. Your trigger is initiated when a second passes in-game - no unit is *triggering* anything.
Hope this helps.
This was perfect I tried both ways and it seems that this method was the best. Thanks everyone.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
@Killarag
what are you tring to do? increase global variable every second if count of supply depots > 0?
there are standard functions "Count units in group" and "Units in region with condition" (not exactly name, have Russian localization) in UnitGroup category
--- Events
Timer - Every 1.0 seconds of Game Time
--- Actions
----General - If (Conditions) then do (Actions) else do (Actions)
If
--- Count units in ( Supply Depots in (Entire Map) of (Player1 or AnyPlayer); ...condition(leave default)...) > 0
Then
--- Variable - Modify SupplyCount + 1
(Triggering unit) will not work, timer event not linked to unit
Try this:
Supply Depots Events Timer - Every 1.0 seconds of Game Time Local Variables Conditions Actions Variable - Set Supply Depot Total = (Supply Depot count for player 1, counting Queued Or Better)
It sets the Supply Depot Total variable to the number of Supply Depots for player 1, including ones that are queued/under construction.
The only Variable used is 'Supply Depot Total.'
P.S. You can't use 'Triggering Unit' if such a unit doesn't exist.
For example, if I used "Event - A Unit Gained an Experience Level," Triggering Unit would return the unit that leveled up. Your trigger is initiated when a second passes in-game - no unit is *triggering* anything.
Hope this helps.
if it was me, i wouldnt use every second event to clog everything up. Maybe rather a unit finishes construction followed with a count condition?
This was perfect I tried both ways and it seems that this method was the best. Thanks everyone.