• 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.

[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,243
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