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

Unit Evolution

Status
Not open for further replies.
Level 6
Joined
May 26, 2010
Messages
212
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:
 
Level 7
Joined
Dec 8, 2008
Messages
243
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.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
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).
 
Level 8
Joined
Dec 12, 2010
Messages
280
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
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
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.
Top