PDA

View Full Version : Possible?


Rainbird
07-26-2006, 4:44 PM
Okay, my "possible" question is as follows: Is it possible to stop an already running trigger? Because if it is, then it's my triggers that aren't working properly.
The deal is that I have a unit with a transformation-skill. Now that works just fine, no trouble with transforming etc... But the transformed unit also has a transformation skill, so when the skill the first unit used runs out, it spawns an extra hero...
I need it done so that the timer from the first skill cancels when the next skill is used, or something alike
Need heeeeelp...
The skills/triggers:
morph level1
Events
Unit - A unit owned by Player 1 (Red) Begins casting an ability
Conditions
And - All (Conditions) are true
Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 1
(Ability being cast) Equal to Transform (Level 1)
Actions
Set HeroCache3 = (Triggering unit)
Game Cache - Create a game cache from map.w3x
Game Cache - Store HeroCache3 as morph of Category in (Last created game cache)
Special Effect - Create a special effect attached to the chest of HeroCache3 using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
Wait 0.50 seconds
Unit - Replace HeroCache3 with a Transformed (Level 1) using The new unit's max life and mana
Set HeroMorph3 = (Last replaced unit)
Hero - Set HeroMorph3 Hero-level to (Level of HeroCache3), Hide level-up graphics
Animation - Change HeroMorph3's size to (90.00%, 90.00%, 90.00%) of its original size
Special Effect - Destroy (Last created special effect)
Selection - Select HeroMorph3 for Player 1 (Red)
Wait 60.00 seconds
Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Undead\Darksummoning\DarkSummonTa rget.mdl
Wait 0.50 seconds
Game Cache - Restore morph of Category from (Last created game cache) for Player 1 (Red) at (Position of HeroMorph3) facing 0.00
Set HeroCache3 = (Last restored unit)
Selection - Select HeroCache3 for Player 1 (Red)
Hero - Set HeroCache3 Hero-level to (Level of HeroMorph3), Hide level-up graphics
Unit - Remove HeroMorph3 from the game

morph level2
Events
Unit - A unit owned by Player 1 (Red) Begins casting an ability
Conditions
And - All (Conditions) are true
Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 1
(Ability being cast) Equal to Transform (Level 2)
Actions
Set HeroCache4 = (Triggering unit)
Game Cache - Create a game cache from map.w3x
Game Cache - Store HeroCache4 as morphed2 of Category in (Last created game cache)
Special Effect - Create a special effect attached to the chest of HeroCache4 using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
Wait 0.50 seconds
Unit - Replace HeroCache4 with a Transformed (Level 2) using The new unit's max life and mana
Set HeroMorph4 = (Last replaced unit)
Hero - Set HeroMorph4 Hero-level to (Level of HeroCache4), Hide level-up graphics
Animation - Change HeroMorph4's size to (110.00%, 110.00%, 110.00%) of its original size
Special Effect - Destroy (Last created special effect)
Selection - Select HeroMorph4 for Player 1 (Red)
Wait 60.00 seconds
Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Undead\Darksummoning\DarkSummonTa rget.mdl
Wait 0.50 seconds
Game Cache - Restore morph of Category from (Last created game cache) for Player 1 (Red) at (Position of HeroMorph4) facing 0.00
Set HeroCache4 = (Last restored unit)
Selection - Select HeroCache4 for Player 1 (Red)
Hero - Set HeroCache4 Hero-level to (Level of HeroMorph4), Hide level-up graphics
Unit - Remove HeroMorph4 from the game


As you can see I try to restore the original unit, instead of the morph2 unit. I don't know if that can be changed to something better. (I just store morph2, just in case...)

Please help...:(

Hotshot
07-26-2006, 5:12 PM
Is it possible to stop an already running trigger?
The 'Skip Remaining Actions' action will end a trigger right away. Use it with an 'if' statement.

Rainbird
07-26-2006, 5:27 PM
Thx! I'll try it straight away! :D

EDIT: It aien't working...

morph level1
Events
Unit - A unit owned by Player 1 (Red) Begins casting an ability
Conditions
And - All (Conditions) are true
Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 1
(Ability being cast) Equal to Transform (Level 1)
Actions
Set HeroCache3 = (Triggering unit)
Game Cache - Create a game cache from map.w3x
Game Cache - Store HeroCache3 as morph of Category in (Last created game cache)
Special Effect - Create a special effect attached to the chest of HeroCache3 using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
Wait 0.50 seconds
Unit - Replace HeroCache3 with a Transformed (Level 1) using The new unit's max life and mana
Set HeroMorph3 = (Last replaced unit)
Hero - Set HeroMorph3 Hero-level to (Level of HeroCache3), Hide level-up graphics
Animation - Change HeroMorph3's size to (90.00%, 90.00%, 90.00%) of its original size
Special Effect - Destroy (Last created special effect)
Selection - Select HeroMorph3 for Player 1 (Red)
Wait 60.00 seconds
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 1
(Ability being cast) Equal to Transform (Level 2)
Then - Actions
Skip remaining actions
Else - Actions
Do nothing
Special Effect - Create a special effect attached to the chest of (Triggering unit) using Abilities\Spells\Undead\Darksummoning\DarkSummonTa rget.mdl
Wait 0.50 seconds
Game Cache - Restore morph of Category from (Last created game cache) for Player 1 (Red) at (Position of HeroMorph3) facing 0.00
Set HeroCache3 = (Last restored unit)
Selection - Select HeroCache3 for Player 1 (Red)
Hero - Set HeroCache3 Hero-level to (Level of HeroMorph3), Hide level-up graphics
Unit - Remove HeroMorph3 from the game


What am I doing wrong?

gamer102
07-31-2006, 11:52 PM
BEST METHOD (I THINK)

put game - text message inbetween the actions
thats what i like to call "Debugging a map"
its to see what trigger is setting off the whole thing.


2nd
Try making a copy of that trigger and take out the extra stuff
change unit size,coloring,
leave the hard-coding that actually make the trigger work

hooded
08-04-2006, 12:41 PM
go back to the first trigger.

put the other stuff the wait and after in another trigger. (initially off) Turn the trigger on at the end of the first trigger. Then add another trigger that when a unit casts morph 2, it turns the new trigger back off.

I dont know if that made sense, so ill try this:

morph 1 -> turns on KILL MORPH 1

waits 60 secs, if nothing happens, trigger runs.

add a new trigger: kill morph 1 (events- unit casts morph 2 (this is premature of the first ability), actions - turn off KILL MORPH 1).

add another one for morph 2 if necissary.
-------------------------------------------

I dont know if this will work, ive never tried it before. If this doesnt work, add in a boolean check:

add this
If <boolean> = true, skip remaining actions

and have kill morph 1 (events- unit casts morph 2 (this is premature of the first ability), set boolean = true).

you need the extra event (casting of morph 2), as the trigger will just run through with your skip remaining actions.