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

Make buildings only buildable at trees?

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,657
There is no real way to restrict a structure to be built on trees, but you can check if you ordered the unit to build it on a tree.
  • Build Tower Restriction
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • (Issued order) Equal to (Order(Tower))
    • Actions
      • Set TempBoolean = False
      • Set TempLocation = (Target point of issued order)
      • Destructible - Pick every destructible within 32.00 of TempLocation and do (Actions)
        • Loop - Actions
          • -------- check if picked destructable is tree --------
          • Set TempBoolean = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBoolean Equal to False
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Unit - Pause (Triggering unit)
          • Unit - Order (Triggering unit) to Stop
          • Unit - Unpause (Triggering unit)
          • Trigger - Turn on (This trigger)
          • Set TempForce = (Player group((Triggering player)))
          • -------- This building has to be built on a tree. --------
          • Game - Display to TempForce the text: This building has t...
          • Custom script: call DestroyForce(udg_TempForce)
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLocation)
Be sure to set "Pathing - Placement Requires (upap)" to none.
Also, this only checks if it is placed on anydestructable, you might want to download a system that is able to tell the difference between trees and other destructables.
 
Status
Not open for further replies.
Top