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

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!
 
Level 15
Joined
Mar 8, 2009
Messages
1,649
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.
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
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)
 
Level 3
Joined
Oct 4, 2008
Messages
31
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.
 
Level 7
Joined
Mar 26, 2009
Messages
345
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.
Top