• 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.

Trigger Help Needed

Status
Not open for further replies.

ndh

ndh

Level 8
Joined
Apr 21, 2012
Messages
344
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?
 
Level 11
Joined
Feb 23, 2009
Messages
577
You have to be real careful if you use BEGINS to cast an ability! And I'm pretty sure you meant to use "starts the effect of" ability... Also are you using different spell ID's? (Can't use Thunderclap 6 times, only the same will get cast over and over, bugs). If not I could take a look at the map.
 
Status
Not open for further replies.
Top