• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Removing Leaks Terminology

Status
Not open for further replies.
Level 8
Joined
Jul 21, 2015
Messages
143
How do I remove and null a unit variable that is already set in the game?
I also want to be able to reset the player variable and remove the leak in that, I am not able to find the correct names for these variables
Unit Variable name: Name_of_Unit_in_Var
Player Variable for Camera name: PlayerVar
FixAngleCamera
Events
Time - Every 0.10 seconds of game time
Conditions
none
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Name_of_Unit_in_Var is alive) Equal to False
Then - Actions
Camera - Reset camera for PlayerVar to standard game-view over 1.00 seconds
Camera - Stop swaying/shaking the camera for PlayerVar
Custom script: set PlayerVar = null
Custom script: call RemoveUnit( Name_of_Unit_in_Var )
Custom script: set Name_of_Unit_in_Var = null
Trigger - Turn off (This trigger)
Else - Actions
Camera - Set PlayerVar's camera Distance to target to 800.00 over 2.00 seconds
Camera - Set PlayerVar's camera Angle of attack to 320.00 over 2.00 seconds
Camera - Set PlayerVar's camera Rotation to 270.00 over 2.00 seconds
Camera - Set PlayerVar's camera Field of view to 90.00 over 2.00 seconds
 
Level 19
Joined
Dec 12, 2010
Messages
2,074
just stop doing anything if you have no idea what you doing.
Leak - leaving a shadow link to some game object which has already been destroyed and no longer will ever be used. Dead unit without reincarnation, destroyed item, rune. You just have to NULL local variables you used to work with them. You don't need to REmoveUnit at all, game does it just fine.
Goddamn, it's not hi-tech
 
It seems that your knowledge of leaks come from what you have been told by other people. Have you taken a look at the Memory Leaks tutorial?

Also in the future, can you maybe remember to post any triggers in [trigger][/trigger] tags. I recommend taking a look at this tutorial about that.

Goddamn, it's not hi-tech
I don't understand the frustration here. We all start somewhere.
 
Status
Not open for further replies.
Top