So I have this trigger but immensly laggs when it happens.
Force Middle Go
Options: Action
Return Type: (None)
Parameters
Grammar Text: Force Middle Go()
Hint Text: (None)
Custom Script Code
Local Variables
i = 0 <Integer>
Actions
General - For each integer i from 1 to NPlayers with increment 1, do (Actions)
Actions
Unit Group - Pick each unit in (Tech Penguin units in (Entire map) owned by player i matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Move (Picked unit) instantly to (Center of TPMid[i]) (No Blend)
Unit - Make (Picked unit) Invulnerable
Timer - Start Invulnerable Timer as a One Shot timer that will expire in Invulnerable Time Game Time seconds
I think that pathing may be an issue; or the unit selection count. How often does this trigger fire?
It is picking all units owned by each player and moving them to the center of a region, and making them invuln. It then starts a timer.
Unless you are picking many, many, units (hundreds) and they may have footprints (such as buildings) then I dont see why the trigger would cause mass lag, unless maybe it was being run 20 times at once; or NPlayers was set to some insanely high number (though i assume it is the count of active players in the game)
If you are returning many errors, it would cause lag. Have you tried testing it with the debugger open? (file, preferences, test document tab, game start up in windowed mode, checkbox on start trigger debugger, look at the "triggers" tab while this trigger runs)
When using the debugger check to see what the average execution time is.
If the units are made using triggers try using unit groups?
they appear to be faster but i could be wrong
What does the Trigger that calls this Action Definition look like perhaps the lag is from there?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I have this trigger but immensly laggs when it happens.
Force Middle Go
Options: Action
Return Type: (None)
Parameters
Grammar Text: Force Middle Go()
Hint Text: (None)
Custom Script Code
Local Variables
i = 0 <Integer>
Actions
General - For each integer i from 1 to NPlayers with increment 1, do (Actions)
Actions
Unit Group - Pick each unit in (Tech Penguin units in (Entire map) owned by player i matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
Unit - Move (Picked unit) instantly to (Center of TPMid[i]) (No Blend)
Unit - Make (Picked unit) Invulnerable
Timer - Start Invulnerable Timer as a One Shot timer that will expire in Invulnerable Time Game Time seconds
Is there anyway I can improve this trigger?
I think that pathing may be an issue; or the unit selection count. How often does this trigger fire?
It is picking all units owned by each player and moving them to the center of a region, and making them invuln. It then starts a timer.
Unless you are picking many, many, units (hundreds) and they may have footprints (such as buildings) then I dont see why the trigger would cause mass lag, unless maybe it was being run 20 times at once; or NPlayers was set to some insanely high number (though i assume it is the count of active players in the game)
If you are returning many errors, it would cause lag. Have you tried testing it with the debugger open? (file, preferences, test document tab, game start up in windowed mode, checkbox on start trigger debugger, look at the "triggers" tab while this trigger runs)
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
Well it does take a lot of units maybe 50-150 per player. Will check debugger soon.
@penguinwars: Go
Debugger causes lag too, lol.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
When using the debugger check to see what the average execution time is.
If the units are made using triggers try using unit groups?
they appear to be faster but i could be wrong
What does the Trigger that calls this Action Definition look like perhaps the lag is from there?