Lecode Tactical Battle System 0.77.2B

Oh, didn't notice that as I ended up turning off mouse input due to other reasons. Mouse movement gets disrupted by on player touch events. Having the character randomly stop when there's no reason to kills me.


But yes, it would be nice to have better mouse controls for LeTBS, but... not gonna happen.

Edit: Hey, anyway to modify movement or add notetags such as to allow entities to move through their allies, but not their enemies, ala Final Fantasy Tactics?
Oh, didn't notice that as I ended up turning off mouse input due to other reasons. Mouse movement gets disrupted by on player touch events. Having the character randomly stop when there's no reason to kills me.


But yes, it would be nice to have better mouse controls for LeTBS, but... not gonna happen.

Edit: Hey, anyway to modify movement or add notetags such as to allow entities to move through their allies, but not their enemies, ala Final Fantasy Tactics?
That should be perfectly doable.

Try this.

In LeTBS.js, find
TBSEntity.prototype.isPassable

Replace with
TBSEntity.prototype.isPassable = function () {
user = BattleManagerTBS.activeEntity().battler();
battler = this.battler();
if(LeUtilities.isAlly(user,battler)){
return battler.hasLeTBSTag("ally_passable");
}
return (this._battler.isDead() && this.isPassableOnDeath()) || this.battler().hasLeTBSTag("passable");
};
I added code that checks if the active entity, and the entity it checks passability for are allies.

Then under
DataManager.processLeTBSTagsForBattlers = function () {
add the check for ally_passable, you can just drop this under the else if for passable or passable_on_death

else if (line.match(/ally_passable/i))
obj.TagsLetbs.ally_passable = true;

Then between the <letbs> tags in the actor/enemy notebox, you should only need to add ally_passable
Thank you. The updated plugin is running fine, but allies with the notetag can't seem to pass each other.

Hopefully I didn't goof. Here are some copy pastes from my files:

Spoiler: LeTBS.js TBSEntity.prototype.isPassable function
JavaScript:
TBSEntity.prototype.isPassable = function () {
user = BattleManagerTBS.activeEntity().battler();
battler = this.battler();
if(LeUtilities.isAlly(user,battler)){
return battler.hasLeTBSTag("ally_passable");
}
return (this._battler.isDead() && this.isPassableOnDeath()) || this.battler().hasLeTBSTag("passable");
};

Spoiler: Tag Check
JavaScript:
DataManager.processLeTBSTagsForBattlers = function () {
    var groups = [$dataActors, $dataEnemies, $dataClasses];
    for (var i = 0; i < groups.length; i++) {
        var group = groups[i];
        for (var j = 1; j < group.length; j++) {
            var obj = group[j];
            var notedata = obj.note.split(/[\r\n]+/);
            var letbs = false;

            obj._leTbsCustomTags = {};
            obj.leTBS_Tags = {};

            obj.TagsLetbs.movePoints = Lecode.S_TBS.defaultMovePoints;
            obj.TagsLetbs.moveScope = Lecode.S_TBS.defaultMoveScope;
            obj.TagsLetbs.moveScopeOptions = "";
            obj.TagsLetbs.atkAnim = Lecode.S_TBS.defaultAttackAnimation;
            obj.TagsLetbs.atkScope = Lecode.S_TBS.defaultAttackScope;
            obj.TagsLetbs.atkAoe = Lecode.S_TBS.defaultAttackAoE;
            obj.TagsLetbs.atkSequenceData = Lecode.S_TBS.defaultAttackSequence;
            obj.TagsLetbs.oneTimeMove = Lecode.S_TBS.oneTimeMove;
            obj.TagsLetbs.oneTimeOffense = Lecode.S_TBS.oneTimeOffense;
            obj.TagsLetbs.collapseAnim = Lecode.S_TBS.collapseAnimation;
            obj.TagsLetbs.passOnAtkUse = false;
            obj.TagsLetbs.aiPattern = Lecode.S_TBS.defaultAiPattern;
            obj.TagsLetbs.passable = false;
            obj.TagsLetbs.passableOnDeath = false;
            obj.TagsLetbs.hasNoCorpse = false;
            obj.TagsLetbs.canStayOnMe = false;
            obj.TagsLetbs.canStayOnMeOnDeath = false;
            obj.TagsLetbs.collisionDmgBonus = 0;
            obj.TagsLetbs.collisionDmgBonusRate = 0;
            obj.TagsLetbs.collisionDmgReduction = 0;
            obj.TagsLetbs.collisionDmgReductionRate = 0;
            obj.TagsLetbs.immuneKnockback = false;
            obj.TagsLetbs.knockbackBonus = 0;
            obj.TagsLetbs.knockbackReduction = 0;
            obj.TagsLetbs.directionalDmgBonus = {
                front: 0,
                back: 0,
                side: 0
            };
            obj.TagsLetbs.directionalDmgReduction = {
                front: 0,
                back: 0,
                side: 0
            };
            obj.TagsLetbs.spriteName = null;
            obj.TagsLetbs.spriteConfig = null;
            obj.TagsLetbs.hideStatusWindow = false;
            obj.TagsLetbs.spriteScaleX = 1.0;
            obj.TagsLetbs.spriteScaleY = 1.0;
            obj.TagsLetbs.spriteTone = [0, 0, 0, 0];
            obj.TagsLetbs.spriteHue = 0;
            obj.TagsLetbs.loopAnimation = null;
            obj.TagsLetbs.aiNoAttack = false;
            obj.TagsLetbs.aiControl = false;
            obj.TagsLetbs.sequencesOverload = {};

            for (var k = 0; k < notedata.length; k++) {
                var line = notedata[k];
                if (line.match(/<letbs>/i)) {
                    letbs = true;
                    continue;
                } else if (line.match(/<\/letbs>/i))
                    letbs = false;

                if (letbs) {
                    if (line.match(/move_points\s?:\s?(.+)/i))
                        obj.TagsLetbs.movePoints = Number(RegExp.$1);
                    else if (line.match(/move_scope\s?:\s?(.+)/i))
                        obj.TagsLetbs.moveScope = String(RegExp.$1);
                    else if (line.match(/move_scope_options\s?:\s?((.|\n)*)/i))
                        obj.TagsLetbs.moveScopeOptions = String(RegExp.$1);
                    else if (line.match(/atk_anim\s?:\s?(.+)/i))
                        obj.TagsLetbs.atkAnim = Number(RegExp.$1);
                    else if (line.match(/atk_scope\s?:\s?(.+)/i))
                        obj.TagsLetbs.atkScope = String(RegExp.$1);
                    else if (line.match(/atk_aoe\s?:\s?(.+)/i))
                        obj.TagsLetbs.atkAoe = String(RegExp.$1);
                    else if (line.match(/atk_sequence\s?:\s?(.+)/i))
                        obj.TagsLetbs.atkSequence = String(RegExp.$1);
                    else if (line.match(/one_time_move/i))
                        obj.TagsLetbs.oneTimeMove = true;
                    else if (line.match(/one_time_offense/i))
                        obj.TagsLetbs.oneTimeOffense = true;
                    else if (line.match(/collapse_anim\s?:\s?(.+)/i))
                        obj.TagsLetbs.collapseAnim = Number(RegExp.$1);
                    else if (line.match(/pass_on_atk_use/i))
                        obj.TagsLetbs.passOnAtkUse = true;
                    else if (line.match(/ai_pattern\s?:\s?(.+)/i))
                        obj.TagsLetbs.aiPattern = String(RegExp.$1);
                    else if (line.match(/passable_on_death/i))
                        obj.TagsLetbs.passableOnDeath = true;
                    else if (line.match(/ally_passable/i))
                        obj.TagsLetbs.ally_passable = true;
                    else if (line.match(/passable/i))
                        obj.TagsLetbs.passable = true;
                    else if (line.match(/has_no_corpse/i))
                        obj.TagsLetbs.hasNoCorpse = true;
                    else if (line.match(/entities_can_stay_on_me/i))
                        obj.TagsLetbs.canStayOnMe = true;
                    else if (line.match(/entities_can_stay_on_me_on_death/i))
                        obj.TagsLetbs.canStayOnMeOnDeath = true;
                    else if (line.match(/collision_damage_bonus\s?:\s?(.+)/i))
                        obj.TagsLetbs.collisionDmgBonus = Number(RegExp.$1);
                    else if (line.match(/collision_damage_bonus\%\s?:\s?(.+)/i))
                        obj.TagsLetbs.collisionDmgBonusRate = Number(RegExp.$1);
                    else if (line.match(/collision_damage_reduction\s?:\s?(.+)/i))
                        obj.TagsLetbs.collisionDmgReduction = Number(RegExp.$1);
                    else if (line.match(/collision_damage_reduction\%\s?:\s?(.+)/i))
                        obj.TagsLetbs.collisionDmgReductionRate = Number(RegExp.$1);
                    else if (line.match(/immune_knockback/i))
                        obj.TagsLetbs.immuneKnockback = true;
                    else if (line.match(/knockback_bonus\s?:\s?(.+)/i))
                        obj.TagsLetbs.knockbackBonus = Number(RegExp.$1);
                    else if (line.match(/knockback_reduction\s?:\s?(.+)/i))
                        obj.TagsLetbs.knockbackReduction = Number(RegExp.$1);
                    else if (line.match(/back_dmg_bonus\s?:\s?(.+)/i))
                        obj.TagsLetbs.directionalDmgBonus.back = Number(RegExp.$1);
                    else if (line.match(/back_dmg_reduction\s?:\s?(.+)/i))
                        obj.TagsLetbs.directionalDmgReduction.back = Number(RegExp.$1);
                    else if (line.match(/front_dmg_bonus\s?:\s?(.+)/i))
                        obj.TagsLetbs.directionalDmgBonus.front = Number(RegExp.$1);
                    else if (line.match(/front_dmg_reduction\s?:\s?(.+)/i))
                        obj.TagsLetbs.directionalDmgReduction.front = Number(RegExp.$1);
                    else if (line.match(/side_dmg_bonus\s?:\s?(.+)/i))
                        obj.TagsLetbs.directionalDmgBonus.side = Number(RegExp.$1);
                    else if (line.match(/side_dmg_reduction\s?:\s?(.+)/i))
                        obj.TagsLetbs.directionalDmgReduction.side = Number(RegExp.$1);
                    else if (line.match(/sprite_name\s?:\s?(.+)/i))
                        obj.TagsLetbs.spriteName = String(RegExp.$1);
                    else if (line.match(/sprite_config\s?:\s?(.+)/i))
                        obj.TagsLetbs.spriteConfig = String(RegExp.$1);
                    else if (line.match(/hide_status_window/i))
                        obj.TagsLetbs.hideStatusWindow = true;
                    else if (line.match(/sprite_scale\s?:\s?(.+)/i)) {
                        var str = RegExp.$1.split(",");
                        obj.TagsLetbs.spriteScaleX = Number(str[0].trim());
                        obj.TagsLetbs.spriteScaleY = Number(str[1].trim());
                    }
                    else if (line.match(/sprite_tone\s?:\s?(.+)/i)) {
                        var str = RegExp.$1.split(",");
                        var r = Number(str[0].trim());
                        var g = Number(str[1].trim());
                        var b = Number(str[1].trim());
                        var gray = Number(str[1].trim());
                        obj.TagsLetbs.spriteTone = [r, g, b, gray];
                    }
                    else if (line.match(/sprite_hue\s?:\s?(.+)/i))
                        obj.TagsLetbs.spriteHue = Number(RegExp.$1);
                    else if (line.match(/loop_animation\s?:\s?(.+)/i))
                        obj.TagsLetbs.loopAnimation = Number(RegExp.$1);
                    else if (line.match(/ai_no_attack/i))
                        obj.TagsLetbs.aiNoAttack = true;
                    else if (line.match(/ai_control/i))
                        obj.TagsLetbs.aiControl = true;
                    else if (line.match(/sequence\((.+)\)\s?:\s?(.+)/i))
                        obj.TagsLetbs.sequencesOverload[RegExp.$1] = RegExp.$2;

                    else if (line.match(/(.+)\s?:\s?(.+)/i)) {
                        obj._leTbsCustomTags[RegExp.$1] = RegExp.$2;
                    }
                }
            }
        }
    }
};

Spoiler: Actor Note Tags
<letbs_sprite>

pose(idle): _idle, 1

pose(move): _move, 3

pose(cast): _cast, 3

pose(charge): _cast, 3

pose(atk): _atk, 3

pose(hit): _hit, 1

pose(dead): _dead, 1

turn_order: auto

status_sprite: auto

</letbs_sprite>



<letbs>

ally_passable

move_points: 4

passable_on_death

</letbs>
Try starting a new game
It looks like the function that processes tags only runs when "new game" is selected.
This also fixed the earlier issue with "seethru"
1590582212172.png
1590582288807.png
Is there a way to give attacks a +Hit% bonus if attacking from the side or back? (e.g. +5% & +10% respectively)
Is there a way to give attacks a +Hit% bonus if attacking from the side or back? (e.g. +5% & +10 respectively)
What I did was Create 2 states, Making sure they expire after 1 turn (important)

Then in LeTBS.js
find: BattleManagerTBS.prepareDirectionalDamageBonus

Replace the function with this (The bold lines are the additions I made)
Basically what this does is adds a state to the entity making the attack (its why 1 turn is important) and takes effect before the attack. What the 1 turn does, is it applies right before the entity attacks, then after their turn, it removes them (bc the state expired)
I also added code to handle multi-attacks (phantom slash).
So if you make a move that hits from behind, then the front, it'll remove the side/back states from the entity because you don't want that bonus if you hit them from the front.

Just replace state 115 with the state you want for Back Attack, and replace 116 with the one for Side Attack and 117 with the state for front attack. If you don't want to use front attack, just put in the id for an empty state and it won't apply any effects.


BattleManagerTBS.prepareDirectionalDamageBonus = function (user, targets, item) {
var oldUserDir = user.getDir();
for (var i = 0; i < targets.length; i++) {
var entity = targets;
if (entity === user) continue;
var dir = entity.getDir();
var effects = 0;
user.lookAt(entity.getCell());
if (user.getDir() === dir) {
//Back Attack, Add state for back attack, remove state for side/front attack:
user.battler().removeState(116);
user.battler().removeState(117);
user.battler().addState(115);

effects = Lecode.S_TBS.backDirectionalDamageEffects * 0.01;
effects += user.getDirectionalDmgBonus("back", item);
effects -= entity.getDirectionalDmgReduction("back", item);
} else if (user.getDir() === 2 && dir === 8 || user.getDir() === 8 && dir === 2 ||
user.getDir() === 4 && dir === 6 || user.getDir() === 6 && dir === 4) {
//frontAttack, remove state for back and side attack:
user.battler().removeState(115);
user.battler().removeState(116);
user.battler().addState(117);

effects = Lecode.S_TBS.frontDirectionalDamageEffects * 0.01;
effects += user.getDirectionalDmgBonus("front", item);
effects -= entity.getDirectionalDmgReduction("front", item);
} else {
//Side Attack, Add state for side attack, remove state for back/front attack:
user.battler().removeState(115);
user.battler().removeState(117);
user.battler().addState(116);

effects = Lecode.S_TBS.sideDirectionalDamageEffects * 0.01;
effects += user.getDirectionalDmgBonus("side", item);
effects -= entity.getDirectionalDmgReduction("side", item);
}
entity.battler().leTBS_setDirectionalDmgEffects(effects);
}
user.setDir(oldUserDir);
};

As an example:
Back attack without state
1590674796780.png


With the state:
(used 1000% attack bonus for dramatic effect)
1590674877334.png
Whenever I start a battle I get this type error " cannot read property 'addChild' undefined"
i have no idea what I'm doing wrong.
Whenever I start a battle I get this type error " cannot read property 'addChild' undefined"
i have no idea what I'm doing wrong.
Can you post the console output?
Awesome! That's exactly what I needed, thanks!!
Can you post the console output?




LeTBS_TimelineControl.js:462 Uncaught ReferenceError: Window_TBSEntityTurn is not defined
at LeTBS_TimelineControl.js:462
pixi.js:27682
PixiJS 4.5.4 - ✰ WebGL ✰ http://www.pixijs.com/ ♥♥♥


rpg_managers.js:1949 TypeError: Cannot read property 'addChild' of undefined
at Scene_Battle.setMovableWindows (LeTBS_ScanCommand.js:468)
at Scene_Battle.start (LeTBS.js:919)
at Scene_Battle.start (LeTBS_AutoBattle.js:98)
at Scene_Battle.start (LeTBS_TacticalMode.js:72)
at Scene_Battle.start (LeTBS_WinConditions.js:116)
at Function.SceneManager.updateScene (rpg_managers.js:2019)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)
SceneManager.catchException @ rpg_managers.js:1949


I think this was what you were asking for. thank you for helping!
LeTBS_TimelineControl.js:462 Uncaught ReferenceError: Window_TBSEntityTurn is not defined
at LeTBS_TimelineControl.js:462
pixi.js:27682
PixiJS 4.5.4 - ✰ WebGL ✰ http://www.pixijs.com/ ♥♥♥


rpg_managers.js:1949 TypeError: Cannot read property 'addChild' of undefined
at Scene_Battle.setMovableWindows (LeTBS_ScanCommand.js:468)
at Scene_Battle.start (LeTBS.js:919)
at Scene_Battle.start (LeTBS_AutoBattle.js:98)
at Scene_Battle.start (LeTBS_TacticalMode.js:72)
at Scene_Battle.start (LeTBS_WinConditions.js:116)
at Function.SceneManager.updateScene (rpg_managers.js:2019)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)
SceneManager.catchException @ rpg_managers.js:1949


I think this was what you were asking for. thank you for helping!

Are you using the earlier posted demo? or copy/paste the scripts?
You should make sure they are in the right order.
Are you using the earlier posted demo? or copy/paste the scripts?
You should make sure they are in the right order.

ii got it from the demo i thought it was updated.
i wouldn't be surprised if they are out of order it wouldn't be the first time i messed up something that simple. you wouldn't happen to know what order they should be in?
ii got it from the demo i thought it was updated.
i wouldn't be surprised if they are out of order it wouldn't be the first time i messed up something that simple. you wouldn't happen to know what order they should be in?

The correct order should be the order in the demo project.
The correct order should be the order in the demo project.
that's the order i put it in. so now i definitely don't know what I'm doing wrong.
that's the order i put it in. so now i definitely don't know what I'm doing wrong.

Can you show us the events you set up? and the actor and enemy database items.
Maybe you didn't configure something. Its hard to tell at times.

Worst case, you can send your project and I can take a look when I have time.
I noticed in the documentation for .8 that there are notetags for overlays, hues, opacity, and a lot of other goodies regarding sprites. Is that new stuff for the next release, or is it baked into the current release and just not documented/finished?

All that stuff looks amazing and would solve a lot of my problems, but it doesn't look like .8 is going to be coming out any time soon if ever and I'd love to have access to that if at all possible.

Also, @Pharonix would it be possible to configure a true dual wield with a sequence? I know how to make a multi-hit with a sequence, but is there a way to only look at the properties of one weapon at a time for each hit?
hello guys how are u doing? just wanna ask if how can i create my own personalize skill in LeTBS gameplay? i do have now the samples of their work and one skill caught my attention and that is the phantom slash
which the effect is, the hero will hit the target from the distance and it appears at the back of the target but when i check the note tags of the phatom slash and it only says
<letbs>

scope: line(4)

sequence: phantom_slash

</letbs>



<letbs_AI>

type: offense

</letbs_AI>

so im confused
how does the actor appears at the targets back? thank u in advance for those who will gonna answer this question !
i really wanna make my own skill so
it will be a big help for me if i learn how to understand whats going on ^_^
hello guys how are u doing? just wanna ask if how can i create my own personalize skill in LeTBS gameplay? i do have now the samples of their work and one skill caught my attention and that is the phantom slash
which the effect is, the hero will hit the target from the distance and it appears at the back of the target but when i check the note tags of the phatom slash and it only says
<letbs>

scope: line(4)

sequence: phantom_slash

</letbs>



<letbs_AI>

type: offense

</letbs_AI>

so im confused
how does the actor appears at the targets back? thank u in advance for those who will gonna answer this question !
i really wanna make my own skill so
it will be a big help for me if i learn how to understand whats going on ^_^


So when skills get a bit more complicated than "aim and fire" it can be complicated to put all the information in a notetag.

Instead, there is a separate js file used by the plugin which it references. It's known as letbsconfig and is located with all your other plugins. Once you open it up you will see that there is a lot of information that references the document from summons to tile marks. What you want is the sequences.

Go down to the sequences and you will find phantom_slash in there. That is what the notetag "sequence: phantom_slash" was referencing.

Right underneath phantom_slash will be a list of commands. I don't have my computer in front of me but it will have things like: "wait: 20" and "move_to" and the like. Each command will be executed in order and that is how you get special skills. take a look at a few of them to get a feel for how they work, and if at all possible base your new skill off an already created skill that is similar.

There is also some information in the old documents that tells the different commands you can give and what they do.

Hope that helps!
Hey guys i tried starting fresh just to see if it was that.
now it saying
"cannot read property "position" of Undefined"

this was the out put

rpg_managers.js:1949 TypeError: Cannot read property 'position' of undefined
at Sprite_TBSEntityAnimation.updatePosition (LeTBS.js:1155)
at Sprite_TBSEntityAnimation.setup (LeTBS.js:1151)
at TBSEntity_Sprite.newAnimation (LeTBS.js:9990)
at TBSEntity.newAnimation (LeTBS.js:9637)
at Function.BattleManagerTBS.placeNextEnemy (LeTBS.js:2434)
at Function.BattleManagerTBS.processEnemyPositioning (LeTBS.js:2411)
at Function.BattleManagerTBS.processPositioningPhase (LeTBS.js:2253)
at Function.BattleManagerTBS.startBattle (LeTBS.js:1898)
at Scene_Battle.start (LeTBS.js:1218)
at Scene_Battle.start (LeTBS_AutoBattle.js:113)
SceneManager.catchException @ rpg_managers.js:1949
4Window2.png Failed to load resource: net::ERR_FILE_NOT_FOUND

Absolutely any help is appreciated. clearly I'm doing something wrong, i just don't know what that is.
Hey guys i tried starting fresh just to see if it was that.
now it saying
"cannot read property "position" of Undefined"

this was the out put

rpg_managers.js:1949 TypeError: Cannot read property 'position' of undefined
at Sprite_TBSEntityAnimation.updatePosition (LeTBS.js:1155)
at Sprite_TBSEntityAnimation.setup (LeTBS.js:1151)
at TBSEntity_Sprite.newAnimation (LeTBS.js:9990)
at TBSEntity.newAnimation (LeTBS.js:9637)
at Function.BattleManagerTBS.placeNextEnemy (LeTBS.js:2434)
at Function.BattleManagerTBS.processEnemyPositioning (LeTBS.js:2411)
at Function.BattleManagerTBS.processPositioningPhase (LeTBS.js:2253)
at Function.BattleManagerTBS.startBattle (LeTBS.js:1898)
at Scene_Battle.start (LeTBS.js:1218)
at Scene_Battle.start (LeTBS_AutoBattle.js:113)
SceneManager.catchException @ rpg_managers.js:1949
4Window2.png Failed to load resource: net::ERR_FILE_NOT_FOUND

Absolutely any help is appreciated. clearly I'm doing something wrong, i just don't know what that is.
Did you copy the letbs img folder
Also it seems like you didnt copy window2.png from the demo

Original thread: https://forums.rpgmakerweb.com/threads/lecode-tactical-battle-system-0-77-2b.71572/