HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Are triggered casting and unit casting the same?

06-26-2006, 02:59 AM#1
darkwulfv
If a spell is triggered to activate, and another trigger stops a unit from casting the spell, will they counter-act each other? I'd test this but I'm not at my computer I'm on vacation at a relative's house, and I'm working on my map by paper. Thx anyone!
06-26-2006, 03:12 AM#2
Naakaloh
If you call a function you can't stop it by ordering the unit to stop, but if you call a function to order the unit to cast a spell, then of course you can order it to stop.

Also, there are two events that are generally used for triggering the start of spells: EVENT_PLAYER_UNIT_CAST and EVENT_PLAYER_UNIT_EFFECT.

Cast fires when the unit begins casting and effect fires when the spell actually starts. So, you can catch the cast event to stop a unit from casting, or catch the effect event to start calling the appropriate function to cast the spell.
06-26-2006, 03:18 AM#3
darkwulfv
Uhhh I'm doing this GUI so not much of what you just said made much sense... What your saying is that using the GUI trigger

EVENT:
Unit begins casting ability
CONDITIONS:
ability being cast = xxxx
ACTIONS:
Stop triggering unit
whatever

would work?
06-26-2006, 03:32 AM#4
harshateja
Essentially yes. If I understand Naakala, you can stop the unit at the Unit Begins Casting an Ability stage and prevent another trigger that fires at the Unit Begins the Effect of an Ability. However, it doesn't work vice versa.
06-26-2006, 03:41 AM#5
Naakaloh
Correct, however you'll need to pause the unit, order it to stop, then unpause it for the best effect. Also, for some abilities there is the possibility that using "Unit begins the effect of an ability" event will stop the triggered spell, but it's not guarunteed so it's best to use "Unit begins casting an ability."
06-26-2006, 03:55 AM#6
darkwulfv
See, this is where controversy beings. In 75% of the spells I;ve asked about, people have said use "Unit begins effect..." But I've always gotten the best work with "Unit beings casting..." Thx Naakaloh, this is exatly what I needed ;D
06-26-2006, 06:54 AM#7
Captain Griffen
Use 'unit begins effect of' for doing effects, and 'unit begins casting' to interrupt casting. I have never had any problem with 'unit begins effect of', and it is far superior in that it cannot be cheated into producing the effects at no cost.
06-26-2006, 12:44 PM#8
BertTheJasser
GetTriggerUnit() returns always the unit that made the trigger fire, sometimes null (timerevents, mapinit)
06-26-2006, 02:00 PM#9
darkwulfv
@captaingriffen Well if my spell is one that morphs a unit, I don't want it to be mid-morph when it fires. I just want the unit to stop casting. The spell kicks in on it's own via another trigger.