[Memhack] PilotLvlUpSkill - Redacted-Rice/ITB-RedactedRiceExts GitHub Wiki

Memhack PilotLvlUpSkill

The Memhack PilotLvlUpSkill struct represents a pilot level up skill and provides access to skill properties.

It has the standard memhack base struct functions/fields

This struct uses parent tracking via the _parent field to maintain references to its owning Pilot and PilotLvlUpSkillsArray. See memhack base struct for more info on this

Table of Contents

Data

Field Type Offset Description
id ItBString | [memhack] ItBString 0x0 The main value used to determine skill effect in game. e.g. "move"
shortName ItBString | [memhack] ItBString 0x18 Short name displayed in the small box in UI. e.g. "move_shortName"
fullName ItBString | [memhack] ItBString 0x30 Full name displayed when hovering over skill. e.g. "move_fullName"
description ItBString | [memhack] ItBString 0x48 Description displayed when hovering over skill. e.g. "move_DescName"
healthBonus int 0x60 Health bonus provided by the skill
coresBonus int 0x64 Reactor cores bonus provided by the skill
gridBonus int 0x68 Grid power bonus provided by the skill
moveBonus int 0x6C Movement bonus provided by the skill
saveVal int 0x70 Value used in the save file. Does not directly change the skill effect (the ID does). Values outside 0-13 are still written to memory, but are clamped to 0-13 before onGameEntered.

Data Functions

These are functions that draw from the data in the struct or set the data in the struct

Game Functions

These are functions that are implemented for this struct but are not primarily about retrieving/setting information in this struct

Other Functions

There are a number of private and internal functions. These should generally be avoided outside of memhack

set

  • void PilotLvlUpSkill:set(values)
Argument name Type Description
values table or PilotLvlUpSkill Table of field names to values, or another PilotLvlUpSkill struct

Bulk setter that sets multiple fields at once. Fires a single change hook with all changes after all fields are updated.

Example:

skill:set({
    id = "Move",
    shortName = "Pilot_MoveShort",
    fullName = "Pilot_MoveName",
    moveBonus = 1,
    saveVal = 1
})

getId

  • ItBString PilotLvlUpSkill:getId()

Returns the skill's ID as an ItBString struct. This is the primary value used to determine the skill's effect in game.

Example:

local skill = pilot:getLvlUpSkill(1)
LOG("Skill ID: " .. skill:getId())  -- Uses __tostring

getIdStr

  • string PilotLvlUpSkill:getIdStr()

Convenience wrapper that returns the skill's ID as a string directly.

Example:

local idStr = skill:getIdStr()
LOG("Skill ID: " .. idStr)

setId

  • void PilotLvlUpSkill:setId(id)
Argument name Type Description
id string or ItBString The skill ID

Sets the skill's ID. This determines the skill's actual effect in game.

Example:

skill:setId("Move")

getShortName

  • ItBString PilotLvlUpSkill:getShortName()

Returns the skill's short name as an ItBString struct, displayed in the small box in the UI.

Example:

LOG("Short name: " .. skill:getShortName())  -- Uses __tostring

getShortNameStr

  • string PilotLvlUpSkill:getShortNameStr()

Convenience wrapper that returns the skill's short name as a string directly.

Example:

local shortName = skill:getShortNameStr()

setShortName

  • void PilotLvlUpSkill:setShortName(name)
Argument name Type Description
name string or ItBString The short name

Sets the skill's short name displayed in the UI.

Example:

skill:setShortName("Pilot_MoveShort")

getFullName

  • ItBString PilotLvlUpSkill:getFullName()

Returns the skill's full name as an ItBString struct, displayed when hovering over the skill.

Example:

LOG("Full name: " .. skill:getFullName())  -- Uses __tostring

getFullNameStr

  • string PilotLvlUpSkill:getFullNameStr()

Convenience wrapper that returns the skill's full name as a string directly.

Example:

local fullName = skill:getFullNameStr()

setFullName

  • void PilotLvlUpSkill:setFullName(name)
Argument name Type Description
name string or ItBString The full name

Sets the skill's full name displayed when hovering.

Example:

skill:setFullName("Pilot_MoveName")

getDescription

  • ItBString PilotLvlUpSkill:getDescription()

Returns the skill's description as an ItBString struct, displayed when hovering over the skill.

Example:

LOG("Description: " .. skill:getDescription())  -- Uses __tostring

getDescriptionStr

  • string PilotLvlUpSkill:getDescriptionStr()

Convenience wrapper that returns the skill's description as a string directly.

Example:

local description = skill:getDescriptionStr()

setDescription

  • void PilotLvlUpSkill:setDescription(description)
Argument name Type Description
description string or ItBString The description

Sets the skill's description displayed when hovering.

Example:

skill:setDescription("Pilot_MoveDesc")

getHealthBonus

  • int PilotLvlUpSkill:getHealthBonus()

Returns the health bonus provided by this skill. This returns the "set value" which may differ from the actual memory value when bonuses are combined at level 2/with virtual skills.

Example:

local healthBonus = skill:getHealthBonus()
LOG("Health bonus: " .. healthBonus)

setHealthBonus

  • void PilotLvlUpSkill:setHealthBonus(bonus)
Argument name Type Description
bonus int The health bonus

Sets the health bonus. This sets the "set value" and automatically triggers bonus combining logic if the pilot is at level 2/has virtual skills.

Example:

skill:setHealthBonus(2)

getCoresBonus

  • int PilotLvlUpSkill:getCoresBonus()

Returns the reactor cores bonus provided by this skill. This returns the "set value" which may differ from the actual memory value when bonuses are combined at level 2/with virtual skills.

Example:

local coresBonus = skill:getCoresBonus()
LOG("Cores bonus: " .. coresBonus)

setCoresBonus

  • void PilotLvlUpSkill:setCoresBonus(bonus)
Argument name Type Description
bonus int The cores bonus

Sets the reactor cores bonus. This sets the "set value" and automatically triggers bonus combining logic if the pilot is at level 2/has virtual skills.

Example:

skill:setCoresBonus(1)

getGridBonus

  • int PilotLvlUpSkill:getGridBonus()

Returns the grid power bonus provided by this skill. This returns the "set value" which may differ from the actual memory value when bonuses are combined at level 2/with virtual skills.

Example:

local gridBonus = skill:getGridBonus()
LOG("Grid bonus: " .. gridBonus)

setGridBonus

  • void PilotLvlUpSkill:setGridBonus(bonus)
Argument name Type Description
bonus int The grid bonus

Sets the grid power bonus. This sets the "set value" and automatically triggers bonus combining logic if the pilot is at level 2/has virtual skills.

Example:

skill:setGridBonus(3)

getMoveBonus

  • int PilotLvlUpSkill:getMoveBonus()

Returns the move bonus provided by this skill. This returns the "set value" which may differ from the actual memory value when bonuses are combined at level 2/with virtual skills.

Example:

local moveBonus = skill:getMoveBonus()
LOG("Move bonus: " .. moveBonus)

setMoveBonus

  • void PilotLvlUpSkill:setMoveBonus(bonus)
Argument name Type Description
bonus int The move bonus

Sets the move bonus. This sets the "set value" and automatically triggers bonus combining logic if the pilot is at level 2/has virtual skills.

Example:

skill:setMoveBonus(1)

getSaveVal

  • int PilotLvlUpSkill:getSaveVal()

Returns the save value used in save files. Vanilla skills use 0-13. This does not directly change the skill's effect (the ID does that).

Example:

local saveVal = skill:getSaveVal()
LOG("Save value: " .. saveVal)

setSaveVal

  • void PilotLvlUpSkill:setSaveVal(value)
Argument name Type Description
value int Save value to write. Other values can be stored; they are clamped to 0-13 before onGameEntered.

Sets the save value used in save files. This does not change the skill's effect.

Example:

skill:setSaveVal(1)

getParentPilot

  • Pilot PilotLvlUpSkill:getParentPilot()

Returns the Pilot struct that owns this skill.

Example:

local pilot = skill:getParentPilot()
if pilot then
    LOG("Skill belongs to " .. pilot:getName())
end

getParentPilotLvlUpSkillsArray

  • PilotLvlUpSkillsArray PilotLvlUpSkill:getParentPilotLvlUpSkillsArray()

Returns the PilotLvlUpSkillsArray that contains this skill.

Example:

local skillsArray = skill:getParentPilotLvlUpSkillsArray()

Private and Internal Functions

These functions are for internal use or advanced manipulation. Most users should use the public functions above instead. These are expected to primarily be used when making changes in memhack itself

_setId_noFire

  • void PilotLvlUpSkill:_setId_noFire(id)

Raw ID setter that does not fire change hooks. Use setId() instead unless you need to bypass hook firing.

_setShortName_noFire

  • void PilotLvlUpSkill:_setShortName_noFire(name)

Raw short name setter that does not fire change hooks. Use setShortName() instead.

_setFullName_noFire

  • void PilotLvlUpSkill:_setFullName_noFire(name)

Raw full name setter that does not fire change hooks. Use setFullName() instead.

_setDescription_noFire

  • void PilotLvlUpSkill:_setDescription_noFire(description)

Raw description setter that does not fire change hooks. Use setDescription() instead.

_setHealthBonus_noFire

  • void PilotLvlUpSkill:_setHealthBonus_noFire(bonus)

Raw health bonus setter that does not fire change hooks. Use setHealthBonus() instead.

_setHealthBonus

  • void PilotLvlUpSkill:_setHealthBonus(bonus)

Raw health bonus setter that writes directly to memory without tracking set values or triggering combining logic. This is used internally by combineBonuses(). Use setHealthBonus() for normal usage.

_getHealthBonus

  • int PilotLvlUpSkill:_getHealthBonus()

Raw health bonus getter that reads directly from memory. This returns the actual memory value which may differ from the "set value" when bonuses are combined. Use getHealthBonus() instead.

_setCoresBonus_noFire

  • void PilotLvlUpSkill:_setCoresBonus_noFire(bonus)

Raw cores bonus setter that does not fire change hooks. Use setCoresBonus() instead.

_setCoresBonus

  • void PilotLvlUpSkill:_setCoresBonus(bonus)

Raw cores bonus setter that writes directly to memory without tracking set values or triggering combining logic. This is used internally by combineBonuses(). Use setCoresBonus() for normal usage.

_getCoresBonus

  • int PilotLvlUpSkill:_getCoresBonus()

Raw cores bonus getter that reads directly from memory. This returns the actual memory value which may differ from the "set value" when bonuses are combined. Use getCoresBonus() instead.

_setGridBonus_noFire

  • void PilotLvlUpSkill:_setGridBonus_noFire(bonus)

Raw grid bonus setter that does not fire change hooks. Use setGridBonus() instead.

_setGridBonus

  • void PilotLvlUpSkill:_setGridBonus(bonus)

Raw grid bonus setter that writes directly to memory without tracking set values or triggering combining logic. This is used internally by combineBonuses(). Use setGridBonus() for normal usage.

_getGridBonus

  • int PilotLvlUpSkill:_getGridBonus()

Raw grid bonus getter that reads directly from memory. This returns the actual memory value which may differ from the "set value" when bonuses are combined. Use getGridBonus() instead.

_setMoveBonus_noFire

  • void PilotLvlUpSkill:_setMoveBonus_noFire(bonus)

Raw move bonus setter that does not fire change hooks. Use setMoveBonus() instead.

_setMoveBonus

  • void PilotLvlUpSkill:_setMoveBonus(bonus)

Raw move bonus setter that writes directly to memory without tracking set values or triggering combining logic. This is used internally by combineBonuses(). Use setMoveBonus() for normal usage.

_getMoveBonus

  • int PilotLvlUpSkill:_getMoveBonus()

Raw movebonus getter that reads directly from memory. This returns the actual memory value which may differ from the "set value" when bonuses are combined. Use getMoveBonus() instead.

_setSaveVal_noFire

  • void PilotLvlUpSkill:_setSaveVal_noFire(value)

Raw save value setter that does not fire change hooks. Use setSaveVal() instead.