• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Multiple Casters

Status
Not open for further replies.
You know, I've resently noticed a very weird bug while makng a spell of mine.

So, the spell is called Slime Walk. When activated, the caster will leave a trail of slime behind him when he walks. So, I set the Variables (WebWalker = Triggering Unit) and use a repeating 0.03 timer to create a dummy at WebWalker's position. The spell lasts 30 seconds.

What bothers me most is that when I order another unit to cast the same spell, the path of slime is suddenly interrupted and starts to appear at the position of the 2nd caster. I think it's because the WebCaster variable is changed to the 2nd caster, and of course, it doesn't finish completely the 1st cast's effect.

Do you know how I can make it work so that more than 1 caster can use this skill, but not interrupting the effects of the first cast for the first caster?

NOTE: Such One-unit-per-cast/One-Caster-Only bug can be found in many other spell attempts, especially when TargetUnit or CasterUnit variables are involed.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Use handle vars. . .

When the spell is cast get it to create a timer that loops every blah and creates the slime at position of the attached unit.

You simply have to attach the casting unit to the timer so that it is easily retrived.

Handle vars = method of storing a value or unit to a unit,trigger,timer,effect,ect by using that objects handle value and using it as a reference in a gamecashe.

Very easy and simple and all good maps use it (excption of DBZ tribute)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
actually, you cant in GUI, but thats irrelevant, because we are not directly reffering to the variable type handle, which is the Parent-Type of every type of var except Boolean, Code, String, Integer, and Real.

however, the "Handle Variables" or "Local Handle Variables" that JASSers refer to are actually a set of functions that abuse some bugs with warcraft, and make more advanced JASS code multiinstanceable.

here is a link to the origional script

here is a link to the tool that makes them semi-usable for GUI.

Note: i have never actually used these myself ( the GUI ones ) ^^

they are sorta hard to understand for some ppl at first, so PM me if you need any help ^^
 
Status
Not open for further replies.
Top