• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Noob cleaning up leaks.

Status
Not open for further replies.
Level 2
Joined
Aug 5, 2008
Messages
24
So I recently started editing a dbz map. As of yesterday I finally finished all I wanted to get done with that map, so I tried to test it. After about 5 minutes into the map I noticed that it started lagging terribly, I later assumed it was because of trigger leaks. So I got the suggested Hive tool for searching for trigger (Leak Check3.1). It was pretty easy to understand.
Now the problem I have encountered when cleaning up leaks are that certain variables cannot be cleaned up since they are used in multiple triggers multiple times without an end. What triggers are these? Generally transformation triggers (Like super saiyan) which will be used multiple times throughout the game.

My question is for cleaning up leaks, do I just ignore variables in these kinds of tirggers? Or do I have to do alot of extra work by making more extremely specific variables for every single trigger?

Any friend advice will be appreciated.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
You should remove leaks whenever you use a point. For example:

  • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
This should be:

  • Set Temp_Point = (Center of (Playable map are))
  • Unit - Create 1 Footman for Player 1 (Red) at (Temp_Point) facing Default building facing degrees
  • Custom script: call RemoveLocation(udg_Temp_Point)
This would also apply for camera panning, ordering dummy casters to cast a spell with a point target and more. Would you mind giving us one of your triggers so we can see what you have done?

- Mr_Bean
 
Level 2
Joined
Aug 5, 2008
Messages
24
  • Vegeta SS
    • Events
      • Player - Player 2 (Blue) types a chat message containing ss as An exact match
    • Conditions
      • (Saiyan Prince 0002 <gen> has an item of type Super Saiyan) Equal to False
      • (Player 2 (Blue) Current gold) Greater than or equal to 20
    • Actions
      • Unit - Replace Vegeta with a Saiyan Prince SS using The old unit's relative life and mana
      • Set Vegeta = (Last replaced unit)
      • Player - Add -10 to Player 2 (Blue) Current gold
      • Unit - Change color of Vegeta to Yellow
      • Hero - Give Super Saiyan 0095 <gen> to Vegeta
      • Animation - Change Vegeta's size to (90.00%, 90.00%, 90.00%) of its original size
      • Item - Move Ultra Super Saiyan 0200 <gen> to (Center of items <gen>)
      • Item - Move Perfect Super Saiyan 0833 <gen> to (Center of items <gen>)
      • Unit - Set Vegeta movement speed to 300.00
      • Special Effect - Create a special effect attached to the origin of Vegeta using Abilities\Spells\Other\Levelup\LevelupCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Vegeta using SSAura.mdx
      • Wait 0.25 seconds
      • Sound - Play Vegeta_scream <gen>
So this is one of the transformation triggers I mentioned. There are several others like these which are just higher transformations and use the same locations to move other power up items already in their inventory to another location. I would assume if I were to remove the location for this item region, it would probably mess up the other similar transformation triggers.
  • Vegeta SS
    • Vegeta USS
      • Events
        • Player - Player 2 (Blue) types a chat message containing uss as An exact match
      • Conditions
        • (Saiyan Prince 0002 <gen> has an item of type Ultra Super Saiyan) Equal to False
        • (Player 2 (Blue) Current gold) Greater than or equal to 20
      • Actions
        • Unit - Replace Vegeta with a Saiyan Prince SS using The old unit's relative life and mana
        • Set Vegeta = (Last replaced unit)
        • Player - Add -15 to Player 2 (Blue) Current gold
        • Unit - Change color of Vegeta to Yellow
        • Hero - Give Ultra Super Saiyan 0200 <gen> to Vegeta
        • Unit - Set Vegeta movement speed to 275.00
        • Item - Move Super Saiyan 0095 <gen> to (Center of items <gen>)
        • Item - Move Perfect Super Saiyan 0833 <gen> to (Center of items <gen>)
        • Animation - Change Vegeta's size to (120.00%, 120.00%, 120.00%) of its original size
        • Special Effect - Create a special effect attached to the origin of Vegeta using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
        • Special Effect - Destroy (Last created special effect)
        • Special Effect - Create a special effect attached to the origin of Vegeta using SSAura.mdx
        • Wait 0.25 seconds
        • Sound - Play Vegeta_Trans <gen>
The other leak in this trigger is the special effect leak. I am aware of the leak but it is only meant to make the transformation flashier until the owner wants it to be removed, which they do when they revert the transformation which is in a different trigger.
  • Vegeta Revert
    • Events
      • Player - Player 2 (Blue) types a chat message containing revert as An exact match
    • Conditions
    • Actions
      • Unit - Replace Vegeta with a Saiyan Prince using The old unit's relative life and mana
      • Set Vegeta = (Last replaced unit)
      • Unit - Change color of Vegeta to Blue
      • Item - Move Super Saiyan 0095 <gen> to (Center of items <gen>)
      • Item - Move Ultra Super Saiyan 0200 <gen> to (Center of items <gen>)
      • Item - Move Perfect Super Saiyan 0833 <gen> to (Center of items <gen>)
      • Unit - Set Vegeta movement speed to 275.00
      • Animation - Change Vegeta's size to (90.00%, 90.00%, 90.00%) of its original size
      • Animation - Change Vegeta's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Unit - Change color of Vegeta to (Color of Player 2 (Blue))
      • Special Effect - Destroy VegetaSS
 
First of all, I would suggest using a global command for the transformations, to save your map some space. This means that one trigger will handle all of the transformations, by using if/then/else.
Replacing unit is usually not recommended, you could use this method instead: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/hero-passive-transformation-198482/

I don't know whether you have one trigger for each player, but you can use this one instad:
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Transformation Trigger <gen> the event (Player - Player(IntegerA) types a message containing ss as an Exact match)
Then, in the "Transformation Trigger", replace Player 2 (Blue) with (Triggering player).
 
Level 2
Joined
Aug 5, 2008
Messages
24
First of all, I would suggest using a global command for the transformations, to save your map some space. This means that one trigger will handle all of the transformations, by using if/then/else.
Replacing unit is usually not recommended, you could use this method instead: http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/hero-passive-transformation-198482/
Interesting, would this work for 3-4 transformations? Generally each player's hero has 2-4 different models to be used. That would be great if it does since the player wouldn't have to relearn all of it's abilities over and over again. The one thing that does bother is me that the unit may not be able to transform straight into their best transformation and would have to wait a little extra to get into their last form (Going from normal form -> Super Saiyan 2 instead of normal form -> Super Saiyan -> Super Saiyan 2)
I don't know whether you have one trigger for each player, but you can use this one instad:
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Transformation Trigger <gen> the event (Player - Player(IntegerA) types a message containing ss as an Exact match)
Then, in the "Transformation Trigger", replace Player 2 (Blue) with (Triggering player).

I'm not really familiar with this kind of trigger, but i'm not sure it will work since each transformation is unlocked when they gain a certain level (The transformation triggers are turned initially on after they gain the level) and with this trigger I think it would turn on the transformation for all of the heros.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,233
Every transformation you make currently leaks atleast 2 location objects and 1 effect object. Especially the effect object is a bad thing to leak.

Your revert trigger destroys a special effect that, as far as I can tell, is never set. Although not really a leak this is still redundant code. Your revert trigger does leak 3 location objects though.
 
Status
Not open for further replies.
Top