Triggers - Memory Leaks

SFilip

Gone but not forgotten
Reaction score
633
If those actions worked the player would get defeated. :rolleyes:
You must only remove things that get recreated such as points or unit/player groups.
 
C

Capt Griffen

Guest
You missed out several types that can leak, and you have nothing about handle index leaks.
 
Z

Zerotech

Guest
Sorry to bring this up, I was wondering if it's possible to use the custom scripts call destroy fucntion on Array-Enabled Variables. It would certainly beat having to write x amount of times to remove for eg. 14 point variables and I would have to write 14 lines of point removals if one line of code can do it.

So far I've tried to use the For Integer A and adding the [Integer A] Array variable will not work.

UPDATE:
OK I see why, is that custom scripts are considered to be string variables as there aren't any viable solutions to workaround this.

It would be nice though that if you can remove x amount of lines and it would certainly make it a lot better.
 

SFilip

Gone but not forgotten
Reaction score
633
> for eg. 14 point variables
Why do you need so much? Two at most is all you will ever need to fix all leaks.
 
Z

Zerotech

Guest
call RemoveLocation(udg_myArray[bj_forLoopAIndex])

Thanks for the info.

Atm I'm not ready to enter the JASS Coding phase as I'm still learning the whole coding structure for world editor.

The 14 point variables that I've mentioned were for an arena map that I am currenlty working on.
 
T

tsbergman

Guest
Excellent tut! BTW, we are working on a ROC map and Custom Script requires TFT. Do we have to get into JASS to eliminate these leaks? I can also just setup a bunch of points on init and then keep using these over and over to avoid the leak. We are doing a maze map and have creeps bouncing between multiple point so we are using lots of center of region calls. Each time a point is leaked. About 60K in under an hour. Not too bad I think but still would like to get rid of the leaks.
 

SFilip

Gone but not forgotten
Reaction score
633
You can convert the whole trigger to Jass and add the custom script line, but unless you know Jass, don't do this until you are sure the thing is working perfectly.
 
Z

Zpothu

Guest
i have another question.... why should I keep removing these region points with the custom script if i am just going to create that point in that same spot every time. :banghead:
 
L

LucidWay

Guest
When i was working on this sheep farmer game (I fixed it up a lot, it wasnt my original map), there were HUGE memory leaks, the biggest one was an array memory leak. Ex:
You define a global array of length 10.
Then you set the array[12] = XXX
(This will create a copy of the original array that is now 12 long with the new values)
I know just creating the new array can be very expensive on the cpu. Im about 90% sure that it will also leave the old array behind as garbage.
Figured this could be added. Cheers.
 

emjlr3

Change can be a good thing
Reaction score
395
i do not believe that is the case, it does not really matter what you set it to, after u defined the array size

at the map init, it goes throgh all arrays and sets them to null/0

just because your array[12] was never set to null does not mean using it will leak anything
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
Hi

I would like to know, argh hard 2 explain i'll show you:^^


Here are some examples

Video - Turn cinematic mode Aus for Playergroup
Spielergruppe - Add (Picked player) to NoControlPlayerGroup
((Picked player) is in NoControlPlayerGroup) Ungleich True
Set Rechtsgehen[(Player number of (Picked player))] = -15.00


do these lines cause a leak?
Asking about wheter beeing in playergroup or not might not cause leaks i think.
But whats about get player number or so?

I somewhere read that only bj functions cause leaks.
These are no bj functions, i think they do not create leaks but i am not sure.

Can u check wheter something leaks or not by checking if it uses/is a bj function?


ty
 

Cilla

is watching you! Ahh, fresh meat!
Reaction score
39
To remove player group leaks, replace "Group" with "Force".


You can not replace group with force,
there is no set bj_wantDestroyForce = false


Can you tell me, what is the script to remove a force?

Edit: sry 4 doublepost
 
B

BIackSheep

Guest
trigger problem

hi,
something in the following trigger gets totaly wrong. In singleplayer everything works correct, but if i play with others, all other players leave without lagging out at the same time. It must be this trigger, because if i set a "wait game time seconds 1000000" before it, nobody leaves. I dont see what the problem could be. Could it be that i created the trigger in version 1.20e of warcraft and not 1.21? Please help me :(
Code:
Ereignisse
    Map initialization
Bedingungen
Aktionen
    
    Auslöser - Turn off plus 500 gold <gen>
    Wait 5.00 seconds
    Einheit - Change color of Hauch Gottes gelb 0270 <gen> to Gelb
    Spiel - Display to (All players) the text: Euer Gott wird in K...
    Video - Clear the screen of text messages for Spielergruppe - Spieler 1 (Rot)
    Wait 0.50 seconds
    Kamera - Pan camera as necessary for Spieler 1 (Rot) to (Position of Himmelsschloss 0160 <gen>) over 0.50 seconds
    Wait 0.50 seconds
    Video - Send transmission to Spielergruppe - Spieler 1 (Rot) from Gott 0020 <gen> named Turtorial: Play Kein Sound and display Du bekommst jetzt e....  Modify duration: Hinzufügen 5.00 seconds and Warten
    Wait 4.00 seconds
    Auslöser - Turn on video abbruch <gen>
    Video - Send transmission to Spielergruppe - Spieler 1 (Rot) from Gott 0020 <gen> named Turtorial: Play Kein Sound and display Wenn du aber schon ....  Modify duration: Hinzufügen 7.00 seconds and Nicht warten
    Wait 9.00 seconds
    Auslöser - Turn off video abbruch <gen>
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top