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

[JASS] A useful Leak?

Status
Not open for further replies.
Level 9
Joined
Jul 27, 2006
Messages
652
Ok i'v found something that many others before me may have found but i think is very useful for spell making if you dont already know what it is.
A trigger Leak.

Ok this is how it works.
Lets say you want to create a channeling spell.
You then need more than one trigger so you can stop the the spell when a unit issues an order.
So you create a new local trigger variable.
Add the Event and actions and leave it.
The trigger leaks the variable and it becomes an actual trigger and since you only leak it once there is no problem with lagging ect.
and since all code can now be put in one trigger it is more import friendly

I've attached an example...
 

Attachments

  • Trigger Leak Demo.w3x
    61 KB · Views: 65
Level 11
Joined
Jul 12, 2005
Messages
764
Umm, this isn't really a leak, neither a bug. It is an advantage of jass, that you've just came upon.
Yes, you can add the same action (and surprise, condition) for different triggers if you want to.
Sorry if i destroyed your great idea on inventing something, but this is not that interesting. :p
 
Level 9
Joined
Jul 27, 2006
Messages
652
Hahaha... I didnt think i was inventing anything new. i just though some of the jass noobs, lyk myself, would like to know some of these advantages... I mean all you see in this section are error reports... We need more people testing and posting to help others!

This may not be interesting to you but a first time jass spell maker might find this useful?
 
Level 9
Joined
Jul 27, 2006
Messages
652
Hahaha... I didnt think i was inventing anything new. i just though some of the jass noobs, lyk myself, would like to know some of these advantages... I mean all you see in this section are error reports... We need more people testing and posting to help others!

This may not be interesting to you but a first time jass spell maker might find this useful?
 
Level 4
Joined
Sep 20, 2005
Messages
72
Lets say you want to create a channeling spell.
You then need more than one trigger so you can stop the the spell when a unit issues an order.

...i dont quite get what you mean... how could you use this effectively?
and what kinds of other cool applications can you use this technique for?
i saw this kind of use in the WEU script but it was quite difficult to follow x_x
 
Level 9
Joined
Jul 27, 2006
Messages
652
Well when most people make a channeling spell they use two GUI triggers:
1. The actual spell
2. The trigger that stops the spell actions when the caster is issused an order.
So you would need 2 GUI triggers. But if you created 2 local triggers in one GUI trigger you could do the same thing and save space which is good for large maps.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
or Any Unit Takes Damage is a very practical implementation of making triggers on-the-fly

or a Shield-type spell ><

or some methods of attack detection

etc, etc, there are alot of uses when you think about it.

(also, making regions on the fly, you need triggers for them :p)

EDIT: I should mention that a leak implies that there are no remaining references, and thus this isn't really a leak (like pask said)
 
Level 9
Joined
Jul 27, 2006
Messages
652
Other things you could use it for:

Dialog boxes
Unit Events ( Enters region ect)
Key board control
Trackables
Chat Events

Basicaly any use input event.
 
Level 5
Joined
Feb 16, 2006
Messages
151
...
OK, you need to know what "leak" means.
A leak is an object that has been created on a specific event, thus it will be most likely only used once. After it has been used, it becomes worthless for anything later, so it would be smart to remove it, because leaving behind a worthless "single-usage" object is not reasonable.
 
Level 9
Joined
Jul 27, 2006
Messages
652
Hmmm...
My idea of a leak was a local variable that was not nullified ect, at the end of the function causing it to be saved and to take up space, which causes lag.
But your descriptions better...
 
Status
Not open for further replies.
Top