• Check out the results of the Techtree Contest #19!
  • 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 void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Building on Terrain {a building from a specific type of tile (Farms on Crops)}

Status
Not open for further replies.
Level 3
Joined
Oct 4, 2008
Messages
31
Hey guys, I've been wondering about this question for quiet some time. The question that I've been trying to figure out is how to build a structure on a certain type of terrain. I do not want all structures buildable no this terrain, only one type of structure. For example, I want a farm to be able to build on the farmlands and not the barracks also. I also want the farm not to be able to build on the same terrain a barracks/other structures can build on.

Thank you in advance!
 
this can be done only via triggers. Object Editor only allows ou to choose whick kind of pathing is required for your building, but not the terrain type.
 
It can be done via simple trigger:

  • Check
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to <Your Structure>
    • Actions
      • Set TempPoint = (Position of (Constructing structure))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at TempPoint) Equal to <Terrain Type>
        • Then - Actions
        • Else - Actions
          • Unit - Kill (Constructing structure)
          • Player - Add <Gold Cost> to (Owner of (Constructing structure)) Current gold
          • Player - Add <Lumber Cost> to (Owner of (Constructing structure)) Current lumber
      • Custom script: call RemoveLocation(udg_TempPoint)
 
Thanks guys, but I don't want other structures to be killed. I just want it so that farms can build on the farmland and all other structures cannot build at all on farmlands. I would also want farms not-buildable on another terrain.
 
The "kill" would stop/cancel construction of all buildings that are not the buildings you specified or are being built on the "wrong" terrain.
 
Status
Not open for further replies.
Back
Top