• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Unit Evolution

Status
Not open for further replies.
Level 6
Joined
May 26, 2010
Messages
210
Im makeing a map and trying to get a trigger to work where this happens.

A Unit enters a region and when it does it is removed from the game and all of a certain unit (neutral Hostile) are replaced by a new stronger unit. Im useing a auto respawn trigger. Anybody know what to do?
:goblin_boom::goblin_boom::goblin_boom::goblin_boom:
 
Have an Point array representing the location of every Neutral Hostile unit.

  • Untitled Trigger 001
    • Events
      • Unit - A unit enters Region 000 <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • For each (Integer A) from 1 to (Number of units in (Units owned by Neutral Hostile)), do (Actions)
            • Loop - Actions
              • Set Neutral_HostileLocations[(Integer A)] = (Position of (Picked unit))
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • For each (Integer A) from 1 to (Number of units in (Units owned by Neutral Hostile)), do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for Neutral Hostile at Neutral_HostileLocations[(Integer A)] facing Default building facing degrees
Your probably after something like that. It stores the location of every unit owned by Neutral Hostile, then places a footman at the location of that stored unit. Or does it? It might just not work; but it should hopefully give you an idea of what your after.
 
I don't suggest you remove and replace. Just use Chaos.

Check in abilities and find Chaos. You can easily make a tech for this.

If you do it with your current method, the handle ids will change, which could screw up systems and etc... Chaos is just a much better method (less overhead, easier to use, and you don't even need to code anything as it can be a tech).
 
Heres a unit evolution trigger that would replace all units of a certain type with stronger units. You could add as many unit types as you want

  • Replace NH
    • Events
      • Unit - A unit enters region <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Entering unit)) Equal to Footman
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by Neutral Hostile of type Footman) and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a Knight using The old unit's relative life and mana
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Entering unit)) Equal to Knight
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by Neutral Hostile of type Knight) and do (Actions)
                • Loop - Actions
                  • Unit - Replace (Picked unit) with a Doom Guard (Standard) using The old unit's relative life and mana
            • Else - Actions
 
Heres a unit evolution trigger that would replace all units of a certain type with stronger units. You could add as many unit types as you want

  • Replace NH
    • Events
      • Unit - A unit enters region <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Entering unit)) Equal to Footman
        • Then - Actions
          • Unit Group - Pick every unit in (Units owned by Neutral Hostile of type Footman) and do (Actions)
            • Loop - Actions
              • Unit - Replace (Picked unit) with a Knight using The old unit's relative life and mana
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Entering unit)) Equal to Knight
            • Then - Actions
              • Unit Group - Pick every unit in (Units owned by Neutral Hostile of type Knight) and do (Actions)
                • Loop - Actions
                  • Unit - Replace (Picked unit) with a Doom Guard (Standard) using The old unit's relative life and mana
            • Else - Actions

sigh

I don't suggest you remove and replace. Just use Chaos.

Check in abilities and find Chaos. You can easily make a tech for this.

If you do it with your current method, the handle ids will change, which could screw up systems and etc... Chaos is just a much better method (less overhead, easier to use, and you don't even need to code anything as it can be a tech).

Replacing also screws with buffs, abilities, inventory, attached data... that's why Chaos is the only viable option >.>.

I'm making a SetUnitTypeId script that runs off of Chaos = ).
 
Status
Not open for further replies.
Back
Top