Triggers - Memory Leaks and Custom Scripts

OST(Norway)

New Member
Reaction score
0
If I use one variable in many situations, do I need to remove the leaks?
For example in a loop.

-Loop
----Set Temp_Point = (Random point in (Playable map area))
----Create unit at Temp_Point....
-Call RemoveLocation (udg_Temp_Point)

Do I have to place the "leak remover" in the loop?
 

mapguy

New Member
Reaction score
46
Custom script: call DestroyTimer( udg_Your_Variable ) //Countdown Timer

I have to destroy a countdow timer everytime it expires and then create it again, or I just have to destroy It if I'm not going to use it again?
 

Jedi

New Member
Reaction score
63
Just destroy it once if you are not going to use it again.You don't need to destroy timers in GUI.
 

tooltiperror

Super Moderator
Reaction score
231
In GUI you have... global variables. Which means you can reuse them. So if you are over writing the timer, why destroy it? I the leak from the timer at the end of the game will likely be under 4 mb, somewhere around there. If you have a lot of timers, recycle.
 

SerraAvenger

Cuz I can
Reaction score
234
Imagine a hotel (the memory), and lots of little rooms (to put stuff inside like "position of <unit>").
Now, people check in, rooms are busy... everything's just normal.
However, they simply leave without checking out.
At some point, the hotel will appear full even though no one's in.

"The master" has spoken.
All bow in front of "the master".
 

tooltiperror

Super Moderator
Reaction score
231
"The master" has spoken.
All bow in front of "the master".

Perhaps a better analogy would be memory is the hotel and locations are the rooms in the hotel. Clearing the Leak is checking out, and simply leaving is removing from the game. Even if you remove them from the game, when someone else comes to check in, they can't, because the space is used up. Unfortunately, this space can be outside of WC3.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yes, that is correct...

Show the entire trigger, please ;)


FAIL XD
Was looking at another page of this, and replied to that question XD

@ ToolTipError: Well, that is what he wrote, isn't it ?! :S
And it would be better to say the the rooms are the different types of data you can store, and the people checking in are the data to be stored as these different types :D
Then also, of course, if they check out when they leave (Are removed), a leak isn't created, otherwise it is :D
 

SerraAvenger

Cuz I can
Reaction score
234
Then also, of course, if they check out when they leave (Are removed), a leak isn't created, otherwise it is :D

The leak is created while you code. What you mean is that memory is leaked.

Memory is leaked when the last reference to the memory is destroyed. It is like forgetting about the memory.

Also what the master has been talking about was handle id leaks, not memory leaks :D
 

colinjames13

New Member
Reaction score
0
Abilities casted at the same time

:confused:Please Help!!
Most of my abilities in my map has lots of dummy units. All of them have expiration timers already but when two heroes cast abilities with dummy units at the same time, the two heroes like switched abilities or something. Sorry if I can't explain it well.
 

colinjames13

New Member
Reaction score
0
Here are the triggers:



blade beam
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Blade Beam
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Casting unit)) Equal to Elesis
Then - Actions
Set bbpoint = (Target point of ability being cast)
Set bbunit = (Casting unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Blade Beam for (Casting unit)) Equal to 1
Then - Actions
Unit - Create 1 blade beam for (Owner of bbunit) at (Position of bbunit) facing Default building facing degrees
Set bbdummy = (Last created unit)
Animation - Play bbunit's attack animation
Unit - Add a 1.00 second Generic expiration timer to bbdummy
Unit - Order bbdummy to Attack Ground bbpoint
Wait 0.50 seconds
Animation - Reset bbunit's animation
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Blade Beam for (Casting unit)) Equal to 2
Then - Actions
Unit - Create 1 blade beam2 for (Owner of bbunit) at (Position of bbunit) facing Default building facing degrees
Set bbdummy = (Last created unit)
Animation - Play bbunit's attack animation
Unit - Add a 1.00 second Generic expiration timer to bbdummy
Unit - Order bbdummy to Attack Ground bbpoint
Wait 0.50 seconds
Animation - Reset bbunit's animation
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Blade Beam for (Casting unit)) Equal to 3
Then - Actions
Unit - Create 1 blade beam3 for (Owner of bbunit) at (Position of bbunit) facing Default building facing degrees
Set bbdummy = (Last created unit)
Animation - Play bbunit's attack animation
Unit - Add a 1.00 second Generic expiration timer to bbdummy
Unit - Order bbdummy to Attack Ground bbpoint
Wait 0.50 seconds
Animation - Reset bbunit's animation
Else - Actions
Else - Actions




The other ability:



burstshot
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Burst Shot
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Casting unit)) Equal to Lire
Then - Actions
Set o = (Casting unit)
Set tl = (Target point of ability being cast)
For each (Integer A) from 1 to 50, do (Actions)
Loop - Actions
Animation - Change o's animation speed to 1000.00% of its original speed
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
Set o2 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o2
Unit - Order o2 to Attack Ground (tl offset by (Random real number between 0.00 and 256.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 128.00 towards 0.00 degrees) facing Default building facing degrees
Set o3 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3
Unit - Order o3 to Attack Ground (tl offset by (Random real number between 0.00 and 256.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 128.00 towards 90.00 degrees) facing Default building facing degrees
Set o3_Copy = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy
Unit - Order o3_Copy to Attack Ground (tl offset by (Random real number between 0.00 and 256.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 128.00 towards 180.00 degrees) facing Default building facing degrees
Set o3_Copy_2 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_2
Unit - Order o3_Copy_2 to Attack Ground (tl offset by (Random real number between 0.00 and 256.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 128.00 towards 270.00 degrees) facing Default building facing degrees
Set o3_Copy_3 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_3
Unit - Order o3_Copy_3 to Attack Ground (tl offset by (Random real number between 0.00 and 256.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 256.00 towards 0.00 degrees) facing Default building facing degrees
Set o3_Copy_4 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_4
Unit - Order o3_Copy_4 to Attack Ground (tl offset by (Random real number between 0.00 and 384.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 256.00 towards 90.00 degrees) facing Default building facing degrees
Set o3_Copy_5 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_5
Unit - Order o3_Copy_5 to Attack Ground (tl offset by (Random real number between 0.00 and 384.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 256.00 towards 180.00 degrees) facing Default building facing degrees
Set o3_Copy_6 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_6
Unit - Order o3_Copy_6 to Attack Ground (tl offset by (Random real number between 0.00 and 384.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 256.00 towards 225.00 degrees) facing Default building facing degrees
Set o3_Copy_7 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_7
Unit - Order o3_Copy_7 to Attack Ground (tl offset by (Random real number between 0.00 and 384.00) towards (Random real number between 0.00 and 360.00) degrees)
Unit - Create 1 burst Shot for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by 256.00 towards 270.00 degrees) facing Default building facing degrees
Set o3_Copy_8 = (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to o3_Copy_8
Unit - Order o3_Copy_8 to Attack Ground (tl offset by (Random real number between 0.00 and 384.00) towards (Random real number between 0.00 and 360.00) degrees)
Animation - Play o's attack animation
Wait 0.01 seconds
Animation - Change o's animation speed to 100.00% of its original speed
Animation - Reset o's animation
Else - Actions



This also happens with other abilities with dummy units, its like the actions of the other trigger transfers with the other?!! I hope u know wat i'm saying.
 

Sui-cookie

You can change this now in User CP.
Reaction score
49
post things like that in the actual help part.... i would have never seen this if i had'nt been looking for more terrain tuts >.>
post it here :thup: im sure someone will be glad to help.
Oh, and use the wc3 trigger thing. It looks like a lowercase A when your writing these.

Now, to relate this post somehow...
Awesome tut? :p lol... it really is, one of the first i ever read... other than the hero creation thing... years ago.... ;) this has helped me, and i hope it helps everyone that has been here/is to come.
 

tonton302

Member
Reaction score
0
what are the custom scripts for codegen save/load??? they wont let me use the save/load system...:banghead:
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
I'm not sure whether I'm allowed to bump this amazing tutorial :p, but I think it'd be better if you added in how to clear leaks in an array, using Loop Integer A. For example there are 20 special effects saved into SpecialEffectVar[1] to [20], it'd be a little tedious to clear them one by one.

I came across this problem myself and had no idea how to replace the 1-20 with the [bj_forLoopAIndex]. Maybe you can add this into your tutorial and make it simpler for newbies llike me around :thup:
 

emjlr3

Change can be a good thing
Reaction score
395
recommend JASS - GUI is so idiotic its not even funny
 

Yoww89

New Member
Reaction score
0
I'm sorry but i didn't get it. Why do i need to store playable map area in a global variable and then remove it when it's already a default world editor variable (can i call it this way? .p) just like triggering unit? PS: My english suc** so it would be great if someone could keep it basic in the explanation. Ty :]
 

dianamod27

Member
Reaction score
1
You don't need to store playable map area. As the tutorial says, using certain functions creates and stores unnecessary data. You need to "catch" that data and remove it or else it will flood your memory.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top