• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] need help on removing ability trigger

Status
Not open for further replies.
Level 3
Joined
Apr 29, 2012
Messages
64
Not sure if I'm in the right place?

uhm, i have a unit ability (mark as A) and a hero ability (mark as X)

so, whenever i cast X on the hero or to the hero's ally, the target get ability A for a period.

I'm done adding the ability A to the target unit but i setup the remove part with "remove - (ability A) from (target of ability being cast)" it wouldn't work.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Show trigger.

If the unit is in a Unit Group or something, you should change it (Picked unit) instead (Target unit of ability being cast)

If you're indexing, make sure it is properly indexed unit.

If you're making a MUI spell (with Waits + local variable), make sure you set the local unit carefully

If you're making a non-mui spell with Waits, you should save the (Target unit of ability being cast) into a Unit variable then refer to it later.

I'm just making basic assumptions.
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
It works, but you have to set it to local variable (making a global variable into local);
  • Custom script: local unit udg_Target = GetSpellTargetUnit()
Or you can also use non-global variable
  • Custom script: local unit Target = GetSpellTargetUnit()
But in this way, you have to fully use Custom script to refer that unit as "Target" because it's not a global variable
You can use this method if you are already know all functions in GUI as in Custom script code.
 
Last edited:
Level 3
Joined
Apr 29, 2012
Messages
64
  • Lightning Shield Armor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set Target = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Lightning Shield
        • Then - Actions
          • Wait 0.01 seconds
          • Unit - Add Defend to Target
          • Wait 20.00 seconds
          • Unit - Remove Defend from Target
        • Else - Actions
This is the basic 1, and there is another 1 which is more complicate and i think it is useless...

uhm, i need a sample for making this trigger work, can show me both MUI and non MUI? cuz i wanna learn...
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Since your Condition only works for Then branch, you should put that Condition below Events area.

What does this Defend base from ?
I meant what spell it is from ?
And what does it do.

Are you using this spell for multiple of units within 20 seconds ?
If yes, no wonder, because this trigger is not MUI.

EDIT:
This should work.
  • Lightning Shield Armor
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Lightning Shield
    • Actions
      • Custom script: local unit udg_Target = GetSpellTargetUnit()
      • Unit - Add Defend to Target
      • Wait 20.00 seconds
      • Unit - Remove Defend from Target
      • Custom script: set udg_Target = null
 
Level 3
Joined
Apr 29, 2012
Messages
64
defend is base from the skill devotion aura but i edited the AOE of armor bonus so only the targeted unit will have the armor bonus.

the cooldown of the skill is 5 second, so within this 20 second time period, there maybe 4 unit share the same ability but different duration lasting, also, 12 player of the map might have a chance to share the same hero, so, it require MUI?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Yes, it requires MUI of course.
There are 2 types of MUI, normal MUI and stackable MUI

Normal MUI requirement: If that map has a duration-based spell that requires a delay/wait time in-between cast (to remove ability, etc), and more than 1 unit has this ability in that map, you should make your spell MUI.

Stackable MUI requirement: Same as above, only the addition is that the same caster casts a spell even if the spell effect is not yet done (because the cooldown is much more shorter than duration of the spell itself) and also, it stacks with other unit (in this case, indexing is better).

Things like does not need wait (Instant effect), mostly the spell itself is MUI (because it does not relates with another trigger and does not has Waits in it)

Basically, Waits does not ruin MUI-ness of a trigger, but you just gotta know how to use them wisely with local variable.

Waits can also be bugged if: local variable + Wait + LoopingFunction

I believed by following the trigger in post #6, your problem is solved.
 
Status
Not open for further replies.
Top