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

Making a jass trigger use multiple events---How the heck???

Status
Not open for further replies.
Level 6
Joined
Sep 9, 2004
Messages
152
Hi and thanks to all who read this topic.I have some simple questions about JASS triggering.First is how you make the triggers use multiple events;second,how you make a trigger stop when a spell stops;can you explain me how to use handle,local variables and custome values???I thank to all who are reading the topic and posting some answers.
 
Level 3
Joined
Jul 17, 2004
Messages
57
JASS:
function Trig__Actions takes nothing returns nothing
local trigger end=CreateTrigger()
local unit u=GetTriggerUnit()
// this are local vars, only 'inside' the trigger but like globals (aka gamecage), the disadvatage of them is, u cant refer to them between triggers

call TriggerRegisterUnitEvent(end,u,EVENT_UNIT_SPELL_ENDCAST)

loop
exitwhen GetTriggerEvalCount(end)>0
// Actions during the loop
call Triggersleepaction(0)
endloop

// Actions after the loop

call DestroyTrigger(end)
set end=null
set u=null
endfunction

this is a jasstrigger that stop actions (in the loop) with the end of the channeling
 
Level 3
Joined
Jul 17, 2004
Messages
57
this trigger is started when a unit casts the channeling and ends when it stops. it doenst have 2 events in one, it has a trigger-in-a-trigger, with has the 2nd evend 'ENDCAST'. this is the normal way to do channel-trigger in jass ( i think) i have a local var for the trigger unit, because normaly i need it more than 1 time and however sometimes it leaked the trigger unit after a wait.
 
Level 6
Joined
Sep 9, 2004
Messages
152
well i awais convert the spell from trigger to jass and then i replace the global vars with local.I understand that's trigger in trigger but how and where i must put the script you gave me?And i don't understand how you make jass triggers!You type them in the trigger editor in the converted trigger or you import it like .j?I search the whole sites for jass tuts but i haven't found any good ones.Only the basic jass tut!
 
Level 3
Joined
Jul 17, 2004
Messages
57
maybe you are idiot then this is your version:
a trigger that turns another on
the other trigger with a periodic event, every # sec
a trigger that turn the other off when a unit stops casting

my script replaces all three that means actions of your trigger with.... unit casts sth. the periodic actions belong to the loop, the wait is the cicle duration, effects etc. after casting / after turning out -> befor / after the loop.
 
Level 3
Joined
Jul 17, 2004
Messages
57
nice if i could help ! u but i wish more people would have watched it, because its the best way to do that kind of spell and i like good (made) spell ;-)
 
Level 6
Joined
Sep 9, 2004
Messages
152
problem

there is one more question that bothers me.I maked three spells.The first activates the other 2 ones.And they have periodic time event.I tryed to add them to the first trigger by jass,but it seems that i must make multiple locals of the 2 triggers because i want them to stop when an integer comes 32.If you want i'll send the spell to you and you maybe can make it.It's done now but it's still with 3 non-jass triggers.Plz tell me ur e-mail and i'll send it to you,then send the spells when you make it with 1 trigger to [email protected] you do it,you're my hero!! :D :D
 
Status
Not open for further replies.
Top