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

Terrain Pathing?

Status
Not open for further replies.
Level 24
Joined
May 9, 2007
Messages
3,563
I have a spell.

  • Dig
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dig
    • Actions
      • Set TempPoint1 = (Position of (Triggering unit))
      • Environment - Change terrain type at TempPoint1 to Village - Dirt using variation -1 in an area of size 2 and shape Circle
      • Custom script: call RemoveLocation(udg_TempPoint1)
It sets the terrain type under the unit to dirt. Unfortunately it does not set the pathing. I need to find a way to set the pathing of the area to buildable. A screen shot of what the ability does is included.

500th post!!
 
Last edited:
Level 17
Joined
Apr 27, 2008
Messages
2,455
really easy to use

if you can use the jassnewgenpack just copy/paste the library in an empty trigger, or in the custom code window.
If you can't use jasshelper remove the words debug,library,endlibrary and copy/paste the functions in the custom code window

example of use :

JASS:
call SetCircleTerrainPathable(GetLocationX(udg_TempPoint1),GetLocationY(udg_TempPoint1), 128.0,PATHING_TYPE_BUILDABILITY,true)

ofc instead of 128.0 use the size you want

btw you can avoid using a location and use directly GetUnitX() and GetUnitY()
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
JASS:
function SetCircleTerrainPathable takes real xc,real yc,real radius,pathingtype t,boolean b returns boolean

this function change the pathing for a circle, and return true if it was done and false if not, but you can ignore this return.

xc -> it's the x coordinate of the center of the circle
yc -> it's the y coordinate of the center of the circle
radius -> it's the radius of the circle :p
t -> it's the pathingtype, you can found the constants with jasscraft for example or convert in jass a gui function.
b -> true -> turn on the pathing ; false -> turn off the pathing

that's better ?
 
Status
Not open for further replies.
Top