| 11-14-2004, 04:16 AM | #1 |
Im making some gates thats open and close for my map, but I just cant seem to get the trigger for it to work. I am using a unit as a visual for my gate, but I leave the origonal buildings(vortex coloring set so that trans is 100%) for pathing. The plan is that when a gate is "opened" it checks for custom value, if 1 is horizontal and open, if 2 it is vertical and open, if 0 it is closed(I can use the pathing unit to detect witch gate in this case) and then precedes to replace pathing units and change animations depending on the situation. The problem? nothing works, no animations, no pathing changes, nothing. Heres the code Code:
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Open/close
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Triggering unit)) Greater than 0
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Custom value of (Triggering unit)) Equal to 1
Then - Actions
Animation - Play (Triggering unit)'s Stand animation
Unit - Replace (Random unit from (Units within 10.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Gate - Open))) with a Gate - Horizontal using The old unit's relative life and mana
Unit - Set the custom value of (Triggering unit) to 0
Else - Actions
Animation - Play (Triggering unit)'s Stand animation
Unit - Replace (Random unit from (Units within 10.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Gate - Open))) with a Gate - Vertical using The old unit's relative life and mana
Unit - Set the custom value of (Triggering unit) to 0
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 10.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Gate - Horizontal))) Equal to 1
Then - Actions
Animation - Play (Transporting unit)'s Animation - Spell animation
Wait 1.66 seconds
Unit - Replace (Random unit from (Units within 10.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Gate - Horizontal))) with a Gate - Open using The old unit's relative life and mana
Animation - Play (Triggering unit)'s Animation - Death Alternate animation
Unit - Set the custom value of (Triggering unit) to 1
Else - Actions
Animation - Play (Triggering unit)'s Animation - Spell animation
Wait 1.66 seconds
Unit - Replace (Random unit from (Units within 10.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Gate - Vertical))) with a Gate - Open using The old unit's relative life and mana
Animation - Play (Triggering unit)'s Animation - Death Alternate animation
Unit - Set the custom value of (Triggering unit) to 2oh, and yes the units custom values are set to zero when they are built. |
| 11-14-2004, 11:55 AM | #2 |
Why use a so difficult trigger? just use an ability based on defend and use the order strings! (defend and undefend if im correct). |
| 11-14-2004, 03:34 PM | #3 | |
Quote:
That would simply change the if statement, it would make it no simpler what-so-ever. I still have to detect which gate is being open/closed. It also doesnt change the fact that the trigger isnt working... |
| 11-14-2004, 04:28 PM | #4 |
Try debugging yourself. Put some "game - display message to all players..." actions into the trigger to see if it even runs, and which parts of it execute in what situation, what's the value of variables/custom values... |
| 11-14-2004, 06:59 PM | #5 |
*bangs self on head* why didnt I think of that? After doing the said, I found several things, all of which have been corrected 1. For some reason defend does not trigger the spell being cast event, I replaced it with an event and conditions picking up orderstrings and it worked 2. the pathing map of the open gate(Circle of power med) was somehow screwing up the positioning and was failing to be detected by the trigger due to being out of range. I have corrected it with a custom pathing map(2x2 blue) 3. Odly enough, the animation needs the wait, yet it waits for the full animations time before playing. Without the wait, it simply doesnt open. Odd, I will continue to play with this a little. 4. For some reason, the cooldown field of defend does NOT work. does anyone know why? is there a way around it? is there a way to prevent a unit from useing an ability without taking it away? oh and please, Anitarf (or anyone else for that matter), never refrain from smacking me on the head when I miss somthing so obvious. |
