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

[General] Unit Tileplacement.

Status
Not open for further replies.
Level 6
Joined
Oct 18, 2008
Messages
100
I am trying to create farms that can only be placed on the villager crops tileset.

I am using a rock tileset as hills. So they aren't build able or walkable.

Is there anyway to do this? I have been looking into the Pathability requirements and preventions but I haven't been able to figur it out.

I use newgen for tilepathing.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You can check the terrain type id at the target point of issued order.

Events
Unit is issued and order targeting a point
Conditions
Issued order == humanfarm // the order string of your build order
Actions
If
terrain type at targeted point != your terrain type
then
stop unit
endif

I think there's a GUI function for getting the terrain type. If not, then use JASS, GetTerrainTypeId is the function I believe.

Ordering a unit to stop might not work. Try that first though. If it doesn't work, then order it to move to it's own position. If that doesn't work then pause the unit, move it to it's own position and unpause it. If that doesn't work, use a timer with 0.00 expiration time and issue the stop order when the timer expires. That will work for sure.
 
Status
Not open for further replies.
Top