Original Source
- Original title: TAA_SkillMastery (v1.3.1)
- Original author: taaspider
- Original date: December 24, 2020
- Source thread: https://forums.rpgmakerweb.com/threads/taa_skillmastery-v1-3-1.131348/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugin Releases (RMMZ)
Summary
TAA_SkillMastery - v1.3.1 Created by taaspider Terms of Use Any plugins developed by taaspider are free for use for both commercial and noncommercial RPG Maker games, unless specified otherwise. Just remember to credit "taaspider".
Archived First Post
Created by taaspider
Terms of Use
Any plugins developed by taaspider are free for use for both commercial and noncommercial RPG Maker games, unless specified otherwise. Just remember to credit "taaspider".
Redistribution of parts or the whole of taaspider plugins is forbidden (which also includes reposting), unless it comes from the official website (linked within the post). You are allowed to edit and change the plugin code for your own use, but you're definitely not allowed to sell or reuse any part of the code as your own. Although not required to use my plugins, a free copy of your game would be nice!
Introduction
This plugin provides functions to add levels and specific level settings to skills. Its goal is to allow a sense of skill mastery, meaning that as a character uses a skill he may slowly get better at using it. What "getting better" means is completely up to the developer: the skill can get stronger, require less MP to cast, add a state with a critical blow, boost party morale increasing defense, and so on. The plugin includes damage modifiers and custom effects that can be applied to specific skill levels, increasing the fealing of getting more powerful as skill mastery grows!
Here's a list of the plugin's main features:
- Loading skill level data through a JSON file, making it easier to configure and evolve level data throughout the game development;
- If you're not comfortable working with JSON files, you can also configure skill level data through the Plugin Manager;
- Provides not only formulas for level variations, but also allow more refined control of each skill aspect for each new level;
- Allow TP gain to be affected by skill level progression;
- Skill descriptions change as it levels up;
- Have specific effects (like applying a state or setting a variable) change as the skill progresses;
- Make as so skill levels can have specific requirements that must be met before skill XP can be gained to achieve the next level (or prevent a character to learn it in the first place);
- Allow skills to only gain XP for each battle won, or even restricting it to only when the actor survive the battle;
- Allow enemy skills to progress as well;
- Have some skills be unable to level up (like default Attack and Guard skills);
Warning: I'm yet to test the plugin with large numbers of skills, both using a JSON file or the Plugin Manager as source. Although I don't expect that to be a problem while playing the game, I'm worried that its initial setup may affect game load time. If you do test it out before I do please let me know the results so I can act on it faster!
Screenshots
View attachment 134173
View attachment 134174
View attachment 134175
View attachment 134176
How to Use
You can download the plugin here.
You can also test the plugin using my sample demo project. It was built with MV, but you can open it with MZ as well (just open the game.rmmzproject file and you're good to go).
You can find below basic instructions as to how to setup your JSON file. You must follow the same structure, but you can change each object name to your liking through the plugins parameters.
{
"id": <skill id>,
"xpType": 1,
"default": {
"mpCost": <cost>,
"tpCost": <cost>,
"tpGain": <gain>,
"damage": "<damage formula>",
"req": "<requirement, if any>",
"description": "<skill description>",
"dmgMods": [ "<damage modifier tags here", "<dmgMods>", ... ],
"customEffects": [ "<effects tags here>", "<effects>", ... ]
},
"formulas": {
"mpCost": "<cost formula>",
"tpCost": "<cost formula>",
"tpGain": "<gain formula>",
"xp": "<xp formula>"
},
"levels": [
{
"mpCost": <cost>,
"tpCost": <cost>,
"tpGain": <gain>,
"damage": "<damage formula>",
"req": "<requirement, if any>",
"description": "<skill description>",
"dmgMods": [ "<damage modifier tags here", "<dmgMods>", ... ],
"customEffects": [ "<effects tags here>", "<effects>", ... ]
},
{
"mpCost": <cost>,
...
}
]
},
{
"id": <skill id>,
...
}
]
"xpType" must be used to identify how the skill gains xp. There are three possible values:
- Skill uses
- Battles won
- Battles survived
The "default" tag includes what are the default values if no level specific data is found (so if these are set, you probably won't need to define data for the skill's first level). The plugin will always search first for specific level data, then defaults, and if none are found it will use the values set through RPG Maker's interface.
The "formulas" array is optional, and must be used only if you want to set formulas for MP and TP cost, TP gain or a custom XP curve formula. If setting a formula, the word "level" will be replaced by the plugin with the current skill level.
The "levels" array is used to include specific changes introduced by each level. You don't need to defined all tags for each level if their values are not changed. For example, if MP cost remains constant until level 5, you can omit the mpCost tag from levels 1 to 4 and use it only on the default array, or defined it only on levels 1 and 5.
The "requirements" tag work different than the others, as it is cumulative. So a higher level requirement is the sum of all previous level requirements. That is to prevent inconsistencies if a character tries to learn a skill at a higher level without meeting the requirements for its weaker versions.
The "levels" array must list level object in order. If you want to skip changes on a level, simply replace the object with "null" or an empty object "{}", like the example below:
null,
{
"mpCost": 100
},
{},
{
"tpCost": 10
}
]
If a skill has no data defined in the JSON file, skill levels will be disabled (the skill will always be listed as being at the starting level).
The tags "dmgMods" and "customEffects" are arrays of specific plugin code that allows you to program damage modifiers and special custom effects for each level. For a list of supported tags, please refer to the proper section below.
- Whenever MP Cost, TP Cost or TP Gain are set as -1, the value is ignored by the plugin;
- Blank descriptions, requirements, or damage formulas on a specific skill level won't override the previous level value, contrary to what happens when using a JSON file;
a.agi > 80
You can add more conditions with && (and) or || (or). For example: a skill level that requires agility higher than 80, and also have the skill with id 10 already learned:
a.agi > 80 && a.hasSkill(10)
If you want to set a requirement for having a skill at a specific level, just use the function hasSkill with two parameters, being the first the skill id and the second the required level:
a.agi>80 && a.hasSkill(10, 2)
Currently, the following modifiers are supported:
CRITICAL: <TYPE>
Replace <TYPE> with one of the options below:
- 0 or NORMAL: Fall back to MVs default critical hit formula;
- 1, NEVER or DISABLE: Remove any chance of the skill resulting in a critical hit;
- 2, ALWAYS, ENABLE or FORCE: Force critical hits on all skill uses;
Examples:
CRITICAL: 0
CRITICAL: ENABLE
CRITICAL: NEVER
DAMAGE MOD: <mod>
DAMAGE MODIFIER: <mod>
Use one of "<mod>" formats to change the skill damage formula:
- <oper> x, <oper> x%: Replace <oper> by +, -, * or /. This will apply the specified operand to add, remove, multiply or divide the damage formula result by the specified number;
Examples:
DAMAGE MOD: +10
DAMAGE MOD: *2
DAMAGE MOD: -5
DAMAGE MODIFIER: +2%
DAMAGE MODIFIER: *10%
- EVAL <expression>: Applies an eval to <expression> to append a clause to the damage formula results;
Examples:
DAMAGE MOD: EVAL * (a.hp/a.mhp)
DAMAGE MOD: EVAL + (a.mp/5)
Despite all examples being listed in upper case, the plugin is case insensitive.
Currently, the following tags are supported:
ADD STATE: <state> <who>
REMOVE STATE: <state> <who>
Use this effect to add or remove a state effect after the skill is used. Replace <state> with the state ID or state name enclosed in double quotes, while <who> must be replaced by one of the following clauses, specifying who will be affected:
- USER: Affects the skill user;
- PARTY: Affects the user's whole party (or troop, if used by an enemy);
- TARGET, or TARGETS: Affects the skill target, be it one or many;
- DEAD ALLIES: Affects all KOed party, or troop, members;
- DEAD ENEMIES: Affects all KOed enemies, or party members;
- ALIVE ALLIES: Affects all alive party, or troop, members;
- ALIVE ENEMIES: Affects all alive enemies, or party members;
- PARTY BUT USER: Affects the whole party, except the user;
- ENEMIES BUT TARGET: Affects all enemies, except the skill targets;
ADD STATE: 10 USER
REMOVE STATE: "Poison" ALIVE ALLIES
ADD STATE: "Bleed" ENEMIES BUT TARGET
REMOVE STATE: 15 PARTY
SWITCH n: <action>
SWITCH n - m: <action>
SWITCH n to m: <action>
Changes one or a series of switches states (replace n and m to specify your range). The tag <action> can be replaced with one of the following effects:
- on: Set the switch to TRUE;
- off: Set the switch to FALSE;
- toggle: Toggle switch value;
- switch x: Copy switch x value;
SWITCH 1: on
SWITCH 5 - 10: off
SWITCH 2 - 4: toggle
SWITCH 10: switch 1
SWITCH n: EVAL <expression>
SWITCH n - m: EVAL <expression>
Changes one or a series o switches states (replace n and m to specify your range) according to the result of an eval operation. The tag <expression> must be replaced with a script that returns true or false, or integers (where anything greater than zero will become true, and less or equal to zero false).
Examples:
SWITCH 1: EVAL a.hp/a.mhp > 0.5
SWITCH 2 - 8: EVAL a.hasSkill(4, 5) && a.mp > 150
VAR x <action>
VAR x - y <action>
VARIABLE x <action>
VARIABLE x to y <action>
Changes one or a series of variable values (replace x and y to specify your range). The tag <action> can be replaced with one of the following effects:
- = N: Sets the variable or range to value N. You can also set to the same value of the variable N using "= v[N]" instead;
- += N: Add N to the value of the variable. You can also add the value of the variable N using "+= v[N]" instead;
- -= N: Subtract N from the value of the variable. You can also subtract the value of the variable N using "-= v[N]" instead;
- *= N: Multiply the variable's value by N. You can also multiply by the the value of the variable N using "*= v[N]" instead;
- /= N: Divide the variable's value by N. You can also divide by the value of the variable N using "/= v[N]" instead;
- %= N: Replace the variable's value by the rest of the division of its current value by N. You may also use "%= v[N]" to divide by the value of the variable N;
VAR 1 = 10
VARIABLE 7 += v[8]
VAR 2 - 7 *= 2
VAR 1 to 4 /= 3
VAR x: EVAL <expression>
VAR x - y: EVAL <expression>
VARIABLE x: EVAL <expression>
VARIABLE x - y: EVAL <expression>
Changes one or a series of variable values (replace x and y to specify your range) according to the result of an eval operation. The tag <expression> must be replaced with a script that returns integers greater or equal to zero.
Examples:
VAR 1: EVAL Math.floor((a.hp / a.mhp) * 100)
VARIABLE 6 - 11: EVAL Math.round(a.mp / a.hp)
VARIABLE 3: EVAL $gameVariables.value(1) + a.hp
EVAL: <eval clause>
Runs an eval on the <eval clause>. You can access the skill user data using the object "a" (a.hp, a.mp, a.hasSkill(<skillId>), a.actorId(), ...).
Examples:
EVAL: $gameVariables.setValue(1, a.actorId())
EVAL: a.hp > 100 ? $gameVariables.setValue(1, a.hp) : $gameVariables.setValue(1, 100)
EVAL: $gameVariables.setValue(1, Math.min(100, a.hp))
COMMON EVENT: N
Call common event of number N. One important limitation though, is that a multiple Common Event calls as custom effects of the same skill is not currently supported. If you try to insert two or more COMMON EVENT effect, only the last one will be run. You can have one for each level, but not more than one by level.
Examples:
COMMON EVENT: 10
ON CRITICAL
Add this clause to the start of any of the previous custom effect tags so that it will only take effect if the skill has landed a critical hit.
Examples:
ON CRITICAL ADD STATE: 5 USER
ON CRITICAL SWITCH 3: on
ON CRITICAL VAR 7 += 1
ON CRITICAL COMMON EVENT: 2
<TAA_SKM: S[1], L[1], X[10]>
or
<TAA_SKM>
S[1], L[1]
S[2], L[2], X[11]
</TAA_SKM>
You can also specify an interval for L and X, like this:
<TAA_SKM: S[1], L[1,3], X[0,5]>
or
<TAA_SKM>
S[1], L[1,3], X[0,5]
</TAA_SKM>
"S" stands for skill, so the number inside the square brackets must be a valid skill id. "L" means level, and defines the starting level. "X" is xp and is an optional tag. It defines that the skill starts with an amount of xp already gained. This allows you to setup enemies and make it more likely that their skills can level up during battle, or that a playable character included to the party have a skill halfway to the next level.
If you specify an interval for L or X instead of a fixed number, the plugin will calculate a random number inside the interval. This way you can have, for example, enemies in a troop with random experience in the same skill, so that each one may level up at different times. The goal here is to create a layer of unpredictability and make things a bit more interesting to the player!
$gameSystem.getSkillTpCost(skillId, level)
$gameSystem.getSkillTpGain(skillId, level)
$gameSystem.getSkillDescription(skillId, level)
$gameSystem.getDamageFormula(skillId, level)
$gameSystem.actorMeetsRequirements(skillId, level, actorId)
$gameSystem.getSkillXpType(skillId)
$gameSystem.getSkillLevel(skillId, actorId)
$gameSystem.learnSkill(actorId, skillId, customLevel, customXp)
$gameSystem.getSkillProgression(actorId, skillId)
$gameSystem.isSkillKnown(actorId, skillId)
$gameSystem.hasSkill(actorId, skillId, skillLevel)
$gameSystem.getCurrentSkillXp(actorId, skillId)
$gameSystem.getSkillXpToNextLevel(actorId, skillId)
$gameSystem.getSkillUses(actorId, skillId)
$gameSystem.gainSkillXp(actorId, skillId, xp)
$gameSystem.setSkillLevel(actorId, skillId, level)
Learn Multiple Skills
Gain Skill XP
Change Level
Notes:
- Obviously this plugin is not compatible with any other that provide skill levels. If the plugin do not customize skill structure, it should be compatible. But at least for now I cannot garantee plugin compatibility.
- Version 1.3.1:
- Added the ability to change a skill name with level up;
- Added options to allow players to execute a specific level of a skill;
- Code clean up and optimizations;
- Version 1.3.0:
- Fixed a compatibility issue with Fomar0153_EquipmentSkills that would cause a game crash if horizontal gauges are used.
- Fixed an issue that would cause the plugin to load Plugin Manager skill data twice, causing unnecessary warning messages in the console.
- Added parameters to further customize mastery gauges.
- Added parameters for alternative message and animations when the skill reaches its maximum level.
- Minor improvements to level up message display.
- Fixed a bug with skill cost display.
- Included a parameter to allow adding a separator between TP and MP costs when a skill requires both. Default engine text color for each type of cost are not changed.
- Added a parameter to define skill cost formatting pattern.
- Version 1.2.2:
- Changed one function call to prevent crashes when using a skill not properly initialized.
- Added a condition for drawing Skill Mastery gauges to prevent compatibility issues with other plugins.
- Fixed a bug that could cause the game to crash while reading skill mastery data at boot when using the Plugin Manager as datasource.
- Added the variable id referencing the current skill ID when evaluating skill requirements.
- Added two new parameters:
- Enemy Skill Level Up: allows to disable skill leveling for enemies.
- Lock Trait Skills: allows to prevent skills made available by traits from leveling up. If enabled, only skills the actor have effectively learned can gain experience.
- Version 1.2.1:
- Fixed a bug that causes the equip scene to crash on MZ;
- Version 1.2.0:
- Added MZ compatibility;
- Added a new parameter to specify a list of skills which should not be leveled (like, for example, default attack and guard skills). This prevents this skills from triggering level up animations and having a level added to their names on the skill list;
- Version 1.1.1:
- Added support to variables within the SUMMON custom effect clause;
- Version 1.1.0:
- Fixed a bug when skill level was not initialized on database. Using the skill would cause the game to crash;
- Updates custom effect for Add/Remove state:
- Changed function used to apply/remove state, so that state resistance and intensity are considered. Previously states were added and removed always with 100% chance;
- Added option to define how likely the state will be applied/removed, much like what we have in the editor;
- Added options to create conditions before applying/removing states. There's three options: check value of one variable; test one switch; or go wild with an eval clause;
- Added custom effect integrated with TAA_EnemyReinforcements, allowing skill levels to change reinforcement summoning behavior.
- Added a new plugin parameter that allows you to disable EnemyReinforcements note tags and use only custom effect for skill levels. If the parameter is disabled, tags included in a skill are always processed, regardless of the skill level. Otherwise, only custom effect SUMMON clauses are considered;
- Version 1.0.2:
- Few minor bug fixes;
- Change in terms of use;
- Version 1.0.1:
- Included new custom effects:
- EVAL clause;
- Setting variables with eval clauses;
- Setting switches with eval clauses;
- Included the option to use intervals for level and xp note tags;
- Included new custom effects:
- Version 1.0.0: Initial release!
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
Terms of Use Any plugins developed by taaspider are free for use for both commercial and noncommercial RPG Maker games, unless specified otherwise. Just remember to credit "taaspider". Redistribution of parts or the whole of taaspider plugins is forbidden (which also includes reposting), unless it comes from the official website (linked within the post). You are allowed to edit and change the plugin code for your own use, but you're definitely not allowed to sell or reuse any part of...
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...