Quick leak question

Baltazhar

Active Member
Reaction score
55
I know 'Leaks' are probably the most used and abused topic, and I kinda feel bad just for asking about them. However, I might add, I've searched a lot of threads and several tutorials on Leaks, so it's not completely lame questions.

Since I don't know Jass, and trigger using the GUI, I have a small question about the Custom Script that I use to clean up my variables.

Code:
Set Temp_Group = (Units owned by Player 1 (Red))
Custom script:   call DestroyGroup (udg_Temp_Group)
Code:
Set Temp_Point = (Position of (Triggering unit))
Custom script:   call RemoveLocation (udg_Temp_Point)
My question to this part is: Is there a space between DestroyGroup/RemoveLocation and (udg_Temp_...)? Looking at several tutorials have just confused me, since some say with a space, and some say without a space >.<

Code:
Special Effect - Create a special effect at Temp_Point using Objects\Spawnmodels\Orc\OrcSmallDeathExplode\OrcSmallDeathExplode.mdl
Special Effect - Destroy (Last created special effect)
I know that destroying the special effect will clean up the leak, but if I do it right after the effect is created (as the code shows), will the effect be shown or just removed before it can be displayed?

Hope these aren't considered pointless question, and i'd be grateful for any help u guys/gals can give me :)

- Balt
 

The Undaddy

Creating with the power of rage
Reaction score
55
>>My question to this part is: Is there a space between DestroyGroup/RemoveLocation and (udg_Temp_...)?

As long as the compiler doesn't show errors,it's all good :cool:.When there's a bracket '()',jass usually doesn't care whether there is or isn't a space.

>>will the effect be shown or just removed before it can be displayed?

When an effect is destroyed it plays it's "death" animation.AFAIK when the special effect has no death animation,it'll finish playing it's birth animation and perish.
 

Slapshot136

Divide et impera
Reaction score
471
for the destroy special effect there are 2 types: continuous effects that wont show if you destroy them instantly (most things), and effects that are 1-time that should be deleted right after you create them.. like thunderclap. you can check which type it is by going into object editor, and then use the window on the left of the world editor to check. if it gives you a time, that's the time before it "restarts" and plays it's animation again, if it doesnt then it's a 1-time
 

Sim

Forum Administrator
Staff member
Reaction score
534
You can put a space if you want, it doesn't matter.
 

Baltazhar

Active Member
Reaction score
55
Oh thank God, that's good news. Then I won't have to go back and edit all my custom scripts :) Almost all the way through the endless hordes of triggers :p

Concerning the special effects, that's a very nice tip Slapshot. Never noticed that some have a timed animation (like 'birth'), and some don't. I'll go through the special effects and clean the up in an orderly fashion.

The Undaddy: Not sure where the compiler in WE is, I expect it checks the map when u save it? Anyway, I've been able to save and testplay my map, so nothing serious is wrong so far :)

Thx a lot for the help guys, it's nice to be reassured and get some questions answered. I think I'll just type in 'idkfa' and give u all a blast of my RepGun® :D

- Balt
 

The Undaddy

Creating with the power of rage
Reaction score
55
The Undaddy: Not sure where the compiler in WE is, I expect it checks the map when u save it? Anyway, I've been able to save and testplay my map, so nothing serious is wrong so far :)

Yep,the compiler checks when you save the map.And additional info about the effect,inspired by Slapshot's post :p.

When effects are created,they play their "birth" animations.
After that,they start playing their "stand" animations over and over.
Finally,when destroyed,they play the "death" animation.

And for that I personally prefer using dummy units for special effects :)
 

Baltazhar

Active Member
Reaction score
55
Hmm.. That isn't a halfbad idea there Undaddy. I expect u mean, making a unit with the modelfile of the desired animation, and just adding an expiration timer? That's an easy way to clean it up, but it does limit the position of the effect a little. It's easier to attach to head than calcute the flying height depending on target unit :)

But anyway, if the target is a point and not a unit, this would make it a lot easier :)
Big fan of dummy units for spells alrdy, might as well abuse them to the full potential :D

EDIT: I have a final question for that Unit-as-SpecialEffect. If I make a unit with special effect modelfile, and set the expiration timer to e.g. 2 seconds and the animation of the effect only takes .33 seconds, it will play 6 times before removed, right? It's needed to time the expiration timer to the length of the animation?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top