-
Notifications
You must be signed in to change notification settings - Fork 0
Home
A library allowing you to change the repair skill of pilots or mechs, or other conditions of your choosing.
- See Creating-Mods for details on how to create mods.
- Download the latest release of this library.
- Unzip the content into your mod's
scripts
folder. - In the
init
function in your mod'sinit.lua
, initialize the library with either of the following lines.1
will only initialize the library, while2
will both initialize it and give you a library object you can use to call the library functions with. The library object can be fetched in this way several times without issue.require(self.scriptPath.."replaceRepair/replaceRepair")
local replaceRepair = require(self.scriptPath.."replaceRepair/replaceRepair")
- After the library has been initialized in your mod, you can access the library's functions with your reference to the library object. See addSkill for more details.
-
void
replaceRepair:addSkill(repairSkill)
Argument name | Type | Description |
---|---|---|
repairSkill |
table | Descriptions for the repair skill replacement |
repairSkill
must define all of the following fields:
Argument name | Type | Description |
---|---|---|
name |
string | Display name for the repair skill |
description |
string | Displayed description for the repair skill |
weapon |
string | Id for the skill used for the repair skill |
repairSkill
must also define one of the following fields:
Argument name | Type | Description |
---|---|---|
pilotSkill |
string | The pilot skill associated with the repair skill |
mechType |
string | The mech type associated with the repair skill |
isActive |
function | The custom function defining when the repair skill is active |
repairSkill
may define the following additional optional fields:
Argument name | Type | Description |
---|---|---|
icon |
string | path to the displayed icon for the repair skill. Either relative to the mod, or in the game assets |
iconFrozen |
string | path to the displayed icon for the repair skill when the mech is frozen. Either relative to the mod, or in the game assets |
Adds a repair skill which will become available based on the definition provided by either pilotSkill
, mechType
or isActive
.
If pilotSkill
is defined, then mechs piloted by a pilot with this pilot skill will have this repair skill.
Otherwise, if mechType
is defined, then mechs of this type will have this repair skill.
Otherwise, if isActive
is defined, then mechs will have this repair skill only when the function isActive
returns true
.
The field weapon
defines what the repair skill will do, while the fields name
, description
, icon
and iconFrozen
will determine how it will be displayed.
Example:
replaceRepair:addSkill{
name = "Example Punch",
description = "Punches instead of repairing",
pilotSkill = "Extra_XP", -- Ralph's pilot skill
weapon = "Prime_Punchmech", -- Titan Fist
icon = "img/weapons/prime_punchmech.png"
}
This example would change the repair skill to Combat Mech's Titan Fist when piloted by Ralph Karlsson.
Replace Repair functions by overwriting the vanilla repair skill Skill_Repair
, and dynamically changing it to appear like different mechs and pilots have different repair skills.
The original vanilla repair skill definition is stored in Skill_Repair_Orig
instead. It is preserved in the event someone needs to reference the vanilla skill.