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

Ordering to Build

Status
Not open for further replies.
Level 6
Joined
Nov 3, 2005
Messages
103
Hey. I'm trying to have watch towers built automatically within regions once a hero captures a point without any building units doing so. I've tried creating a custom Peon at the wanted position and ordering him to build the tower right after he's created, but it doesn't work. Instead the trigger creates the Peon and he just stands there, and yes, I have the building in the buildings that he can build.

Edit - I've figured it out, even though I would like to know how to build buildings without using workers.

I still have a problem though, don't know how to remove the unit that's constructing from the game once it's done.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Edit - I've figured it out, even though I would like to know how to build buildings without using workers.
Well without a worker a building cannot be built can it? Even undead buildings technically have a summoner, a single unit responsible for the construction of the building. Yes undead buildings may build themselves and the summoner may die but still someone started the building.

If you just want one to magically appear you can create buildings like any other unit.

I still have a problem though, don't know how to remove the unit that's constructing from the game once it's done.
Outside of horrendously complicated builder detection systems that may not always be accurate and require heavy JASS use, you will need to keep track of the builders. A group could suffice, which you check every second odd if one of the builders is not building and if so remove them. You could also cache the builder and move/re-order him as required.
 
Level 11
Joined
Nov 15, 2007
Messages
781
If it's just one building, you can give the worker a timed life slightly longer than the time it takes to build the structure, and remove it from the game when it dies.

E: Or like Dr Super Good says, just create the building. You can play its birth animation to simulate it being built.
 
Level 6
Joined
Nov 3, 2005
Messages
103
E: Or like Dr Super Good says, just create the building. You can play its birth animation to simulate it being built.

Yeah, I think I'll go with that instead. if I haven't mentioned before, the game's supposed to automatically construct the buildings right after a capture point is taken for a specific team, so having something that isn't always reliable wouldn't necessarily be beneficial.

I really wanted the buildings to have health that increased as they were being formed though, in which case I'm guessing I'll still need a complicated checking system that determines the time and heath of each tower.
 
Level 11
Joined
Nov 15, 2007
Messages
781
Shouldn't really be too complicated... hell you should just be able to set the unit's health to 1 when it's created and cast a dummy structure-targeted Rejuvenation on it.
 
Status
Not open for further replies.
Top