Disoraptor
New Member
- Reaction score
- 0
Hi!
I'm a quarter through my map when i decided it would be nice to check up on memory leaks here and there. Map contains 4 difficulty levels and therefore 4 types of the same unit. It spawns them as a "run trigger" action during map initialization (everything works fin) and here is my basic trigger:
This trigger is shorter (there are 250+ units in the original one) and it is obviously full of point memory leaks. I tried to fix these leaks with adding Temp_Point and costum text to destroy it afterwards, so it looked like this:
I don't know what went wrong and how, but when i tested the map, here is what happened: Map is to start with hero selection (with a wisp) and then the hero is moved to a certain location where a cinematic is played. Up untill the cinematic, everything works fine. But when the cinematic should be played (using turn letterbox mode on after 0.1 seconds - I avoided using cinematic mode due to visibility reasons) it doesn't jump to letterbox mode. Funny thing is that the units in the cinematic move as they should, but the letterbox mode stays off. It also doesn't clear the game texts or any other texts when it "should" start. After the "cinematic" finishes, i normally get the control of the hero as it should. Does anyone know what might have gone wrong?
One more interesting thing is that i get a quest right after the cinematic ends. Before i implemented the memory leak repairs the "quest received" sound was as it should (those drums played a bit and all) but after the implementation, i only get a sound (for quests receive) as if you'd click a dialog button or f10 (game menu). Totally blew my mind. Any ideas?
P.S.: I have doublechecked every trigger up untill the cinematic with different versions of my maps, and they all worked fine, the problem did only arise after those memory leaks fixes. I wonder, are there simply too many of those or what?
I'm a quarter through my map when i decided it would be nice to check up on memory leaks here and there. Map contains 4 difficulty levels and therefore 4 types of the same unit. It spawns them as a "run trigger" action during map initialization (everything works fin) and here is my basic trigger:
Trigger:
- Units Spawns Level 1
- Events
- Conditions
- Actions
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 001 Unit 01 <gen>) facing 180.00 degrees
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 001 Unit 02 <gen>) facing 180.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 001 Unit 03 <gen>) facing 180.00 degrees
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 002 Unit 01 <gen>) facing 90.00 degrees
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 002 Unit 02 <gen>) facing 90.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 002 Unit 03 <gen>) facing 90.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 003 Unit 01 <gen>) facing 180.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 003 Unit 02 <gen>) facing 180.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 003 Unit 03 <gen>) facing 180.00 degrees
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 003 Unit 04 <gen>) facing 180.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 003 Unit 05 <gen>) facing 180.00 degrees
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 004 Unit 01 <gen>) facing 180.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 004 Unit 02 <gen>) facing 180.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 004 Unit 03 <gen>) facing 180.00 degrees
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at (Center of Camp 005 Unit 01 <gen>) facing 315.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 005 Unit 02 <gen>) facing 315.00 degrees
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at (Center of Camp 005 Unit 03 <gen>) facing 315.00 degrees
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at (Center of Camp 002 Tent 01 <gen>) facing 90.00 degrees
- Set Enemy_Spawn_Building[1] = (Last created unit)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at (Center of Camp 003 Tent 01 <gen>) facing Default building facing degrees
- Set Enemy_Spawn_Building[2] = (Last created unit)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at (Center of Camp 003 Tent 02 <gen>) facing Default building facing degrees
- Set Enemy_Spawn_Building[3] = (Last created unit)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at (Center of Camp 004 Tent 01 <gen>) facing 180.00 degrees
- Set Enemy_Spawn_Building[4] = (Last created unit)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at (Center of Camp 005 Tent 01 <gen>) facing 240.00 degrees
- Set Enemy_Spawn_Building[5] = (Last created unit)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at (Center of Camp 005 Tent 02 <gen>) facing 45.00 degrees
- Set Enemy_Spawn_Building[6] = (Last created unit)
This trigger is shorter (there are 250+ units in the original one) and it is obviously full of point memory leaks. I tried to fix these leaks with adding Temp_Point and costum text to destroy it afterwards, so it looked like this:
Trigger:
- Units Spawns Level 1
- Events
- Conditions
- Actions
- Set Temp_Point = (Center of Camp 001 Unit 01 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 001 Unit 02 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 001 Unit 03 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 002 Unit 01 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 90.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 002 Unit 02 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 90.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 002 Unit 03 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 90.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 003 Unit 01 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 003 Unit 02 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 003 Unit 03 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 003 Unit 04 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 003 Unit 05 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 004 Unit 01 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 004 Unit 02 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 004 Unit 03 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 005 Unit 01 <gen>)
- Unit - Create 1 Highwayman (Level 1) for Player 12 (Brown) at Temp_Point facing 315.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 005 Unit 02 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 315.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 005 Unit 03 <gen>)
- Unit - Create 1 Hill Militia (Level 1) for Player 12 (Brown) at Temp_Point facing 315.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Temp_Point = (Center of Camp 002 Tent 01 <gen>)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at Temp_Point facing 90.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Enemy_Spawn_Building[1] = (Last created unit)
- Set Temp_Point = (Center of Camp 003 Tent 01 <gen>)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at Temp_Point facing Default building facing degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Enemy_Spawn_Building[2] = (Last created unit)
- Set Temp_Point = (Center of Camp 003 Tent 02 <gen>)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at Temp_Point facing Default building facing degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Enemy_Spawn_Building[3] = (Last created unit)
- Set Temp_Point = (Center of Camp 004 Tent 01 <gen>)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at Temp_Point facing 180.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Enemy_Spawn_Building[4] = (Last created unit)
- Set Temp_Point = (Center of Camp 005 Tent 01 <gen>)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at Temp_Point facing 240.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Enemy_Spawn_Building[5] = (Last created unit)
- Set Temp_Point = (Center of Camp 005 Tent 02 <gen>)
- Unit - Create 1 Mountain Tent (Level 1) for Player 12 (Brown) at Temp_Point facing 45.00 degrees
- Custom script: call RemoveLocation (udg_Temp_Point)
- Set Enemy_Spawn_Building[6] = (Last created unit)
I don't know what went wrong and how, but when i tested the map, here is what happened: Map is to start with hero selection (with a wisp) and then the hero is moved to a certain location where a cinematic is played. Up untill the cinematic, everything works fine. But when the cinematic should be played (using turn letterbox mode on after 0.1 seconds - I avoided using cinematic mode due to visibility reasons) it doesn't jump to letterbox mode. Funny thing is that the units in the cinematic move as they should, but the letterbox mode stays off. It also doesn't clear the game texts or any other texts when it "should" start. After the "cinematic" finishes, i normally get the control of the hero as it should. Does anyone know what might have gone wrong?
One more interesting thing is that i get a quest right after the cinematic ends. Before i implemented the memory leak repairs the "quest received" sound was as it should (those drums played a bit and all) but after the implementation, i only get a sound (for quests receive) as if you'd click a dialog button or f10 (game menu). Totally blew my mind. Any ideas?
P.S.: I have doublechecked every trigger up untill the cinematic with different versions of my maps, and they all worked fine, the problem did only arise after those memory leaks fixes. I wonder, are there simply too many of those or what?