L
lazarusxl
Guest
I really need an answer on this one asap please, because this is the only thing that is holding me back to release the new update of my map!
I have never used triggers (with counting units in) unit groups before. On SD_Ryoko's website I couldn't find any help unit groups & the count unit function that is useful for me.
I want to make a trigger that if all players have upgraded their money farm to level 2, the trigger that (run every time that a player upgrades a building) checks if the upgraded building is equal to a Money Farm L-1, is destroyed (to reduce lag).
It should look something like this:
trigger name: 'Check redundancy MF upgr 2'
event: every 60 seconds of game time
conditions: -
actions:
(game- display to player 1 the text message: "Check redundancy MF upgr 2 is being executed")
unit group - select all units of type Money Farm L-1 and do actions:
loop actions:
if number of units in last created unit group is equal to 0 then do
trigger - destroy trigger 'Money Farm upgrade to L-2'
trigger - enable trigger 'Check Redundancy MF Upgr 3'
trigger - destroy this trigger
(game- display to player 1 the text message: "The number of L-1 money farms == 0")
else
unit group - destroy last created unit group
(game- display to player 1 the text message: "The number of L-1 money farms == "+count units of unit type Money Farm L-1)
When I created the trigger and ran the game (with 8 players) I got this output:
Check redundancy MF upgr 2 is being executed
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
and the trigger that should have been destroyed, was not destroyed.
PS I used UMSWE to add the destroy(trigger) functions.
I have never used triggers (with counting units in) unit groups before. On SD_Ryoko's website I couldn't find any help unit groups & the count unit function that is useful for me.
I want to make a trigger that if all players have upgraded their money farm to level 2, the trigger that (run every time that a player upgrades a building) checks if the upgraded building is equal to a Money Farm L-1, is destroyed (to reduce lag).
It should look something like this:
trigger name: 'Check redundancy MF upgr 2'
event: every 60 seconds of game time
conditions: -
actions:
(game- display to player 1 the text message: "Check redundancy MF upgr 2 is being executed")
unit group - select all units of type Money Farm L-1 and do actions:
loop actions:
if number of units in last created unit group is equal to 0 then do
trigger - destroy trigger 'Money Farm upgrade to L-2'
trigger - enable trigger 'Check Redundancy MF Upgr 3'
trigger - destroy this trigger
(game- display to player 1 the text message: "The number of L-1 money farms == 0")
else
unit group - destroy last created unit group
(game- display to player 1 the text message: "The number of L-1 money farms == "+count units of unit type Money Farm L-1)
When I created the trigger and ran the game (with 8 players) I got this output:
Check redundancy MF upgr 2 is being executed
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
The number of L-1 money farms == 0
and the trigger that should have been destroyed, was not destroyed.
PS I used UMSWE to add the destroy(trigger) functions.


