• 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.

Leak exemple, need help

Hi, my map is starting to lag before 30m of gameplay, I do have a lot of triggers, and just want to confirm if the problem is something on these trigger, (I do have alot more similar to those)..

1736672148386.png


1736672320063.png


Some of these exemples are the cause of the issue?
 
Level 30
Joined
Aug 29, 2012
Messages
1,383
You have a leak every time you reference "center of region" or other points, so it depends how frequent you are using those

I.e. the first trigger alone won't cause lags, 2 leaks in a trigger that happens once in the entire game are nothing, but if they pile up because of a periodic trigger, then perhaps
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
First trigger coordinate bologna leaks no objects; those are rect coordinates going to a real field; no location is involved. It does however... not really do anything helpful. Setting a facing like that might as well just be randomly determined once.

Anywhere that is "center of <region>" is a point that needs to be dealt with. First trigger has a couple, and second trigger has many points.

@domagatos: How To Post Your Trigger
 
Last edited:
You have a leak every time you reference "center of region" or other points, so it depends how frequent you are using those

I.e. the first trigger alone won't cause lags, 2 leaks in a trigger that happens once in the entire game are nothing, but if they pile up because of a periodic trigger, then perhaps
First trigger actually leaks no objects; those are rect coordinates going to a real field; no location is involved. It does however... not really do anything helpful. Setting a facing like that might as well just be randomly determined once.

Second trigger is many points, though.

@domagatos: How To Post Your Trigger

Tanks for the info guys, most of the triggers in the map are like the first exemple, just a few are like the second.
So everything is good here? the lag is not on the triggers showed?


1736700590169.png


1736700759960.png
 
Level 30
Joined
Aug 29, 2012
Messages
1,383
You can fix the point leak like this

  • Actions
    • Set VariableSet MyPoint = (Center of My Region <gen>)
    • Unit - Create 1 Footman for Player 1 (Red) at MyPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_MyPoint)
After you've stored your location into a variable, you can use it as much as you want as long as it is the same place, then the last line clears it from the memory (note the "udg_" before your variable name, it's important)

What you can't to is this


  • Actions
    • Set VariableSet MyPoint = (Center of My Region1 <gen>)
    • Unit - Create 1 Footman for Player 1 (Red) at MyPoint facing Default building facing degrees
    • Set VariableSet MyPoint = (Center of My Region2 <gen>)
    • Unit - Create 1 Footman for Player 1 (Red) at MyPoint facing Default building facing degrees
    • Custom script: call RemoveLocation(udg_MyPoint)
In this case, the first MyPoint is overwritten before being cleared and it would leak
 
 
Top