• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Modifying Limited Libraries

Level 25
Joined
Jun 5, 2008
Messages
2,572
Modifying Faulty Libraries

Oh well while helping HELL_YA with a issue on Replace Unit i stumbled upon a strange thing.

1.Replace Unit Ex library

Well you see, you can't replace units with the replace unit function if their type is the same.

Example:
You can't replace a zealot for a zealot, etc...

The solution is rather easy.

Go to the libraries, find the Built-In folder.

Find the Unit subgroup and open the Basic folder.

Now find the Replace Unit function and copy it.

Declare a new library, we will call it Replace Unit Ex.

Remove the line:
  • (Unit type of Unit) == Unit-Type
And use the Replace Unit Ex function from now on.
Is should show right below the Replace Unit native.

Works like a charm.
Hope it helps.
Will add more as i deem needed.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Usless tutorial. There is no productive situation where a person will replace a unit with itself since it is itself already. If do get into such a situation through unsafe code, a conditional statmenet to catch it is all that is needed. If you were trying to do it to emulate WC3's replace unit function which removed and created a new unit, then simply set unit kills to 0 and life back to maximum.
 
Top