• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Make buildings only buildable at trees?

Status
Not open for further replies.
Level 24
Joined
Aug 1, 2013
Messages
4,658
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