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

broken trigger help (gui)

Status
Not open for further replies.
Level 2
Joined
Jun 25, 2009
Messages
15
Can someone help me fix this? It's meant to play the naga birth animation for a structure that normally doesn't have one. It works fine up until the constructing structure is canceled or destroyed, the special effect won't disappear and just sits there. What should I change? I am a beginner in triggering.


  • Fakebirth
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to War Levy
    • Actions
      • Set Levyconstruct = (Triggering unit)
      • Animation - Change Levyconstruct's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Special Effect - Create a special effect at (Position of Levyconstruct) using NagaBirth.MDX
      • Set birtheffect = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Levyconstruct Equal to (Dying unit)) or (Levyconstruct Equal to (Cancelled structure))
        • Then - Actions
          • Special Effect - Destroy birtheffect
          • Skip remaining actions
        • Else - Actions
          • Wait 58.00 seconds
          • Special Effect - Destroy birtheffect
          • Animation - Change Levyconstruct's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Construct_Hash = (Last created hashtable)
  • Begin Constructing
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farm
    • Actions
      • Set Temp_Loc_1 = (Position of (Triggering unit))
      • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Special Effect - Create a special effect at Temp_Loc_1 using Abilities\Spells\Human\CloudOfFog\CloudOfFog.mdl
      • Hashtable - Save Handle Of(Triggering unit) as (Key unit) of (Key (Triggering unit)) in Construct_Hash
      • Hashtable - Save Handle Of(Last created special effect) as (Key sfx) of (Key (Triggering unit)) in (Last created hashtable)
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
  • Cancel Constructing
    • Events
      • Unit - A unit Dies
      • Unit - A unit Cancels construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farm
    • Actions
      • Set Temp_Effect = (Load (Key sfx) of (Key (Triggering unit)) in Construct_Hash)
      • Special Effect - Destroy Temp_Effect
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Construct_Hash
  • FinishlConstructing
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Farm
    • Actions
      • Animation - Change (Triggering unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Set Temp_Effect = (Load (Key sfx) of (Key (Triggering unit)) in Construct_Hash)
      • Special Effect - Destroy Temp_Effect
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Construct_Hash
 
Level 2
Joined
Jun 25, 2009
Messages
15
Tested, perfect solution, thank you. I am pretty much ignorant of the functions of hashtables but this is enlightening. The effect does linger for a couple of seconds upon cancellation or destruction, but I am happy with results.
 
Status
Not open for further replies.
Top