- Joined
- Nov 21, 2012
- Messages
- 835
Hi, what do you think about submiting at spell section this code. It is based on PurgeandFire / Quilnez work.
If it will be allowed I vote to remove this
If it will be allowed I vote to remove this
JASS:
// IsPointWalkable ver 1.00 /by zibithewand3r3r/
// based on PathingLib v1.5 by Quilnez, idea by PurgeandFire
//
// Allows to check if given point is walkable for 3 diffrent collision sizes (16,32,64)
// function IsPointWalkableForSize(real x, real y, integer size) returns boolean
// use 16 or 32 or 64 numbers as 'size' parameter
// if you pass number other than those mentioned above, function will check for 64 collision size
//
// It uses 4 custom units:
// DUMMY_CHECKER (as a builder) and three WALK_CHECKERs with diffrent collision sizes
// c&p custom units, be sure DUMMY_CHECKER can build 3 other units in ObjectEditor
// set their raw codes at Init function
library IsPointWalkable initializer Init
globals
private integer DUMMY_CHECKER
private integer array WALK_CHECKER
private unit PathChecker
endglobals
function IsPointWalkableForSize takes real x, real y, integer size returns boolean
if WALK_CHECKER[size] != null then
return IssueBuildOrderById(PathChecker, WALK_CHECKER[size], x, y)
else
return IssueBuildOrderById(PathChecker, WALK_CHECKER[64], x, y) // check anyway
debug call BJDebugMsg("Wrong parameter passed to function IsPointWalkableForSize. Use 16 or 32 or 64.")
endif
return false
endfunction
private function Init takes nothing returns nothing
//--- CONFIGURATION --- set raw codes of units:
set DUMMY_CHECKER = 'h000' // dummy path checker
set WALK_CHECKER[16] = 'o000' // path checker peon
set WALK_CHECKER[32] = 'o001' // path checker grunt
set WALK_CHECKER[64] = 'o002' // path checker tauren
set PathChecker = CreateUnit(Player(15), DUMMY_CHECKER, 0, 0, 0)
call UnitRemoveAbility(PathChecker, 'Amov') //remove move
call ShowUnit(PathChecker, false)
if GetLocalPlayer() == Player(15) then
call FogEnable(false)
endif
endfunction
endlibrary