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

Mui?

Status
Not open for further replies.
Level 3
Joined
Feb 14, 2009
Messages
23
so i want to make this spell using triggers and variables and i want so that 2 or more units can cast that spell at the same time without screwing up the variables and all
how can i do that?
 
Level 3
Joined
Feb 14, 2009
Messages
23
i don't have any trigger available but give me an example of MUI trigger that does:
unit uses spell on target unit, target unit is stored in a variable with a couple of points too and then performs whatever actions for 10 seconds. But if a different unit casts the same spell on another unit the variables change to the new unit screwing up the first. That is my problem.
 
Level 3
Joined
Mar 2, 2008
Messages
62
write out your whole trigger in gui, using the variables. then convert it to custom script.

then at the start of the trigger (after the Function_Trig_Actions line), declare local variables.

ex:

JASS:
local unit u
local location l

location is a point.

then, replace all your globals with the locals you declared. that stops them all being overwritten when a new instance runs.

oh and dont forget to remove them all at the end.

JASS:
call RemoveLocation(l)
set u = null
call RemoveUnit(u)

im not 100% sure on the setting of the unit var to null and removing it to remove leaks, someone will have to confirm that.
 
Level 9
Joined
Apr 7, 2008
Messages
176
Is MUI seriously that easy in Jass?? WTF, and Ive been screwing around with GUI this whole damn time!!?!?! OMFG!!!
Anyways if you're using GUI and u wanna make it MUI, start with assigning the casting unit to a variable with an array, and assign it an array in the trigger for casting the spell. Then at the bottom line of the trigger change the array (which is an integer BTW) that the unit is assigned to (Integer = Integer (+1)). It should come to you from there. If that doesnt make sense, which it probably wont, look up almost any spell that has been approved, and open it in WE. Wow, explaining MUI in Jass was WAY easier. :p Though im wondering how u and i dont get overwritten.??

Okay* read a tutorial and found out. If your spell uses another trigger to do the actions, the Jass way doesnt quite work, (Unless you know how to do full Jass). But mixing Jass and GUI wont work in that case.
 
Last edited:
Status
Not open for further replies.
Top