• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Trigger Help Needed

Status
Not open for further replies.

ndh

ndh

Level 8
Joined
Apr 21, 2012
Messages
343
I'm trying to make it so that when a specific unit uses an ability he is replaced by another one. The unit he is replaced with also has an ability that when used turns him back to his original unit.

For a better mental picture...

Unit 1 (Default): Abilities -> Military Structures, Tech Structures, Defensive Structures

Unit 2 (Military): Abilities -> Default Structures, Tech Structures, Defensive Structures

Unit 3 (Tech): Abilities -> Default Structures, Military Structures, Defensive Structures

Unit 4 (Defensive): Abilities -> Default Structures, Military Structures, Tech Structures

Here is what the trigger looks like...

  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
  • Actions
    • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Ability being cast) Equal to (==) Default Structures
      • Then - Actions
        • Unit - Replace (Casting unit) with a Worker using The old unit's relative life and mana
        • Multiple FuctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Owner of (Last replaced unit)) Equal to (==) (Owner of (Casting unit))
          • Then - Actions
            • Selection - Add (Last replaced unit) to selection for (Owner of (Casting unit))
          • Else - Actions
            • Do nothing
      • Else - Actions
        • Do nothing
This is duplicated for all of the triggers with the respective Worker and Ability.

Problem is, when i use Military Structures, I get Worker (Military). But, when i use Default Structures, I get Worker (Defensive). All in all, it doesn't do what i wan't it to. Any advice/tips?
 
Status
Not open for further replies.
Back
Top