• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Need help with a Trigger D=

Status
Not open for further replies.
Level 12
Joined
May 20, 2009
Messages
822
  • Base
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Spellcaster
          • (Issued order) Equal to (Order(frostarmor))
    • Actions
      • Unit - Add Permanent Immolation (Neutral Hostile 1) to (Target unit of issued order)

THIS WORKS!

BUT THIS WON'T DO ANYTHING!

  • RemoveSpell
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Permanent Immolation (Neutral Hostile 1)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Firey Protection ) Equal to True
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Unit - Remove Permanent Immolation (Neutral Hostile 1) from (Triggering unit)
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
Use "Starts the effect of ability" instead "Begins casting"

Don't use "Do nothing" action. Just remove it.

You can Display Text Message, to see if trigger is even fired.

I had already tried "Starts the effect of an ability" and it didn't work...I'll give it another shot.

Edit: I think it fires, because it does get removed using Starts the effect of an ability, but it's as if it completely ignores the Condition because it goes away after a few seconds when it's suppose to last ~45 seconds.

  • Base
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Spell Binder
          • (Issued order) Equal to (Order(frostarmor))
    • Actions
      • Unit - Add Permanent Immolation (Neutral Hostile 1) to (Target unit of issued order)
      • Wait 40.00 seconds
      • Unit - Remove Permanent Immolation (Neutral Hostile 1) from (Target unit of issued order)
This also does not work, it does not remove the ability.
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
In your trigger in post 1 I believe you mean for this.
  • ((Triggering unit) has buff Firey Protection ) Equal to True
To be equal to false not true.

Also please do not double post it is against the rules. Instead hit the edit button on your last post.

Sorry about that, forgot.

Also, I have tried every combination of the things I'm using to no avail. I've tried it already as Equal to False.

It's something wrong with something else entirely;

  • RemoveSpell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Permanent Immolation (Neutral Hostile 1)
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: FIRED!
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Firey Protection ) Equal to False
        • Then - Actions
          • Unit - Remove Permanent Immolation (Neutral Hostile 1) from (Triggering unit)
        • Else - Actions
Where it says FIRED! Doesn't even happen, so that means something is wrong with the event/condition. Which would mean Chaosy was right, but I was really hoping they weren't...Because there's no other way to pick up on Permanent Immolation...

I guess I could use the normal Immolation and force it on...? Idk...
 
Level 7
Joined
Mar 6, 2006
Messages
282
What do you mean "pick up on Permanent Immolation" ? A unit with that ability can't decide to use it or not; it's a passive skill, and thus, is never casted.

As for your problem in post 4:

  • Wait 40.00 seconds
  • Unit - Remove Permanent Immolation (Neutral Hostile 1) from (Target unit of issued order)
Once you call a Wait action, (almost) all references are lost, including (Target unit of issued order). So that line isn't running because it doesn't know what unit you want.

You have to save it (Target unit of issued order) to a variable, and when removing the ability, use that variable. BUT, that won't work if there's more than one unit using this trigger, so let us know if that's what you're planning (then you need to make it MUI).
 
Level 12
Joined
May 20, 2009
Messages
822
What do you mean "pick up on Permanent Immolation" ? A unit with that ability can't decide to use it or not; it's a passive skill, and thus, is never casted.

As for your problem in post 4:

  • Wait 40.00 seconds
  • Unit - Remove Permanent Immolation (Neutral Hostile 1) from (Target unit of issued order)
Once you call a Wait action, (almost) all references are lost, including (Target unit of issued order). So that line isn't running because it doesn't know what unit you want.

You have to save it (Target unit of issued order) to a variable, and when removing the ability, use that variable. BUT, that won't work if there's more than one unit using this trigger, so let us know if that's what you're planning (then you need to make it MUI).

Yeah, it's meant to be a unit spell. I'm making a new melee race. The spell will definitely be on multiple units at one time, so a variable will not work.

EDIT: I'm not gonna be on for the rest of the night in about 30 minutes, so if there is any more information you need please ask!
 
Level 7
Joined
Mar 6, 2006
Messages
282
A unit spell? Like the Demon Hunter's immolation? Then base it off that, then you can catch it with triggers. Just uncheck Hero Ability, and set mana to zero, or w/e you want. You can force it on and off with 'Unit - Issue Order With No Target, immolation/unimmolation'

So far, you've posted a few triggers that do different things. What is it that you're trying to achieve? I'm asking so I know if you need to make the trigger MUI.
 
Level 12
Joined
May 20, 2009
Messages
822
What I'm wanting to achieve here is -

My Spellcaster casts it's ability that's basically Frost Armor on a unit.
That unit then receives the Immolation ability for the duration of the spell.
Once the spell wears off, then the Immolation ability is removed.

I can get everything working up to the "Removing Immolation Ability" part. D=
 
If unit castes this abilits on a unit --> add Immolation to "targeting unit of ability being "cast and add it to a unitgroup.

Then periodic trigger.. every 1 second for example:
Pick every unit in this unitrgoup and check if picked unit has buff "frost armor" == true, if not remove Immolation and fro unitgroup.
 
Level 12
Joined
May 20, 2009
Messages
822
If unit castes this abilits on a unit --> add Immolation to "targeting unit of ability being "cast and add it to a unitgroup.

Then periodic trigger.. every 1 second for example:
Pick every unit in this unitrgoup and check if picked unit has buff "frost armor" == true, if not remove Immolation and fro unitgroup.

Huh...That actually seems like it'd work...I'll try that real quick.

EDIT 5: Removed everything else from this post to reduce clutter. I am completely sure it will work every time now, and here are the triggers. This is for anyone else who may want to do something like this in the future.

  • Base
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Spell Binder
          • (Ability being cast) Equal to Firey Protection
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Add Firey Protection (Applies during Trigger) to (Target unit of ability being cast)
          • Unit Group - Add (Target unit of ability being cast) to FireryProtection
        • Else - Actions
This should work. I think the reason why it was messing up before is that the Immolation ability was being applied before the actual Buff from the spell was being applied; So the next trigger saw that the Buff wasn't applied yet and thus removed the spell.

Now the Immolation ability is being applied while the effect of the ability is being applied. I've tested this and because of this, the next trigger can run as many times and as quickly as it wants and it'll never trigger the removing of the Immolation ability before the Buff is applied to the unit.

  • RemoveSpell
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) for 10.00 seconds the text: FIRED!
      • Unit Group - Pick every unit in FireryProtection and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Firey Protection ) Equal to True
            • Then - Actions
            • Else - Actions
              • Unit Group - Pick every unit in FireryProtection and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) has buff Firey Protection ) Equal to False
                    • Then - Actions
                      • Game - Display to (All players) for 30.00 seconds the text: FIRED!
                      • Unit - Remove Firey Protection (Applies during Trigger) from (Picked unit)
                      • Unit Group - Remove (Picked unit) from FireryProtection
                    • Else - Actions
 
Last edited:
Level 7
Joined
Mar 6, 2006
Messages
282
Great! Just a few more things to make it perfect. You need to limit how much that periodic trigger runs.

Firstly, for a spell like this, "every 0.5 seconds" or around there would suffice. "0.01" is a VERY small number. To put that into perspective, 0.01 would run 50 times more than if it was 0.5 seconds.

Secondly, instead of having the periodic trigger run needlessly when no one is using it, you can toggle it with just 1 additional variable. Let's call it, say, ImmoIndex (integer).

In the trigger that adds the unit to the unit group:

  • Unit - Add Firey Protection (Applies during Trigger) to (Target unit of ability being cast)
  • Unit Group - Add (Target unit of ability being cast) to FireryProtection
  • Set ImmoIndex = (ImmoIndex + 1)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ImmoIndex Equal to 1
    • Then - Actions
      • Trigger - Turn on RemoveSpell <gen> <-- Your periodic trigger
    • Else - Actions
So for every unit in the unit group, ImmoIndex is increased, and your periodic trigger is turned on when there are units in your unit group. Now to decrease the index in the other trigger:

  • Unit - Remove Firey Protection (Applies during Trigger) from (Picked unit)
  • Unit Group - Remove (Picked unit) from FireryProtection
  • Set ImmoIndex = (ImmoIndex - 1)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ImmoIndex Equal to 0
    • Then - Actions
      • Trigger - Turn off RemoveSpell <gen> <-- Your periodic trigger
    • Else - Actions
Now it's only on when it needs to be!
 
Status
Not open for further replies.
Top