• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Why does this fire twice ?

Status
Not open for further replies.
Level 11
Joined
Jan 2, 2016
Messages
472
  • Events
    • Unit - MyUnit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to Gather
  • Actions
    • Set temp_herb = (Target unit of ability being cast)
    • Animation - Play temp_herb's Stand Work animation
  • Events
    • Unit - MyUnit finishes casting an ability
  • Conditions
    • (Ability being cast) equal to Gather
  • Actions
    • Unit - Kill temp_herb
    • Game - Display to (All Players) the text: (Name of temp_herb) // this fires twice or probably the whole trigger
 
Level 11
Joined
Jan 2, 2016
Messages
472
I found the problem.It seems that having an ability in a spellbook will trigger it too.

EDIT: This is how i "fixed" it.

  • Events
    • Unit - MyUnit starts the effect of an ability
  • Conditions
    • (Ability being cast) equal to Gather
  • Actions
    • Set temp_herb = (Target unit of ability being cast)
    • Animation - Play temp_herb's Stand Work animation
  • Events
    • Unit - MyUnit finishes casting an ability
  • Conditions
    • (Ability being cast) equal to Gather
  • Actions
    • If (All conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (temp_herb) is dead equal to False
      • Then - Actions
        • Unit - Kill temp_herb
      • Else - Actions
        • Game - Display to (All Players) the text: (Name of temp_herb)
 
Last edited:
Status
Not open for further replies.
Top