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

[Solved] Ability not working

Status
Not open for further replies.
Level 4
Joined
Jul 10, 2013
Messages
73
Does anyone know why my ability is not working? It is an ability used in an item.

  • dragonglass item1
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to dragonglass (entangling roots)
      • (Unit-type of (Target unit of issued order)) Equal to Civilian (Male)(dragonglass)
    • Actions
      • Set PointArray[1] = (Position of (Target unit of issued order))
      • Unit - Remove (Target unit of issued order) from the game
      • Special Effect - Create a special effect at PointArray[1] using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Civilian (Male)(dragonglass) for Player 2 (Blue) at PointArray[1] facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_PointArray[1])
 
Level 4
Joined
Jul 10, 2013
Messages
73
ah okay thank you that worked! but I have a similar trigger as well that works but is not removing its target unit from the game

  • Antidote1
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Antidote (chain lightning)
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Infected (Q)
          • (Unit-type of (Target unit of ability being cast)) Equal to Spitter (E)
          • (Unit-type of (Target unit of ability being cast)) Equal to Stalker (R)
          • (Unit-type of (Target unit of ability being cast)) Equal to Dasher (A)
          • (Unit-type of (Target unit of ability being cast)) Equal to Leaper (Sniper)
          • (Unit-type of (Target unit of ability being cast)) Equal to Leaper (T)
          • (Unit-type of (Target unit of ability being cast)) Equal to Nazi Zombie
          • (Unit-type of (Target unit of ability being cast)) Equal to Boomer (S)
          • (Unit-type of (Target unit of ability being cast)) Equal to Huge Zombie (D)
          • (Unit-type of (Target unit of ability being cast)) Equal to Gigantus (F)
    • Actions
      • Wait 1.00 seconds
      • Set Point = (Position of (Target unit of ability being cast))
      • Unit - Remove (Target unit of ability being cast) from the game
      • Unit - Create 1 Civilian (Survivor) for (Triggering player) at cdc1 facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Point)
 
Checkout this:
https://www.hiveworkshop.com/threads/things-you-should-know-when-using-triggers-gui.233242/#Section 2 SubCh 1


Only "Triggering Unit"/Triggering Player is save to use after an wait, an simple fix would be to use SubChapter 1 - Shadowing Global Variables From the link above.
  • Remove Target
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Custom script: local unit udg_Target
      • Set Target = (Target unit of ability being cast)
      • Wait 1.00 seconds
      • Unit - Remove Target from the game
      • Unit - Create 1 Civilian for Player 1 (Red) at cdc1 facing Default building facing degrees
      • Set Target = No unit
Beaware that using local variables this way disallows using them in groups and GUI IF - conditions.

Suggest:
If this spell can be used by multiple units you might need to add an additional check to prevent gaining 2 civilian from 1 Zombie.
 
Status
Not open for further replies.
Top