Repository navigation
[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
| Field | Type | Offset | Description |
|---|---|---|---|
| id | ItBString | 0x0 | The main value used to determine skill effect in game. e.g. "move" |
| shortName | ItBString | 0x18 | Short name displayed in the small box in UI. e.g. "move_shortName" |
| fullName | ItBString | 0x30 | Full name displayed when hovering over skill. e.g. "move_fullName" |
| description | 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. |
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
These are functions that are implemented for this struct but are not primarily about retrieving/setting information in this struct
There are a number of private and internal functions. These should generally be avoided outside of memhack
-
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
})-
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-
stringPilotLvlUpSkill:getIdStr()
Convenience wrapper that returns the skill's ID as a string directly.
Example:
local idStr = skill:getIdStr()
LOG("Skill ID: " .. idStr)-
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")-
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-
stringPilotLvlUpSkill:getShortNameStr()
Convenience wrapper that returns the skill's short name as a string directly.
Example:
local shortName = skill:getShortNameStr()-
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")-
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-
stringPilotLvlUpSkill:getFullNameStr()
Convenience wrapper that returns the skill's full name as a string directly.
Example:
local fullName = skill:getFullNameStr()-
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")-
ItBStringPilotLvlUpSkill:getDescription()
Returns the skill's description as an ItBString struct, displayed when hovering over the skill.
Example:
LOG("Description: " .. skill:getDescription()) -- Uses __tostring-
stringPilotLvlUpSkill:getDescriptionStr()
Convenience wrapper that returns the skill's description as a string directly.
Example:
local description = skill:getDescriptionStr()-
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")-
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)-
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)-
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)-
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)-
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)-
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)-
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)-
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)-
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)-
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)-
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-
PilotLvlUpSkillsArrayPilotLvlUpSkill:getParentPilotLvlUpSkillsArray()
Returns the PilotLvlUpSkillsArray that contains this skill.
Example:
local skillsArray = skill:getParentPilotLvlUpSkillsArray()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
-
voidPilotLvlUpSkill:_setId_noFire(id)
Raw ID setter that does not fire change hooks. Use setId() instead unless you need to bypass hook firing.
-
voidPilotLvlUpSkill:_setShortName_noFire(name)
Raw short name setter that does not fire change hooks. Use setShortName() instead.
-
voidPilotLvlUpSkill:_setFullName_noFire(name)
Raw full name setter that does not fire change hooks. Use setFullName() instead.
-
voidPilotLvlUpSkill:_setDescription_noFire(description)
Raw description setter that does not fire change hooks. Use setDescription() instead.
-
voidPilotLvlUpSkill:_setHealthBonus_noFire(bonus)
Raw health bonus setter that does not fire change hooks. Use setHealthBonus() instead.
-
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.
-
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.
-
voidPilotLvlUpSkill:_setCoresBonus_noFire(bonus)
Raw cores bonus setter that does not fire change hooks. Use setCoresBonus() instead.
-
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.
-
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.
-
voidPilotLvlUpSkill:_setGridBonus_noFire(bonus)
Raw grid bonus setter that does not fire change hooks. Use setGridBonus() instead.
-
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.
-
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.
-
voidPilotLvlUpSkill:_setMoveBonus_noFire(bonus)
Raw move bonus setter that does not fire change hooks. Use setMoveBonus() instead.
-
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.
-
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.
-
voidPilotLvlUpSkill:_setSaveVal_noFire(value)
Raw save value setter that does not fire change hooks. Use setSaveVal() instead.