A trigger that becomes disabled

CBBPhoenix

New Member
Reaction score
1
Hi everyone

Why does WE disable this trigger?

Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Armor of Agathys
      • (Level of (Ability being cast) for (Casting unit)) Equal to 1
    • Actions
      • Set frostarmorcaster = (Casting unit)
      • Hero - Create armor of agathys and give it to frostarmorcaster
      • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
      • Set deatheffect = (Last created special effect)
      • Wait 1.00 seconds
      • Special Effect - Destroy deatheffect
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (frostarmorcaster is alive) Equal to True
      • Then - Actions
        • Hero - Create armor of agathys and give it to frostarmorcaster
        • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
        • Set deatheffect = (Last created special effect)
        • Wait 1.00 seconds
        • Special Effect - Destroy deatheffect
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (frostarmorcaster is alive) Equal to True
          • Then - Actions
            • Hero - Create armor of agathys and give it to frostarmorcaster
            • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
            • Set deatheffect = (Last created special effect)
            • Wait 1.00 seconds
            • Special Effect - Destroy deatheffect
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (frostarmorcaster is alive) Equal to True
              • Then - Actions
                • Hero - Create armor of agathys and give it to frostarmorcaster
                • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
                • Set deatheffect = (Last created special effect)
                • Wait 1.00 seconds
                • Special Effect - Destroy deatheffect
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (frostarmorcaster is alive) Equal to True
                  • Then - Actions
                    • Hero - Create armor of agathys and give it to frostarmorcaster
                    • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
                    • Set deatheffect = (Last created special effect)
                    • Wait 1.00 seconds
                    • Special Effect - Destroy deatheffect
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (frostarmorcaster is alive) Equal to True
                      • Then - Actions
                        • Hero - Create armor of agathys and give it to frostarmorcaster
                        • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
                        • Set deatheffect = (Last created special effect)
                        • Wait 1.00 seconds
                        • Special Effect - Destroy deatheffect


These If/Then/Else conditions are repeated 29 times (!) so I just showed some of them. Else function for all of them is "Do nothing".

I use it in my map for a hero who should have a powerup every 1 second as long as he is alive and has a buff from an ability. The point is that it should work as if he gets an additional buff from using his ability, and the 1 second thing is for stopping dispel (so that it will reappear in at most 1 second until the end of the ability which lasts 30 seconds)

Hope someone can tell me why World Editor wont allow me to use these triggers. :confused:
 

HydraRancher

Truth begins in lies
Reaction score
197
Can I first tell you how USELESS that pyramid is? the If runs so many times, you'd be better off doing stacking it all into a big block. Also, tell us, what does it say exactly?
 

CBBPhoenix

New Member
Reaction score
1
Heh

Ya I know it's nub style. But after all I am nub at mapmaking.. But what do you mean by "what does it say"?
 

Galdiuz

Creator of Photon Command
Reaction score
98
Try this. (It's freehand)
Trigger:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Armor of Agathys
      • (Level of (Ability being cast) for (Casting unit)) Equal to 1
    • Actions
      • Set frostarmorcaster = (Casting unit)
      • For each integer A from 1 to 30 do actions
        • If/Then/Else
          • If
            • (frostarmorcaster is alive) Equal to True
          • Then
            • Hero - Create armor of agathys and give it to frostarmorcaster
            • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
            • Special Effect - Destroy (Last created special effect)
            • Wait 1.00 seconds
          • Else
 

Varoze

New Member
Reaction score
0
Am I the only one wondering how the hero's going to get room for those 30 items being given to him? How about destroying the item for each loop?

But yeah,yours is ALOT more effective, Galdiuz, I was going to post that too, but you beat me too it (stupid slow registration e-mail :banghead:)
:)
 

CBBPhoenix

New Member
Reaction score
1
Oops

You're right Varoze: I forgot to say: the item is a powerup that becomes used as soon as equipped. :p
To Galdiuz: Gonna try that. :) .Why does it work btw? Does the WE know that these integers from 1 to 30 are seconds? :confused:
 

Moridin

Snow Leopard
Reaction score
144
Does the WE know that these integers from 1 to 30 are seconds?

Nope it doesn't. When executed it's pretty much instantaneous IF it were not for the "wait 1.00 seconds" it executes each time it runs the loop :p.
 

CBBPhoenix

New Member
Reaction score
1
Aha..

Nope it doesn't. When executed it's pretty much instantaneous IF it were not for the "wait 1.00 seconds" it executes each time it runs the loop :p.

And the 30 thing is just to make it run 30 times?
Sometimes those trigger functions sound a lot more difficult than they are :p

I have tried this trigger:
Trigger:
  • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Armor of Agathys
      • (Level of (Ability being cast) for (Casting unit)) Equal to 1
    • Actions
      • Set frostarmorcaster = (Casting unit)
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (frostarmorcaster is alive) Equal to True
            • Then - Actions
              • Hero - Create armor of agathys and give it to frostarmorcaster
              • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
              • Set deatheffect = (Last created special effect)
              • Wait 0.50 seconds
              • Special Effect - Destroy deatheffect
              • Wait 0.50 seconds
            • Else - Actions
              • Do nothing
and it doesn't work :( it couldn't possibly be the extra wait before "remove special effect" could it?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
I'd say it simply is any wait you put inside an Integer loop...

I'd suggest you using Hashtables here...
And then, use a different trigger with a periodic (1 second) event, and read this and use that "Healing" trigger's concept of removing 1 from the hash, and when it becomes 0 (Set it to 30 at the start) clear it ;)

Though I can't seem to really get the hang of them (In GUI at least :p) so can't really help you there, but hopefully you can :D
 

CBBPhoenix

New Member
Reaction score
1
I'm sorry

Well I am too inexperienced to use that. I don't even have a clue when it comes to arrays. Don't know what it is and I can't use them at all. So maybe this is just too hard to make for me... There is no other way that you can tempoarily increase armor of a unit and create a special effect that stays on the unit until it dies or for 30 seconds?
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
There is no other way that you can tempoarily increase armor of a unit and create a special effect that stays on the unit until it dies or for 30 seconds?
Um...modify the Roar ability and set targets to only Self? No triggers needed...
 

CBBPhoenix

New Member
Reaction score
1
Yes I know hehe. but the problem is that if dispelled, a new buff should appear. And I cannot make the death and decay (effect) stay on a unit unless I use the Create Special effect at Unit action.
 

Lifespiker

New Member
Reaction score
1
This might not work, BUT:
You could always make a (real) variable and make the trigger be a 1 second periodic event. Everytime it runs have it do (set var = var - 1). Have a second trigger where the event is that the value of real var = 0 and its action is to turn off the other trigger and reset the varible to 30.

Lifespiker
 

Moridin

Snow Leopard
Reaction score
144
Your trigger:

Trigger:
  • Trigger
    • Events
    • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Armor of Agathys
      • (Level of (Ability being cast) for (Casting unit)) Equal to 1
    • Actions
      • Set frostarmorcaster = (Casting unit)
      • For each (Integer A) from 1 to 30, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (frostarmorcaster is alive) Equal to True
            • Then - Actions
              • Hero - Create armor of agathys and give it to frostarmorcaster
              • Special Effect - Create a special effect attached to the chest of frostarmorcaster using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
              • Set deatheffect = (Last created special effect)
              • Wait 0.50 seconds
              • Special Effect - Destroy deatheffect
              • Wait 0.50 seconds
            • Else - Actions
              • Do nothing


..should run perfectly fine. However, you can try removing the "DO nothing" as it's known to cause bugs on occasion and is completely useless..

Also note that this spell cannot be cast by more than one unit at a time...as the variables will get overwritten by new data every time the spell is cast.
 

Laiev

Hey Listen!!
Reaction score
188
If i remember well, wait inside loop cause bug and/or don't work...

You don't need to wait 1/2 second to destroy a special effect, you can save it in hashtable or destroy it without any time, have no problem

EDIT: why you put that loop if you don't use it? lol

don't understand, just to create special effect?
lol just do it with periodic trigger, make it MUI or MPI at least.
 

CBBPhoenix

New Member
Reaction score
1
To Moridin: Yeah I thought it ought to work perfectly too. I will try to remove the Do nothing action and test again. Else I actually thought of something simple yesterday: Just create a dummy unit at center of playable map area when Armor of Agathys is cast. The dummy should have a 99999 range aura that gives armor (auras are indispellable) and targets allowed should be "Hero, player units" And then just add a 30 sec generic exp timer to that dummy lol. Don't know about the special effects though, might try the aura target (that is normally that cyan ring attached to "origin").

to Laiev: I want to avoid periodic triggers as far as possible, pretty sure they make the game laggy when the map is crowded with units (My map is a footmen frenzy inspired one so 3 groups of units per player: 36 X 12, wouldn't be uncommon). You might be right about wait in loops, actually think I heard someone say that somewhere else on Thehelper.net.
I created the loop because I would like to give an armor bonus to the caster and then if dispelled it should re-appear with a delay of at most 1 sec. (so that it would be like a constant effect without adding an ability to the unit because there is no room for tooltip-abilities so it will override active ones). The special effect only appears once unless you create it each second for 30 seconds or until the unit is dead.

Hope that solves something :confused:
 

Laiev

Hey Listen!!
Reaction score
188
Hmm...

You can do it with a periodic trigger 0,5 second... but turn off when effects over, so don't will laggy much how you say
 

CBBPhoenix

New Member
Reaction score
1
I have made it work perfectly now by the dummy unit. I use some crowded trigger that 30 times says: add special effect to VARIABLE(frostarmorcasterr) that variable is defined when the unit casts the ability and on death frostarmorcaster = no unit. so it works hehe. But you're right. good idea to turn off periodic triggers when the are not needed (and then on when they are :p)
 

Laiev

Hey Listen!!
Reaction score
188
Nicee :p

you can change the effect of aura to the model/effect what you want :D so you don't need trigger to special effect
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top