• 🏆 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!

[Trigger] Switching passives

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2012
Messages
204
Hey guys...

me again, stuck with a triggered ability ^^

im currently trying to make a passive that can be activated to change its effect.

I made 2 dummy abilities and 2 passives. Everytime you activate the dummy the dummys and passives get switched...at least i thought it would be so easy...doesnt work at all XD

  • Crit evasion swap
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Critical Strike [W]
        • Then - Actions
          • Player - Disable Critical Strike [W] for (Owner of (Casting unit))
          • Unit - Add Evasion [W] to (Casting unit)
          • Unit - Set level of Evasion [W] for (Casting unit) to (Level of Critical Strike [W] for (Casting unit))
          • Unit - Remove Critical Strike (effect) from (Casting unit)
          • Unit - Add Evasion (effect) to (Casting unit)
          • Unit - Set level of Evasion (effect) for (Casting unit) to (Level of Critical Strike [W] for (Casting unit))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to Evasion [W]
            • Then - Actions
              • Player - Enable Critical Strike [W] for (Owner of (Casting unit))
              • Unit - Remove Evasion [W] from (Casting unit)
              • Unit - Add Critical Strike (effect) to (Casting unit)
              • Unit - Set level of Critical Strike (effect) for (Casting unit) to (Level of Critical Strike [W] for (Casting unit))
              • Unit - Remove Evasion (effect) from (Casting unit)
            • Else - Actions

any ideas how to improve this?
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
use "starts the effect of an ability"
Why do you use disable/enable for critical strike dummy ability and add/remove ability for evasion dummy ability?
Is it because you need the level of it? If yes I would store the level of the ability in an integer at the beginning of the trigger.
Removing the ability, before the unit has finished casting can cause problems.

What does not work? the dummy abilities or the effect abilities?
 
Level 7
Joined
Sep 19, 2012
Messages
204
use "starts the effect of an ability"
Why do you use disable/enable for critical strike dummy ability and add/remove ability for evasion dummy ability?
Is it because you need the level of it? If yes I would store the level of the ability in an integer at the beginning of the trigger.
Removing the ability, before the unit has finished casting can cause problems.

What does not work? the dummy abilities or the effect abilities?

The dummy switching works fine.
The passives however not:
On first click it removes the crit and adds the evasion, but afterwards the evasion stays and crit doesnt show up again.
So basically the dummies switch an the passives get stuck at evasion.
 
Level 7
Joined
Sep 19, 2012
Messages
204
Try changing the event to "Starts the effect"

Nope...still doesnt work.

Why do you use disable/enable for critical strike dummy ability and add/remove ability for evasion dummy ability?
Is it because you need the level of it?

if i disable/ enable the evasion ability it shows up as "unlearned" ability. This is why i add/remove it.
 
Level 15
Joined
Mar 25, 2016
Messages
1,327
I would redesign the implementation to make it a little bit easier.
I would either use one spell to switch between evasion and critical strike like immolation/mana shield. Or use a dummy learn spell, that is only used to learn and is invisible in the command card.
This way you will have one hero abilities, that is never removed/disabled and you can dynamically add/remove unit abilities.
The advantage of a spell like immolation is, that you don't have to switch it, but I think it is harder to detect, when it is used. Not sure if you can easily detect deactivation of immolation.
if i disable/ enable the evasion ability it shows up as "unlearned" ability. This is why i add/remove it.
As I suggested, you should only have one hero ability that can be learned and is not removed/disabled. Everything else should be unit abilities.
 
Status
Not open for further replies.
Top