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

[JASS] Rock Pathability

Status
Not open for further replies.
Level 16
Joined
Jul 21, 2008
Messages
1,121
I don't like idea of placing zillion pathing blockers to change terrain pathability of Lordaeron Summer Rock tile, so I made this function (pretty simple one) to run in initialization, but guess what... It doesn't work...

Can someone suggest me either way to fix this function or some other way? Mind that I don't want to use any WE addons or extensions (WEU, JNGP, ...)

Any help is apreciated, thanks in advance!

JASS:
function TerrainPathability takes nothing returns nothing
    local real x = GetRectMinX(GetWorldBounds())
    local real y = GetRectMinY(GetWorldBounds())
    
    loop
    exitwhen y >= GetRectMaxY(GetWorldBounds())
        set x = GetRectMinX(GetWorldBounds()) 
        loop
        exitwhen x>=GetRectMaxX(GetWorldBounds())

            if GetTerrainType(x, y) == 'Lrok' then
                call SetTerrainPathable(x,y,PATHING_TYPE_WALKABILITY, false)                     
            endif  
            set x = x + 50
        endloop
        
        set y = y + 50
    endloop
endfunction
 
Level 5
Joined
Dec 18, 2007
Messages
205
you must put an

x = GetRectMinX(GetWorldBounds())

at the end of the loop where the y value increases, otherwise the script starts to continue with an x value larger than the worldbounds which causes a crash i think.

greetings

edit: sorry, i didn't recognize you did this in the line at the beginning of the loop.
my ideas:
is ''Lrok" really the terrain type?
you tried using something else than etworldbounds? maybe bj_mapInitialPlayableArea.
 
Level 5
Joined
Dec 18, 2007
Messages
205
that was something i really had problems with, too.
WE cannot set the pathing of terrain, that is "black", i think (meaning out of the map, where no units can be placed, but doodads)
 
Status
Not open for further replies.
Top