Repository navigation
[Memhack] Pawn Functions
This page describes functions added to the Pawn (BoardPawn) class by memhack.
-
BoardPawnPawn:GetMemhackObj()
Returns the memhack BoardPawn struct for this pawn userdata. Cached on the pawn and refreshed if the userdata address changes. Prefer the wrappers below unless you need the raw struct.
Example:
local boardPawn = Game:GetPawn(0):GetMemhackObj()
local pilot = boardPawn:getPilot()-
PilotPawn:GetPilot()
Returns the Pilot struct for the pilot currently piloting this pawn. Returns nil if the pawn has no pilot.
Example:
local pawn = Game:GetPawn(0)
local pilot = pawn:GetPilot()
if pilot then
LOG("Pawn is piloted by " .. pilot:getName())
LOG("Pilot level: " .. pilot:getLevel())
else
LOG("Pawn has no pilot")
end-
int or nilPawn:GetHpCore()
Returns the innate mech HP core type (memhack.CORE_TYPE_*), or nil if the pointer is unavailable. See Constants for return values.
Example:
local hpCore = Game:GetPawn(0):GetHpCore()
if hpCore == memhack.CORE_TYPE_SKILL_BONUS then
LOG("HP core is a skill bonus core")
end-
booleanPawn:SetHpCore(value)
| Argument name | Type | Description |
|---|---|---|
value |
int | memhack.CORE_TYPE_* |
Writes the innate mech HP core type. Returns false if the pointer is null/zero, otherwise true. See Constants for memhack.CORE_TYPE_* details.
Example:
Game:GetPawn(0):SetHpCore(memhack.CORE_TYPE_SKILL_BONUS)-
int or nilPawn:GetMoveCore()
Returns the innate mech move core type (memhack.CORE_TYPE_*), or nil if the pointer is unavailable. See Constants for return values.
Example:
local moveCore = Game:GetPawn(0):GetMoveCore()
LOG("Move core type: " .. tostring(moveCore))-
booleanPawn:SetMoveCore(value)
| Argument name | Type | Description |
|---|---|---|
value |
int | memhack.CORE_TYPE_* |
Writes the innate mech move core type. Returns false if the pointer is null/zero, otherwise true. See Constants for memhack.CORE_TYPE_* details.
Example:
Game:GetPawn(0):SetMoveCore(memhack.CORE_TYPE_SKILL_BONUS)