- Joined
- Dec 1, 2010
- Messages
- 346
hey,
So i've recently started redoing alot of my maps triggers since they leak. i've read quite a bit about leaks, but would like a second opinion on whether i fixed the leak correctly.
so original trigger:
new trigger:
the idea is that it removes the previous location on the next time it loops. since i need the location to stay stored untill the next loop.
Second part:
i set the hero variable for each number individually in a one time map initialization event since its not a repeating loop i dont think it would cause a ton of memory problems
the purpose of the trigger is to do a simple select and pan over when the player presses esc, it also makes the camera locked when esc is held down wich is pretty nice on it's own.
a second question would be if a trigger like this would cause a substantial amount of lagg when implemented in a way that it doesn't leak. I don't seem to notice it in the map i'm working on but i might be intrested to try this in a moba style project where there really can"t be any lagg.
So i've recently started redoing alot of my maps triggers since they leak. i've read quite a bit about leaks, but would like a second opinion on whether i fixed the leak correctly.
so original trigger:
-
select hero
-
Events
- Player - Player 1 (Red) skips a cinematic sequence
- Player - Player 2 (Blue) skips a cinematic sequence
- Player - Player 3 (Teal) skips a cinematic sequence
- Player - Player 4 (Purple) skips a cinematic sequence
- Player - Player 5 (Yellow) skips a cinematic sequence
- Player - Player 6 (Orange) skips a cinematic sequence
- Player - Player 7 (Green) skips a cinematic sequence
- Player - Player 8 (Pink) skips a cinematic sequence
- Player - Player 9 (Gray) skips a cinematic sequence
- Player - Player 10 (Light Blue) skips a cinematic sequence
- Player - Player 11 (Dark Green) skips a cinematic sequence
- Player - Player 12 (Brown) skips a cinematic sequence
- Player - Player 13 (Maroon) skips a cinematic sequence
- Player - Player 14 (Navy) skips a cinematic sequence
- Player - Player 15 (Turquoise) skips a cinematic sequence
- Player - Player 16 (Violet) skips a cinematic sequence
- Player - Player 17 (Wheat) skips a cinematic sequence
- Player - Player 18 (Peach) skips a cinematic sequence
- Player - Player 19 (Mint) skips a cinematic sequence
- Player - Player 20 (Lavender) skips a cinematic sequence
- Player - Player 21 (Coal) skips a cinematic sequence
- Player - Player 22 (Snow) skips a cinematic sequence
- Player - Player 23 (Emerald) skips a cinematic sequence
- Player - Player 24 (Peanut) skips a cinematic sequence
- Conditions
-
Actions
- Selection - Select (Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True).)) for (Triggering player)
- Camera - Pan camera for (Triggering player) to (Position of (Random unit from (Units owned by (Triggering player) matching (((Matching unit) is A Hero) Equal to True).))) over 0.10 seconds
-
Events
new trigger:
-
pos locker
-
Events
- Time - Every 0.05 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to 24, do (Actions)
-
Loop - Actions
- Custom script: call RemoveLocation( udg_positionofhero[bj_forLoopAIndex] )
- Set VariableSet positionofhero[(Integer A)] = (Position of Hero[(Integer A)])
-
Loop - Actions
-
For each (Integer A) from 1 to 24, do (Actions)
-
Events
the idea is that it removes the previous location on the next time it loops. since i need the location to stay stored untill the next loop.
Second part:
-
select hero noleaks
-
Events
- Player - Player 1 (Red) skips a cinematic sequence
- Player - Player 2 (Blue) skips a cinematic sequence
- Player - Player 3 (Teal) skips a cinematic sequence
- Player - Player 4 (Purple) skips a cinematic sequence
- Player - Player 5 (Yellow) skips a cinematic sequence
- Player - Player 6 (Orange) skips a cinematic sequence
- Player - Player 7 (Green) skips a cinematic sequence
- Player - Player 8 (Pink) skips a cinematic sequence
- Player - Player 9 (Gray) skips a cinematic sequence
- Player - Player 10 (Light Blue) skips a cinematic sequence
- Player - Player 11 (Dark Green) skips a cinematic sequence
- Player - Player 12 (Brown) skips a cinematic sequence
- Player - Player 13 (Maroon) skips a cinematic sequence
- Player - Player 14 (Navy) skips a cinematic sequence
- Player - Player 15 (Turquoise) skips a cinematic sequence
- Player - Player 16 (Violet) skips a cinematic sequence
- Player - Player 17 (Wheat) skips a cinematic sequence
- Player - Player 18 (Peach) skips a cinematic sequence
- Player - Player 19 (Mint) skips a cinematic sequence
- Player - Player 20 (Lavender) skips a cinematic sequence
- Player - Player 21 (Coal) skips a cinematic sequence
- Player - Player 22 (Snow) skips a cinematic sequence
- Player - Player 23 (Emerald) skips a cinematic sequence
- Player - Player 24 (Peanut) skips a cinematic sequence
- Conditions
-
Actions
- Selection - Select Hero[(Player number of (Triggering player))] for (Triggering player)
- Camera - Pan camera for (Triggering player) to positionofhero[(Player number of (Triggering player))] over 0.10 seconds
-
Events
the purpose of the trigger is to do a simple select and pan over when the player presses esc, it also makes the camera locked when esc is held down wich is pretty nice on it's own.
a second question would be if a trigger like this would cause a substantial amount of lagg when implemented in a way that it doesn't leak. I don't seem to notice it in the map i'm working on but i might be intrested to try this in a moba style project where there really can"t be any lagg.