Stat And Skills Plugin Documentation
Getting Started with Custom Stats and Skills
This guide will help you set up custom stats and skills for your game using the plugin. Don’t worry—it’s easier than it sounds! Let’s break it down step by step.
Custom Stats
Custom stats are extra parameters (like Attack, Defense, Magic Defense, etc.) that you can add to your game. These stats can be leveled up using stat points, and they even have their own level-up scene.
Key Features:
- Replace Default Stats: Since version
v2.0.0
, you can replace default RPG Maker stats (like HP, MP, ATK, etc.) with your custom stats. - Automatic Leveling: Custom stats can level up automatically and use the class level curve from the database as a base.
Custom Skills
Custom skills work like regular skills but are leveled up differently. They are initialized when a party member learns the skill, and their starting level is based on the party member’s stats.
Example:
- Let’s say you create a skill called Speech.
- The initial level formula for Speech is:
2 + Math.floor((2 * a.chr))
. - If the party member’s Charisma stat is 10 when they learn Speech, the skill’s initial level will be:
2 + (2 * 10) = 22
.
Using Formulas
Custom Stat Formulas
You can use custom stats in formulas anywhere you’d normally use actor parameters (like in skill damage formulas). To access a custom stat, use the a
variable followed by the stat’s short name.
- Example: Change the default Attack skill formula from
a.atk * 4 - b.def * 2
toa.atk * (a.str / 2) - b.def * 2
. This makes the attack damage depend on the actor’s custom Strength stat.
Custom Skill Formulas
Custom skills are accessed using the a.cs
variable followed by the skill name in lowercase (no spaces).
- Example: To use the Speech skill in a formula, write
a.cs.speech
. For a skill like Small Guns, usea.cs.smallguns
.
Extra Tips:
- For readability, you can also use
skill
andstat
variables in formulas. For example:skill.speech
instead ofa.cs.speech
.stat.chr
instead ofa.chr
.
Menu Navigation
Navigating the menu is simple, but there’s one special trick:
- Leveling Up: Use the Left or Right Arrow keys to add or remove skill points.
- Switching Windows: Hold Shift and use the Left or Right Arrow keys to switch between the stats and skills windows.
Adding a Menu Command (VisuStella)
To add a menu command using VisuStella’s Main Menu Core plugin:
- Open the plugin’s parameters.
- Add your custom command to the Command Window List.
Symbol: statlevels
Icon: N/A
STR:Text Stat Levels
JS:Text N/A
JS:Show return true;
JS:Enable: N/A
(Feel free to use a game variable or default)
JS:Ext return null;
JS:RunCode N/A
JS: Personal Code SceneManager.push(StatLevels.Scene);
Notetags
Notetags can be used on all equipment types to gain or penalize a stat.
The stat formula is rather basic
<stat: operation amount>
Where stat
is the shortname of the stat you want to change, the operation
is either add
or remove
and then amount
is the amount of stat levels to
affect.
Examples
To add 5 to agility stat, the notetag would look something like this
<agi: add 5>
To remove from the agility stat, the notetag would look like this
<agi: remove 5>
Script Calls
Script calls are useful for conditional statements in your events or when you're developing a plugin of your own or simply need access to the JavaScript side of things.
A few things to keep note of...
actorId
= The id(number) of the actor you want to access.
statName
= The short name of the stat you want to access
skillName
= The name of the skill as seen in the Skill database
amount
= the amount(number) of a specific level or skill point you want to be added
entireParty
= Whether or not to perform the action on the entire party. (If this is set to true the actorId will be ignored. Can only be true
or false
)
asSkillPoint
= Setting to false will add the amount of points directly to the total rather than it behaving as if you were in the leveling scene adding points to the skill directly.
Add Skill or Stat Points to an Actor
// Stat Point
$sl.addStatPoints(actorId, amount, entireParty);
// Skill Point
$sl.addSkillPoints(actorId, amount, entireParty);
Remove Skill or Stat Points of an Actor
// Stat Point
$sl.removeStatPoints(actorId, amount, entireParty);
// Skill Point
$sl.removeSkillPoints(actorId, amount, entireParty);
Add Skill Level
You can use the following method to ensure the formulas are used. This method will be no different than if you were in the leveling scene and pressed level up for that skill. This will ignore available skill points.
$sl.addSkillLevel((actorId, skillName, amount, entireParty);
Remove Skill Level
You can use the following method to ensure the formulas are used. This method will be no different than if you were in the leveling scene and pressed level down for that skill.
$sl.removeSkillLevel((actorId, skillName, amount, entireParty);
Add level to a custom stat
This will add a level to a custom stat while ignoring available stat points.
$sl.addStatLevel(actorId, statName, amount, entireParty, asIs);
Remove level of a custom stat
This will remove a level of a custom stat while ignoring available stat points
$sl.removeStatLevel(actorId, statName, amount, entireParty, asIs);
Re-evaluate skill and stat bonuses and penalties
When adding or removing a level on a stat be sure to re-evaluate the stat bonus for a skills initial level. Essentially this will ensure your skills will properly adjust their levels according to stat points new level.
$sl.evaluateSkillStatBonus(actorId, entireParty);
Reset Skills
This will reset all skills to their initial level using the initial level formula.
$sl.resetSkills(actorId, entireParty);
Reset Stats
This will reset all stats to their initial level keeping equipment bonuses and penalties intact.
$sl.resetStats(actorId, entireParty);
Access Stat and Skill Data
This will likely not be required for general game development, it would more likely be used for plugin development.
$gameActors.actor(actorId).customStats["str"];
The above returns an object with the following information available to adjust
name: "Strength";
shortName: "str";
description: "The strength description";
currentLevel: 1;
initialLevel: 1;
maxLevel: 10;
For a skill you would for example do
$gameActors.actor(actorId).getCustomSkill("Small Guns");
The above returns an object with the following information
name: "Small guns"
formulaName: "smallguns"
description: "The small guns description"
currentLevel: 1
initialLevel: 1
initialLevelFormula: 25 + (2 \* cs.chr)
maxLevel: 100
Plugin Commands
For further details of each command's arguments, please view the plugin commands in RPG Maker MZ.
Open the level up scene
OpenScene
- Open the stat and skill levelling scene
Add a stat point
AddStatPoint
- Adds a number of stat points to the stat point pool
Add a skill point
AddSkillPoint
- Adds a number of skill points to the skill point pool
Change the level of a skill
SkillLevel
- Add or removes levels to a skill for a specific actor
Change the level of a stat
StatLevel
- Adds points to a stat for a specific actor
Reset stats or skills to initial levels
Reset
- Reset stats or skills to their initial levels
Terms Of Use
https://ltngames.xyz/terms-of-use.html
- Free to use in any of your projects, commercial or otherwise
- Credits/Attribution must go to LTN Games
- You may edit this plugin and you may ask others to edit this plugin for free or for payment so long as the original header and terms of use remain intact.
- You may NOT re-distribute this plugin alone for monetary gains without LTN Games direct written permission.
- You may NOT change any information, including the original parameters or terms of use.
Support
For support please contact us at [email protected]
Alternatives methods for support (not always available)
- Discord Server: LTN Games Server
- Twitter - @ltngames
- RPG Maker Web Forums - LTN Games
Bug Reports
You can report a bug directly to us in an efficient manner through our online form, if your problem is a bug, please report it rather than contact us by email.