Question on MUI spells.

BloodySkullz

Active Member
Reaction score
10
Hi, I am practicing Jass scripts and I am new to it. There is an ability that I am practicing and it is made with Jass scripts.

Ability: Upon casting, (A dummy unit with the model “Stormbolt” is created and will travel 600 units in front of the caster). MUI spell.

So I used timers that will expire to move the “Dummy Stormbolt”. However, it is stored in a Local Variable in a function (A) during my settings [as i.e.”Missile” variable]. When my triggers check for Expiring Timer, it is set to run function (B) on Missile.

I can’t get the function (B) to run the desired action on Missile because it is stored in a function as a local variable and the local variable is used only for 1 function. So can anyone help me with this?
 

Romek

Super Moderator
Reaction score
963
TimerUtils lets you attach data to timers. So you'd use a new timer for each instance, attach the data (struct) using [ljass]SetTimerData(timer, data)[/ljass], then use [ljass]GetExpiredTimer()[/ljass] in the callback to retrieve the timer, and [ljass]GetTimerData(timer)[/ljass] to retrieve your data. TimerUtils is easy to use, and also allows you to recycle timers.

T32 is the most efficient timer system out there for short periods (high frequency). It can only use a single timeout, which is usually 0.03125 for anything that requires moving projectiles or sliding (such as your case). It can be slightly more difficult to grasp, though it'll probably be easier to use once you get the hang of it.

You can also use hashtables to store data to your timer. Simply use [ljass]GetHandleId(timer)[/ljass] as the key.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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