i get this error when i try to start a battle, no clue what i'm doing wrong
edit: turns out the problem was that i wrote the plugin command as "LeTBS On" rather than "LeTBS ON" WHICH IS A VERY ANNOYING ERROR.
tho now i've got a different issue where it says "cannot read property apply of undefined".
If you are getting undefined errors, it means there is something wrong with your settings. Start a project from the demo, and when making new characters, classes, etc., copy the pre-built options and look to see what everything referenced inside refers to.
For example, this is the code inside one of the skills in my game. The sequence MatchlockShoot needs to be defined in LeTBSConfig.js
In skill "Matchlock Shoot" notetags:
<letbs>
scope: circle(1)
scope_select: enemies
sequence: MatchlockShoot
</letbs>
In LeTBSConfig.js:
"MatchlockShoot": [
"play_pose: user, idle768, idle768",
"wait: 5",
"play_pose: user, MatchlockShoot, idle768",
"wait: 15",
"directional_anim: user, user, 450, 451, 452, 453",
"effects: {aoe}_battlers, current_obj, obj_anim",
"wait: 25",
"play_pose: user, idle, idle",
"wait: 5"
],
Every sequence needs a match. The same is true for poses, sprites, etc.
Since idle768, MatchlockShoot, and idle are all referenced, you need a matching spritesheet for each, as well as how many frames each animation has inside the actor notebox.
In the actor notebox:
<letbs_sprite>
pose(idle): _idle768, 1
pose(idle768): _idle768, 1
pose(MatchlockShoot): _MatchlockShoot, 19
</letbs_sprite>
Spoiler: full LeTBS actor notebox for one of my actors
<letbs_sprite>
frame_delay: 10
pose(block): _block, 1
pose(downed): _crit, 1
pose(dead): _dead, 1
pose(evaded): _idle, 1
pose(hit): _idle, 1
pose(block): _block, 1
pose(cast): _cast, 14
pose(idle): _idle768, 1
pose(idle768): _idle768, 1
pose(move): _move, 32
pose(MatchlockShoot): _MatchlockShoot, 19
pose(BambooStaffSlash): _BambooSlash, 12
pose(LampLighterSlash): _LampLightSlash, 12
pose(CaladbolgSlash): _CaladbolgSlash, 12
pose(FlambergeSlash): _FlambergeSlash, 12
pose(AncientSwordSlash): _AncSwordSlash, 12
pose(ZweihanderSlash): _ZweihanderSlash, 12
pose(ClaymoreSlash): _ClaymoreSlash, 12
pose(DragonslayerAxeSlash): _DragonAxeSlash, 12
pose(ExecutionerAxeSlash): _ExecutAxeSlash, 12
pose(DoubleAxeSlash): _DoubleAxeSlash, 12
pose(BattleAxeSlash): _BattleAxeSlash, 12
</letbs_sprite>
<letbs>
move_points: 5
</letbs>
<letbs_commands>
move 82, skills 64, scan 75, pass 74
</letbs_commands>
<Letbs_Scan_Text>
Assassin
</Letbs_Scan_Text>
<Letbs_Scan_Options>
show_stats: true
</Letbs_Scan_Options>
the 19 associated with MatchlockShoot refers to how many frames are in the animation. I also need a matching spritesheet found inside LeTBS_0772B\img\leTBS\Battlers for every actor that will use this skill and has the pose defined in the actor notebox. Same with every other pose that is defined in the actor notebox.
Skills call sequences, sequences call poses, poses are defined in actor notebox, and are .png files inside the leTBS\Battlers folder.
For my character named AssassinM2, the file is called: AssassinM2_MatchlockShoot.png See image to see how it is set up for 19 frames:
Use the guide here to help understand how everything works, and only change things from the demo one at a time so you can see what is wrong if anything:
https://lecodemv.github.io/leTBS/old/home.html
If you forget to put the required info in, you will get a crash like this. But the plugin does work as long as user error is avoided. There are a few things that could be better optimized, but crashes result in 99.9% of cases from not following the instructions to the letter.
-----
One thing I also wanted to add for those still working with this plugin, there is a bug where if you have multiple skill types, and exit from the 2nd or 3rd on your command list while in battle, it returns you to the first skill type rather than the active one. This is because the function
Window_TBSCommand.prototype.selectLast = function found within LeTBS_Commands.js calls this.selectSymbol(last);, but does not differentiate between multiple skilltypes. It simply resets to the first.
I was able to fix this error by changing the code to the following:
JavaScript:
Window_TBSCommand.prototype.selectLast = function () {
if (this._lastBattler !== null && this._battler !== this._lastBattler) {
this.select(0);
}
if (this._battler) {
this._lastBattler = this._battler
}
/* // old code commented out
this.select(0);
if (this._battler) {
var last = this._battler.lastCommandSymbol();
if (last !== "pass") //lastCommandSymbol never = pass, so this is always called
this.selectSymbol(last); //calls first skill type instead of active skill type
}
*/
};
This removes the selectSymbol(last) function and instead relies on the default MV cursor memory instead. I originally just commented out this whole section, but encountered crashes when changing turns while actor 1 had more command options than the next actor in the turn order, due to wanting to reset to a non-available command # in the list of available commands.
This script instead resets the cursor to the first slot for the next actor when a new turn begins, and keeps the cursor memory until that point.
Happy coding