[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
- set
- getId
- getIdStr
- setId
- getShortName
- getShortNameStr
- setShortName
- getFullName
- getFullNameStr
- setFullName
- getDescription
- getDescriptionStr
- setDescription
- getHealthBonus
- setHealthBonus
- getCoresBonus
- setCoresBonus
- getGridBonus
- setGridBonus
- getMoveBonus
- setMoveBonus
- getSaveVal
- setSaveVal
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
voidPilotLvlUpSkill: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
ItBStringPilotLvlUpSkill: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
stringPilotLvlUpSkill:getIdStr()
Convenience wrapper that returns the skill's ID as a string directly.
Example:
local idStr = skill:getIdStr()
LOG("Skill ID: " .. idStr)
setId
voidPilotLvlUpSkill: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
ItBStringPilotLvlUpSkill: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
stringPilotLvlUpSkill:getShortNameStr()
Convenience wrapper that returns the skill's short name as a string directly.
Example:
local shortName = skill:getShortNameStr()
setShortName
voidPilotLvlUpSkill: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
ItBStringPilotLvlUpSkill: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
stringPilotLvlUpSkill:getFullNameStr()
Convenience wrapper that returns the skill's full name as a string directly.
Example:
local fullName = skill:getFullNameStr()
setFullName
voidPilotLvlUpSkill: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
ItBStringPilotLvlUpSkill:getDescription()
Returns the skill's description as an ItBString struct, displayed when hovering over the skill.
Example:
LOG("Description: " .. skill:getDescription()) -- Uses __tostring
getDescriptionStr
stringPilotLvlUpSkill:getDescriptionStr()
Convenience wrapper that returns the skill's description as a string directly.
Example:
local description = skill:getDescriptionStr()
setDescription
voidPilotLvlUpSkill: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
intPilotLvlUpSkill: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
voidPilotLvlUpSkill: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
intPilotLvlUpSkill: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
voidPilotLvlUpSkill: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
intPilotLvlUpSkill: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
voidPilotLvlUpSkill: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
intPilotLvlUpSkill: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
voidPilotLvlUpSkill: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
intPilotLvlUpSkill: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
voidPilotLvlUpSkill: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
PilotPilotLvlUpSkill: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
PilotLvlUpSkillsArrayPilotLvlUpSkill: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
- _setShortName_noFire
- _setFullName_noFire
- _setDescription_noFire
- _setHealthBonus_noFire
- _setHealthBonus
- _getHealthBonus
- _setCoresBonus_noFire
- _setCoresBonus
- _getCoresBonus
- _setGridBonus_noFire
- _setGridBonus
- _getGridBonus
- _setMoveBonus_noFire
- _setMoveBonus
- _getMoveBonus
- _setSaveVal_noFire
_setId_noFire
voidPilotLvlUpSkill:_setId_noFire(id)
Raw ID setter that does not fire change hooks. Use setId() instead unless you need to bypass hook firing.
_setShortName_noFire
voidPilotLvlUpSkill:_setShortName_noFire(name)
Raw short name setter that does not fire change hooks. Use setShortName() instead.
_setFullName_noFire
voidPilotLvlUpSkill:_setFullName_noFire(name)
Raw full name setter that does not fire change hooks. Use setFullName() instead.
_setDescription_noFire
voidPilotLvlUpSkill:_setDescription_noFire(description)
Raw description setter that does not fire change hooks. Use setDescription() instead.
_setHealthBonus_noFire
voidPilotLvlUpSkill:_setHealthBonus_noFire(bonus)
Raw health bonus setter that does not fire change hooks. Use setHealthBonus() instead.
_setHealthBonus
voidPilotLvlUpSkill:_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
intPilotLvlUpSkill:_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
voidPilotLvlUpSkill:_setCoresBonus_noFire(bonus)
Raw cores bonus setter that does not fire change hooks. Use setCoresBonus() instead.
_setCoresBonus
voidPilotLvlUpSkill:_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
intPilotLvlUpSkill:_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
voidPilotLvlUpSkill:_setGridBonus_noFire(bonus)
Raw grid bonus setter that does not fire change hooks. Use setGridBonus() instead.
_setGridBonus
voidPilotLvlUpSkill:_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
intPilotLvlUpSkill:_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
voidPilotLvlUpSkill:_setMoveBonus_noFire(bonus)
Raw move bonus setter that does not fire change hooks. Use setMoveBonus() instead.
_setMoveBonus
voidPilotLvlUpSkill:_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
intPilotLvlUpSkill:_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
voidPilotLvlUpSkill:_setSaveVal_noFire(value)
Raw save value setter that does not fire change hooks. Use setSaveVal() instead.