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

A Building builds another building

Status
Not open for further replies.
Level 21
Joined
Mar 29, 2020
Messages
1,237
which race do you want the building to behave like? (this affects if it can be in a half way point or if it just has finishing and cancelling, also - is there a unit inside or not).

you should read this thread:


the way to get the location - just have a dummy ability that the building has (based on channel) and when that ability is cast, detect the targeted point with triggers.
 
Level 12
Joined
Oct 28, 2019
Messages
480
How do an ability has the barracks as cursor to place in map ???
I´ve got it with blizzard skill... but dont appear the barracks to build, and yes the circle of blizzard
  • Buildbarracks Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to buildbarracks
    • Actions
      • Unit - Create 1 Peon for Player 1 (Red) at (Target point of ability being cast) facing Default building facing degrees
      • Set VariableSet Peon = (Last created unit)
      • Set VariableSet SetLocationBuild = (Target point of ability being cast)
      • Wait 0.10 seconds
      • Unit - Order (Last created unit) to build a Barracks Castle ED at SetLocationBuild
to be perfect, the barracks should be in "build structure button" and should appear barracks in the cursor
 
Last edited:
Level 21
Joined
Mar 29, 2020
Messages
1,237
oops... forgot the obvious way 🙈


just base an ability off of the tiny great hall ability, give it more range. this will do the job perfectly. But - you can only have one ability of this type per unit (so if you use this the great hall will onlyu be able to build one type of building unless you use some kind of workaround).


the major advantage of this - you have the building indicator for placing buildings, and you don't have to try to trigger not colliding with stuff.
 
Level 12
Joined
Oct 28, 2019
Messages
480
I´ve got it man: Ty all for replies. Now works for all buildings . Heres the solution:
  • Buildbarracks
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • (Unit-type of (Triggering unit)) Equal to Town Hall ed
      • (Issued order) Equal to (Order(Barracks Castle ED))
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Create 1 Peon for Player 1 (Red) at (Target point of issued order) facing Default building facing degrees
      • Set VariableSet Peon = (Last created unit)
      • Set VariableSet SetLocationBuild = (Target point of issued order)
      • Wait 0.10 seconds
      • Unit - Order (Last created unit) to build a Barracks Castle ED at SetLocationBuild
      • Wait 2.00 seconds
      • Trigger - Turn on (This trigger)
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
great!

a few notes :

- you can get rid of the "turn off -turn on" - they are cancelling each other out and add nothing to your trigger.

  • don't forget to deal with removing the peon when the building is killed/cancelled/finished building.
  • in order to avoid memory leaks - move set variable "SetLocationBuild" to the top of the trigger and create the peon there instead of creating a new point for that.
  • remove the point with custom script at the end of the trigger (also to avoid memory leaks).
  • you should add price (gold/lumber) to the trigger if you want it


another large problem with this method:
- you do not check if the point you are building the building is buildable. if it is too close to another building or tree etc - it will not build, but the player will still have spent the resources that it costs and won't know why it isn't working.
 
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
There´s a small problem im not finding solution.... maybe a range to place the building.....

HOW do this.... With this trigger, you can build everywhere in map, any idea
If you are talking about the system daffa linked to - in the first trigger there you can set all of your variables like building range. it seems pretty well explained. Did you do that and it's not working?
 
Status
Not open for further replies.
Top