Trigger fired twice - Metamorphosis ability

lindenkron

You can change this now in User CP
Reaction score
102
So... I have this minor issue with my additional feature trigger. It's abit complicated but I'll try to explain it the best I can.

I got an ability based off Metamorphosis, that turns you into a unit.
This unit should not be able to cast abilities etc etc. If you just morph using the metamorphosis spell, the unit you morph into will have the same abilities.

Therefore, I've created a trigger that removes all abilities (except the morph itself, since that would crash the game) and adds them again after the morphing is done.

Issue is, when the "Metamorphosis" spell runs out, it does so by firing itself again (using itself)
So my trigger:
Trigger:
  • Metamorphosis
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions

is fired twice.. making my trigger useless (none working).

Anyway to only make it register the first time the ability is used, and still keep it MUI?

Thx, +rep for help resulting in a solution.
-Lindenkron
 

Tom Jones

N/A
Reaction score
437
Compare the unittype of the trigger unit.

*Edit*
Trigger:
  • Test B
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Hunter
        • Then - Actions
          • *First execution, main unit.*
        • Else - Actions
          • *Second execution, morphed unit.*
 

Meowier

New Member
Reaction score
6
Why not just have a dummy unit spawn when the spell is cast that casts silence with a duration equal to the duration of metamorphosis and an area of effect of 10 on the exact location of the unit?
 

lindenkron

You can change this now in User CP
Reaction score
102
Why not just have a dummy unit spawn when the spell is cast that casts silence with a duration equal to the duration of metamorphosis and an area of effect of 10 on the exact location of the unit?
To turn the unit back into its original form it needs to cast the ability again. That's how it works :/

Compare the unittype of the trigger unit.

*Edit*
Trigger:
  • Test B
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Demon Hunter
        • Then - Actions
          • *First execution, main unit.*
        • Else - Actions
          • *Second execution, morphed unit.*
I'm afraid I don't see how that helps my situation?

I reject your reality and substitute my own. ~Adam Savage.
You sir. Have good taste!

Does Adam need a cookie? ~Jamie Hyneman
 

Tom Jones

N/A
Reaction score
437
The unit has two different unit types, the original unittype and the alternative unittype. When it morphs into it's alternative form it'll have it's original unittype. When it morphs back into it's original form, it'll have it's alternative unittype. Comparing between the two unittypes enables you to determine whether the abilities should be removed or added.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top