Lecode Tactical Battle System 0.77.2B

Unfortunately no. My best guess looking at the code is that the plugin sets the location of the enemy and actor starting square to be the same as the events when the game is launched or when the room is loaded, and so moving the events does nothing. I linked a video I made showing the results of trying that method.
ok i guess that happens when the gameplayer moves to the map or when the map is loaded..

edit.
well i downloaded the lecode demo and tried a bit also looked into the console, but i coudnt figure it out sry.
Hi everyone, I'm looking to hire a programmer to fix some quirks of this system and revamp the UI a bit. Rates are negotiable, experience with LeTBS obviously very important.

Send me a message if you're interested.
*Update
Figured it out. Downloaded Notepad++ It confirmed my suspicion that my previous if statement had no baring on the later statement.

I sometimes have the bad habit of thinking of JavaScript conditional ladders the same way RPG MAKER handles it. You manually have to end deeper processes or it will get caught in an if else loop.

Since the original If bracket didn't apply to my condition to test variables i merely added it in with a &&.

so now the new line of code reads
if: $gameVariables.value(245) > x && SceneManager._scene._QTEWindow.getResult()=='success'",

1670879402962.png


Anyone Know where I went wrong? Got the chains to work( I.E calls next sequence if QTE is successful)

However the next sequence runs even if the player misses the QTE, I fear i have ordered the syntax wrong in my else statements. Any advice.

For context I would like:

QTE -> Pass/Fail Check -> IF Fail stop sequence -> IF Success Do damage -> IF Success has been done & Variable x = 2 -> Next Sequence

@Firestorm Did you ever find a solution to the problem with counter attacks using the wrong battler's stats? I ran into it a while back and just kind of gave up on trying to fix it.​

Hello. I tried to use Skill Mastery Levels (YEP) and LeTBS plugins. And they almost work. Visually everything is correct and there are no errors. However, the Yang plugin itself does not work (Skills do not get new levels). Maybe somebody knows how to fix it?
I'm not confident anyone has fixed this error yet as I could not find anything about it in the thread, but I am going to ask anyways as this is something that I think all of us could benefit from if corrected.

Solved!

Spoiler: Problem
When you are given the scope selection after choosing an action from the command menu during battle, when moving the selector to different tiles (specifically the colored selection tiles in different directions that show your attack's range), your character sprite will change directions for what appears to be a single frame, then change back to the direction you were originally facing. This is fairly subtle but if you are paying attention and have different idle poses per direction, you will see your character turn facing left/right/etc., for a single frame then back to the direction you were set at.

While this isn't game breaking, it is unsightly for any game set to be actually released and played. I have an idea that this is caused from the engine performing a "preview" sequence of some sort, but this is just a guess really. I can't think of any other reason why the sprite direction would change for just a single frame, outside of a misplaced update sprite piece of code, which shouldn't occur when using the scope selection anyways. I do think the code can be found in LeTBS.js which is what I am going through right now line by line.

I do not notice any direction changing when using the movement scope or scan scope, so possibly the code which governs these can be copy/pasted over the action scope as to not update the sprite. Any assistance or pointers for anyone who has delved into the code would be greatly appreciated. Is there a way I can print all processed code in the console to see which line of the .js is called during this scope selection phase?

---

One update on the shifting sprite issue, I have noticed this also happens when scrolling through different skills in the command menu, and both can be prevented when deleting references to this.actionScope, such as the following line in LeTBS.js

Code:
BattleManagerTBS.isActionScopeAvailable = function () {
    return this.actionScope() && this.actionScope().cells && this.actionScope().center;
};

Unfortunately this also prevents the player from selecting any target panels as well. Currently going through all references to actionScope to see if there is a way work around this or modify it's function.
------


Got a fix!

Arguably better but I think it seems more polished this way. Find the following code in LeTBS.js around line 8985:

Spoiler: code
Code:
TBSEntity.prototype.getDirectionTo = function (cell) {
    var oldDir = this.getDir();
    this.lookAt(cell);
    var dir = this.getDir();
    this.setDir(oldDir);
    return dir;
};

Deleting this.setDir(oldDir); will now make your character face whichever direction your selection is. This is actually how this worked before, however the code would immediately revert your direction back after a quick single frame glance, which just looked unsightly imo. Another fix, if you do not use directional AOE scopes or attacks, you can delete this.lookAt(cell); instead, which will prevent both the 1 frame turn as well as a new directional frame when previewing an attack, however your attacks/scopes will not update their directional instructions, instead using the direction you were facing before selection. This could be useful for an enemy that cannot easily turn such as a tank or ship, forcing them to move into position before attacking in a given direction.

I am going to test the first fix out and see if this causes any issues, but so far it seems to work fine, except for reverting to the downward direction when cancelling out of the attack command. The only downside aside from turning to face the direction of your cursor cell is that the AI will turn and face different directions as it is running through its logic for an attack. This is kind of neat however and makes the enemy characters look alive, as if they are examining the battlefield before performing an action.

I think if this.lookAt(cell); was instead replaced with logic that determines if the cell x/y is either in the positive or negative, the originally functionality could be retained without the quick facing character shift. I am going to put that off until later but shouldn't be too terribly difficult provided the correct syntax is used. There may already be such syntax in LeTBS.js somewhere.

One more fix, to prevent the character from looking back to the default downward position when cancelling out of the action scope selection, delete this line from the below code in LeTBS.js. This works for both the enabled and disabled preview scope setting.

dir: entity.getDirectionTo(center),

Spoiler: code
Code:
BattleManagerTBS.makeObjScopeParam = function (obj, entity, center) {
    obj = obj || this.activeAction().item();
    var param = {
        user: entity,
        dir: entity.getDirectionTo(center),
        need_check_los: true,
        exclude_center: true,
        line_of_sight: true,
        remove_nonvisibleCells: false,
        select: obj ? obj.TagsLetbs.scopeSelect : null
    };
    if (!obj) return param;
    var data = obj.TagsLetbs.scopeOptions;
    data = LeUtilities.stringSplit(data, ",");
    data.forEach(function (arg) {
        if (arg.match(/include_center/i))
            param.exclude_center = false;
        else if (arg.match(/through_obstacles/i))
            param.line_of_sight = false;
        else if (arg.match(/need_free_cell/i))
            param.need_free_cell = true;
    }.bind(this));
    return param;
};

More info and ways to customize a characters directional inputs for scopes and attacks can be found here in a post by UtopiaBlue: https://forums.rpgmakerweb.com/inde...ical-battle-system-0-77-2b.71572/post-1043168

-

Also, for anyone looking to change the movement panel selection options, it is currently set to only update once per keypress. Needless to say this can be quite tiring on the fingers. Changing lines 1709-1715 (or about this area) in LeTBS.js from Input.IsPressed to Input.IsRepeated will set this to adjust based on both a single keypress as well as a held keypress with a slight (6 frame?) delay.
Spoiler: code
if (Input.isRepeated("right")) this.processCallback("Right"); if (Input.isRepeated("down")) this.processCallback("Down"); if (Input.isRepeated("left")) this.processCallback("Left"); if (Input.isRepeated("up")) this.processCallback("Up");

Small QoL changes, but stuff that makes the end user experience better can go a long way imo.
1.png
2.png

I added a new skill category. How should I add an icon?thank
View attachment 252035View attachment 252036
I added a new skill category. How should I add an icon?thank
added \i[xx] before the word?
Has anyone had any success changing the z axis layer of animations during battle? The following code works outside of the battle scene, but not inside of it.


Spoiler
Code:
var animation_position = Sprite_Animation.prototype.updatePosition;
Sprite_Animation.prototype.updatePosition = function() {
    animation_position.call(this)
    if (this._animation.name.contains("TPZH")) {
        this.z = -1;
    } else {
        this.z = 8;
    }
};

I swapped it to the following but still no luck.

Spoiler
Code:
var animation_position = Sprite_TBSAnimation.prototype.updatePosition;
Sprite_TBSAnimation.prototype.updatePosition = function() {
    animation_position.call(this)
    if (this._animation.name.contains("TPZH")) {
        this.z = -1;
    } else {
        this.z = 8;
    }
};

I was planning on just using sprites for attack animations, but the amount of sheets required will run in the thousands with 40~ jobs and 50~ different weapons. Much more economical to use animations instead while keeping all sprites in the same format. Working great for down/left/right, but for attacking up the only solution is for the animation to be played below the sprite layer.

Lines 800-840 in LeTBS.js has what looks to be a section for changing layer priority, however the animation tab does not appear to adjust animations accordingly. Any assistance would be greatly appreciated.

Spoiler
Code:
Spriteset_BattleTBS.prototype.createBattleLayers = function () {
    //-Scopes
    this._scopesLayer = new TBSScopeLayer();
    this._scopesLayer.z = 1;
    this._tilemap.addChild(this._scopesLayer);
    this._scopesLayer.createSelectionLayer();
    this._tbsLayer.addChild(this._scopesLayer._selectionLayer);
    //-Ground entities
    this._groundEntitiesLayer = new Sprite();
    this._groundEntitiesLayer.z = 1;
    this._tilemap.addChild(this._groundEntitiesLayer);
    //-Ground
    this._groundLayer = new Sprite();
    this._groundLayer.z = 2;
    this._tbsLayer.addChild(this._groundLayer);
   //-Battlers
    this._battlersLayer = new Sprite();
    this._battlersLayer.z = 4;
    this._tilemap.addChild(this._battlersLayer);
    //-Animations
    this._animationsLayer = new TBSMapAnimation();
    this._animationsLayer.z = 4;
    this._tbsLayer.addChild(this._animationsLayer);
    //-Movable Info
    this._movableInfoLayer = new Sprite();
    this._movableInfoLayer.z = 6;
    this.addChild(this._movableInfoLayer);
    //-Movable Windows
    this._movableWindowsLayer = new Sprite();
    this._movableWindowsLayer.z = 6;
    this.addChild(this._movableWindowsLayer);
    //-Fixed Info
    this._fixedInfoLayer = new Sprite();
    this._fixedInfoLayer.z = 6;
    this.addChild(this._fixedInfoLayer);
    //-Debug
    var bitmap = new Bitmap(Graphics.width, Graphics.height);
    this._debugLayer = new Sprite(bitmap);
    this._debugLayer.z = 7;
    this._tbsLayer.addChild(this._debugLayer);
};
added \i[xx] before the word?
The attempt failed. Can you elaborate?
You just need to include the number associated with the icon in the notebox for the character you are adding the skill category to, see here: https://lecodemv.github.io/leTBS/old/commands.html

You can find the id for each icon under the States category in the Database, simply click the box labeled icons to display them.


1675415449066.png
The attempt failed. Can you elaborate?
this is from demo?
can you check.. is posible related to image position like
some image named icon001.png and is fire (cmiiw)
this is from demo?
can you check.. is posible related to image position like
some image named icon001.png and is fire (cmiiw)
I am stupid. What is the correct input method?
QQ图片20230205161755.png
You just need to include the number associated with the icon in the notebox for the character you are adding the skill category to, see here: https://lecodemv.github.io/leTBS/old/commands.html

You can find the id for each icon under the States category in the Database, simply click the box labeled icons to display them.


View attachment 252368
Sorry, I don't know script language, and there are moving words in it?
Dunno if this work
I am stupid. What is the correct input method?
View attachment 252540
sry.. Kinda reply other and forgot about this
Spoiler: edit on plugins
9gl0DKAvoG.jpg
64, .... is icon from system/iconset.png
64 at this are fire icon
KnfRJmPIyW.jpg
the type
01 -> icon 64
02 -> 79
03 -> 80
sagsa.jpg
left top count as 0.. mean 65 is fire below .. this icon is cut not full btw
Spoiler: plugins demo my version
5yzMr835t0.jpg
use icon fire (64).. for support (80)
gIIo01XoTI.jpg
1T9xtnxkEI.jpg
other taken from skill
Dunno if this work

sry.. Kinda reply other and forgot about this
Spoiler: edit on plugins
View attachment 252542
64, .... is icon from system/iconset.png
64 at this are fire icon
View attachment 252541
the type
01 -> icon 64
02 -> 79
03 -> 80
View attachment 252543
left top count as 0.. mean 65 is fire below .. this icon is cut not full btw
Spoiler: plugins demo my version
View attachment 252546
use icon fire (64).. for support (80)
View attachment 252545
View attachment 252544
other taken from skill
Thank you for your detailed explanation, I understand! Thanks again!
Thank you for your detailed explanation, I understand! Thanks again!
Your welcome.
can you provide us with the last result..
The output you wanted is correct?
Anybody know how to allow multiple/additional skill uses from enemies?

Like: Enemy uses skill1 -> enemy uses skill2.

@Firestorm Did you ever find a solution to the problem with counter attacks using the wrong battler's stats? I ran into it a while back and just kind of gave up on trying to fix it.​


Try this (https://forums.rpgmakerweb.com/inde...tical-battle-system-0-77-2b.71572/post-904823), just tested and it seems to have fixed the issue. Combining with @Pharonix counter plugin and Yanfly counter control should add in a lot of new possibilities. @Frostorm I believe you were also looking for this.


Anybody know how to allow multiple/additional skill uses from enemies?

Like: Enemy uses skill1 -> enemy uses skill2.

I think this may be close to what you are looking for: https://forums.rpgmakerweb.com/inde...ical-battle-system-0-77-2b.71572/post-1285293


What I am wondering currently is how viable would it be to encourage enemies to prioritize attacking from the sides or the back. In theory this should be possible using a combination of x/y positions from attacker vs target with user.getDir(), but as far as actually implementing it, I honestly have no idea where to start.
Hi everyone, is there a way to set variables to the following?

1. current turn active battler ID
2. battler ID where the cursor cell is currently at
3. a skills target battler ID

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