Name | Type | is_array | initial_value |
library IsWalkabilityOff
//Configuration
globals
private constant integer WALK_CHECKER = 'iWO0'
private constant integer WALK_CHECK = 'iWO1'
private constant integer WALK_CHECK_TERRAIN = 'iWO2'
private constant player WALK_PLAYER = Player(PLAYER_NEUTRAL_PASSIVE)
private constant boolean SHARED_CONTROL_WALK_PLAYER = true
endglobals
/*
IsWalkabilityOff 1.2
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Description:
¯¯¯¯¯¯¯¯¯¯¯¯
This library contains two distinct functions for detecting if pathing type walkability is off.
API:
¯¯¯¯
1. Used for checking if walkability is off at certain (x, y), including units.
| function IsWalkabilityOff takes real x, real y returns boolean
2. Used for checking if walkability is off at certain cell containing (x, y), excluding units.
| function IsTerrainWalkabilityOff takes real x, real y returns boolean
How to import:
¯¯¯¯¯¯¯¯¯¯¯¯¯¯
1. Copy the category IsWalkabilityOff 1.1
2. Copy the (IsWalkabilityOff) units, giving them their correct Object ID's
Credits:
¯¯¯¯¯¯¯¯
- Kazeon for PathingLib which this library is based on.
Link:
¯¯¯¯¯
https://www.hiveworkshop.com/threads/iswalkabilityoff-1-2.354129/
*/
globals
private unit walkChecker
endglobals
function IsWalkabilityOff takes real x, real y returns boolean
return IssueBuildOrderById(walkChecker, WALK_CHECK, x, y)
endfunction
function IsTerrainWalkabilityOff takes real x, real y returns boolean
return IssueBuildOrderById(walkChecker, WALK_CHECK_TERRAIN, x, y)
endfunction
private function SharedControlWalkPlayer takes nothing returns nothing
call SetPlayerAllianceBJ(GetEnumPlayer(), ALLIANCE_SHARED_CONTROL, true, WALK_PLAYER)
endfunction
private module Init
private static method onInit takes nothing returns nothing
call init()
endmethod
endmodule
private struct InitStruct extends array
private static method init takes nothing returns nothing
set walkChecker = CreateUnit(WALK_PLAYER, WALK_CHECKER, 0, 0, 0)
call BlzPauseUnitEx(walkChecker, true)
call ShowUnit(walkChecker, false)
if SHARED_CONTROL_WALK_PLAYER then
call ForForce(GetPlayersAll(), function SharedControlWalkPlayer)
endif
endmethod
implement Init
endstruct
endlibrary //by Duckfarter