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

How to replace a unit with a new one using a region.

Level 5
Joined
Mar 15, 2008
Messages
35
Ok, fist of all. I can't see this helping in many maps, A few but not many. If this helps you somehow than good. (o'.')o :spell_breaker:

Step 1:
Create your region. Simple.

Step 2:
Now create a unit. I'm using "(Unit)" as a way of refering to the created unit and "(Unit2)" as a way of refering to the new unit.

Step 3:
Open the trigger editor and a new trigger. Call it anything you want.

Step 4:
Now make the trigger look like this.

Player 1 (Red) can be any player.
  • Untitled Trigger 001
  • Events
    • Player - Player 1 (Red) Selects a unit.
  • Conditions
    • (Region 000 <gen> Contains (Unit)) Equal to true.
  • (Owner of (Triggering unit)) Not equal to Player 1 (Red)
  • Actions
    • Unit - Remove (Triggering unit) From the game.
    • Unit - Create 1 (Unit2) for (Owner of (Triggering unit)) at (Position of triggering unit)) Facing defualt building facing degrees.
IMPORTANT!!!
THIS WILL PERMENETLY DELETE THE UNIT THAT HAS BEEN SELECTED AND REPLACE THE SELECTED UNIT WITH THE NEW ONE



Good luck and I hope this somehow helped you :D (''''\(*o*)/'''')
 
Last edited:
Level 13
Joined
May 11, 2008
Messages
1,198
uhm, if i'mi not mistake you have a triggering player but not a triggering unit. so triggering unit identification will not work with that trigger. or am i wrong?

also you can just use the replace action instead of the remove action...
not sure it standard world editor comes with that action but the fancy jngp/5.0 WE (whatever you call it) has it.

all in all i'm not entirely sure exactly what you're trying to do so i'm not sure how to tell you to make your trigger.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Whats the point of this? Firstly WE does not let you create regions, it only allows the creation of rects which may or may not be converted to regions based on the actions used. Secondly, who would actually use something like this?

What you have done is not even cleaver, as you use GUI and could be done far more efficently in JASS. Also I never have seen this quetion asked so I do not think this will benifit many people. On top of this you also leak a location, which is shocking.

Slaydon, your trigger is not the same as his changes ownership, yours just changes the unit. Eithor way they both work about the same as the replace unit action basically removes the only unit and makes a new on in its place.
 
Top