How to Set Unit Type?

Zerox

Ultra Cool Member
Reaction score
28
Hey guys. I have a hopefully simple question. Is there a way to set a unit type in triggers? I know you can create a variable for a custom unit type but I can't figure out how to set a unit to that type. Can anyone help me?
 

Sindree

New Member
Reaction score
0
Trigger:
  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • Set temputype = Footman


just make a unittype variable and set it in actions. Its usually a bunch of herofaces in bottom when u set value of the variable so just pick the unittype u want there and it should be set :/
 

Zerox

Ultra Cool Member
Reaction score
28
I guess I wasn't very clear. It seems like it shows up in the same thing as Footman but then it wouldn't make sense for there to be a variable for a unit that doesn't exist.

Here's my triggers.

Here's my spawn trigger:

Trigger:
  • Run Switch
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Respawn1 is empty) Equal to True
        • Then - Actions
          • Unit - Create 9 Shadow Heartless for Neutral Hostile at (Random point in Respawn 1 <gen>) facing 0.00 degrees
          • Unit Group - Add (Last created unit) to Respawn1
          • -------- Set (Last Created Unit) Type to Heartless(variable). --------
        • Else - Actions
          • Do nothing


And death trigger:

Trigger:
  • Heartless Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Heartless
    • Actions
      • Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Undead\CarrionSwarm\CarrionSwarmDamage.mdl
      • Unit - Remove (Dying unit) from the game
      • Special Effect - Destroy (Last created special effect)


Perhaps that will help. The thing in the trigger comment with the ----'s is what I am looking for as a trigger it isn't a valid thing.
 

millz-

New Member
Reaction score
25
Just change in the death trigger that dying unit unit type is equal to Shadow Heartless.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top