Lecode Tactical Battle System 0.77.2B

Does using <Enemy Cell: index> instead of <Enemy Cell> work for you guys? I tried to set up a 2 enemy troop with <Enemy Cell: 0> & <Enemy Cell: 1> but it doesn't seem to have any effect. The monsters still randomly appear in either cell. So half the time they are in the wrong cell. Basically, the player will see a Spearman and a Defender on the field (visible encounters), but once you engage them, the 2 will sometimes switch spots!

View attachment 217233
View attachment 217232

So I went and took a look at the code in LeTBS.js...
JavaScript:
BattleManagerTBS.createStartCells = function () {
    this.getLayer("scopes").clear();
    this._startCells = [];
    $gameMap.events().forEach(function (eventObj) {
        var x = eventObj.x;
        var y = eventObj.y;
        var note = eventObj.event().note;
        var data = {};
        if (note.match(/<Enemy Cell>/i)) {
            data.type = "enemy";
        } else if (note.match(/<Enemy Cell\s?:\s?(.+)>/i)) {
            data.type = "enemy";
            data.fixed = Number(RegExp.$1);
        } else if (note.match(/<Actor Cell>/i)) {
            data.type = "actor";
        } else if (note.match(/<Actor Cell\s?:\s?(.+)>/i)) {
            data.type = "actor";
            data.fixed = Number(RegExp.$1);
        }
        if (data.type) {
            var cell = new TBSCell(x, y);
            cell._event = eventObj.event();
            cell._positioningData = data;
            this.createPositioningCell(data.type, x, y, cell);
            this._startCells.push(cell);
            if (!this._entitiesEvents[x])
                this._entitiesEvents[x] = {};
            this._entitiesEvents[x][y] = eventObj;
        }
    }.bind(this));
};
Looks like it sets data.fixed to equal w/e index # you put in the event's note. But then it doesn't seem to do anything with data.fixed! So that explains why I'm not seeing any difference using <Enemy Cell: index> vs <Enemy Cell>. Idk what to do...please HALP!
This one is easy. Go to this function in LeTBS.js:

BattleManagerTBS.placeNextEnemy = function () {
var enemy = this._enemiesToPositionate.shift();
var cells = this.enemyStartCells().filter(function (c) {
return c._positioningData.fixed === enemy.index() + 1 && this.isCellFree(c);
}.bind(this));
if (cells.length === 0) {
cells = this.enemyStartCells().filter(function (c) {
return this.isCellFree(c);
}.bind(this));
}
var cell = LeUtilities.getRandomValueInArray(cells);
if (cell) {
cell.select();
this.centerActiveCell();
this.updateCursor();
var entity = new TBSEntity(enemy, this.getLayer("battlers"));
entity.setCell(cell);
entity.newAnimation(Lecode.S_TBS.placedBattlerAnim, false, 0);
this._battlerEntities.push(entity);
}
};

It keeps adding 1 to the index so it will never match up.
On the line that I marked in blue, delete the + 1 after enemy.index() . so it looks like this:

return c._positioningData.fixed === enemy.index() && this.isCellFree(c);

Now it works fine.
A little update...

After some play testing I found that enemies who don't have a cell assigned to them could take over another enemy's cell if their index is before theirs.
To fix that just go to the line that I marked in orange and change it to this:

return this.isCellFree(c) && !c._positioningData.fixed;

That should fix everything.
Hello everyone. I am most likely missing somthing very simple but I cant seem to get the enemy to cast a state on itself whenever it doesn't have that state. I apologize if this has been answered somewhere already. Thank you in advance for the help
Have you tried this?
JavaScript:
<letbs_AI>
type: support
</letbs_AI>
<letbs>

scope: circle(4)
scope_options: include_center
</letbs>

<letbs_AI>
type: support
</letbs_AI>

<Cooldown: 4>

I have that in the skill note tag. Is that in the right place?
It's definitely in the right place. But I can't think of a simple solution for you. Does the enemy cast the skill at all?
sorry for the slow response. They do not cast the skill at all. I only seem to have this problem with support skills
<letbs>

scope: circle(4)
scope_options: include_center
</letbs>

<letbs_AI>
type: support
</letbs_AI>

<Cooldown: 4>

I have that in the skill note tag. Is that in the right place?
Ladies and gentlemen, I encountered a problem when using the latest version of 0.772b. If I use the computer keyboard, there will be no error. If I use the mouse to click the battle position preparation, if the two character positions are superimposed together, an error will be reported, because this will happen when I exchange positions between teammates. This will not happen when I use the keyboard. It will only happen when I click the mouse, Have you met? How to solve this problem?

QQ截图20220324102924.png
QQ截图20220324102955.png
How can I modify this plot to become the picture material I want?

QQ截图20220324202701.png


Turn_Actor.png
Turn_Enemy.png
Does enemy AI not work for player targeted attacks/spells (for example debuffs) when specified as support?

I have enemy AI working correctly for curing status ailments for itself and allies:
Code:
<letbs_AI>
type: support
use_condition: b.isStateAffected(14)
</letbs_AI>
but when the skill scope and LeTBS scope is switched to target the player team there is no action performed, even if the use_condition is removed.

Setting enemy AI to offense does allow the enemy to perform the attack, however the use_condition does not seem to have any influence on the behavior of the AI:
Code:
<letbs_AI>
type: offense
use_condition: b.isStateAffected(100)
</letbs_AI>

Additionally, I did have to change some code to make support skills work in the first place, perhaps there are more lines in the plugin code that need to be replaced in order to have the support skills work correctly? Or is it instead that support skills were never intended to also include debuffs, and that offensive skills cannot be logic gated.

Any input would be much appreciated.


Edit:

I seemed to have fixed the issue, not sure if it was simply changing support/offense to offense, support, or rather if it was a problem upstream (most likely), but this is the current code I have that is working:


Code:
<letbs_AI>
type: offense, support
use_condition: b.isStateAffected(100)
</letbs_AI>
<Cooldown: 1>

Excellent mod and I am happy to see it is still being supported by the community. This thread has answered pretty much every question I have had. Looking forward to see how far I can push it!
Amazing script, been using it for a good year by now!
Just asking about a potential issue; I am currently developing a mecha-style game where the player can customise and swap parts to increase the mechs stats and whatnot. However, I am looking for a way to change the apperance of the mech by overlaying a basic frame with all the sprites of the unique parts (smaller images overlaying a frame.)
Wondering if there is any way to do this in LeTBS? I see no way on the github guide page to do this, (I am using 0.77.2B,) and drawing out all the unique combinations of sprites would be too arduous of a task to commission, due to the amount of unique combinations.
Thank you! 🙂
I gotta say, Im glad this is still an active thread

I've been in a bad place the last couple years but am looking to finally finish my project using this battle system
Might not stay as active but Hopefully I'm back.
I have alot to re learn about this and all my crazy custom addons

Gonna be interesting
Welcome back, Pharonix!

Searching through this thread, your posts came up quite often and contain some of the most valuable insights into using and customizing this battle system. Were you ever able to successfully modify the turn based system into one based on character speed? I was looking into this subject heavily the other day, but I think it is a bit outside of my scope.

I am sorry you have been going through some difficult times in life, but I do find from my own personal experiences, that it is these times which can define us and help us learn who we really are, and what we are capable of.

I think a member here or two were eagerly awaiting your return. I for one am thrilled that the resident expert in LeTBS is back.

I will be looking forward to your future posts and game project.
Welcome back, Pharonix!

Searching through this thread, your posts came up quite often and contain some of the most valuable insights into using and customizing this battle system. Were you ever able to successfully modify the turn based system into one based on character speed? I was looking into this subject heavily the other day, but I think it is a bit outside of my scope.

I am sorry you have been going through some difficult times in life, but I do find from my own personal experiences, that it is these times which can define us and help us learn who we really are, and what we are capable of.

I think a member here or two were eagerly awaiting your return. I for one am thrilled that the resident expert in LeTBS is back.

I will be looking forward to your future posts and game project.
From what I recall, Type 1 is the one that indiscriminately sorts on AGI.

I was actually in the middle of making an initiative based system that was based on movement and agility, where holding your move/action would enable you to act faster the next turn.
each turn you lose 10 initiative, and add your unused action points.
Turns out, it was very unbalanced,
Type 1 in the PHX_LeTBS plugin? I wasn't aware this was included, I will definitely have to investigate this as I much prefer an AGI or whatever stat based turn order (that allows characters to act multiple times if fast enough compared to slower characters, similar to FFT).

I wasn't sure if such a thing was within my capabilities, so I kind of worked around it and ended up just scripting skills such as the Archer's "Charge" ability to instead gain a passive bonus for every movement point not used. I think I kind of like this better than the vanilla "Charge" actually!

Something else I feel many could benefit from, is that the decelerate skill was not working out of the box for the LeTBS demo, but upon some digging I found this was simply due to a typo. In the LeTBS_TimeLineControl.JS script, decelerateTurn is spelled with 2 c's, as in deccelerate. Removing the extra c and tagging a skill with "decelerate_turn: 100%" has fixed this issue, and can go a long way for "stun" type skills.

Honestly I am very surprised at how much progress I have made adding skills, customizing AI, and configuring the system in general. I have never had close to this much progress on an rpgmaker project before, and it is pretty comfy to say the least to see things progress and evolve.

Unfortunately, I only am on Class 3 out of 33 total classes, but getting the initial AI, scope, and skill functions set up for the first few jobs should make progress all the easier for future skills that are similar enough. If I can muster up the motivation and drive to make custom sprites for all 133 recruitable characters, I might just be able to make my dream game after all.

I will update with any other bugfixes or tricks I come across. (Adding shield blocking for both the enemy and party was a PIA, btw!)

--

Just got dual wield working without doubling up the damage, 2x the state effects, or 2x skill procs! Look out FFT, here I come!
Just gonna bump this, can't progress on the game until this issue gets either a solution, or I find out its basically impossible 😅
But welcome back Pharonix! Hehe I know I've taken my fair share of advice from you reading back over this thread!
Amazing script, been using it for a good year by now!
Just asking about a potential issue; I am currently developing a mecha-style game where the player can customise and swap parts to increase the mechs stats and whatnot. However, I am looking for a way to change the apperance of the mech by overlaying a basic frame with all the sprites of the unique parts (smaller images overlaying a frame.)
Wondering if there is any way to do this in LeTBS? I see no way on the github guide page to do this, (I am using 0.77.2B,) and drawing out all the unique combinations of sprites would be too arduous of a task to commission, due to the amount of unique combinations.
Thank you! 🙂
People were definitely discussing this earlier in the thread, I am not entirely sure if it was figured out, but I doubt it is impossible. I have been digging through this thread a lot as I am currently configuring the engine myself, so if I find a lead or solution I will let you know.

It sounds like a very useful addition to make, be it mecha or simply weapon/armor visuals for ground units. Will let you know if I come up with anything here. Likewise, if you find the posts in question, please keep us updated, as this is something I would like to eventually incorporate myself.

::edit::

Didn't find much with an initial sweep unfortunately, aside from making a different sprite per equipment setup. I did find this, but it seems specific for 0.8, so I am doubtful it will work with 0.772B https://lecodemv.github.io/leTBS/user-guide/entities.html#sprite-overlays
https://lecodemv.github.io/leTBS/user-guide/entities.html#sprite-overlays Start here, in the 0.8 docs. The battler can have a different animation set for each pose (attacking, idle, dead, etc), and each pose can be built from multiple layers of sprites and modifiers, as defined by states, equipment, etc.

This may have to be done with pictures and mapping x/y coordinates, or with other plugins, should one be able to find one that is compatible.

--
A bit unrelated, but as this thread seems to be picking up some steam again, has anyone been able to or does anyone know how to adjust the back and side damage bonus to instead affect accuracy? My game uses a lot of status ailments as well as a custom block code, and I would love to be able to grant bonuses to chance to hit when attacking from the side or behind, such as in the style of FFT.

Looks like Pharonix actually solved this one a while back: https://forums.rpgmakerweb.com/inde...ical-battle-system-0-77-2b.71572/post-1069495
People were definitely discussing this earlier in the thread, I am not entirely sure if it was figured out, but I doubt it is impossible. I have been digging through this thread a lot as I am currently configuring the engine myself, so if I find a lead or solution I will let you know.

It sounds like a very useful addition to make, be it mecha or simply weapon/armor visuals for ground units. Will let you know if I come up with anything here. Likewise, if you find the posts in question, please keep us updated, as this is something I would like to eventually incorporate myself.

::edit::

Didn't find much with an initial sweep unfortunately, aside from making a different sprite per equipment setup. I did find this, but it seems specific for 0.8, so I am doubtful it will work with 0.772B https://lecodemv.github.io/leTBS/user-guide/entities.html#sprite-overlays


This may have to be done with pictures and mapping x/y coordinates, or with other plugins, should one be able to find one that is compatible.

--
A bit unrelated, but as this thread seems to be picking up some steam again, has anyone been able to or does anyone know how to adjust the back and side damage bonus to instead affect accuracy? My game uses a lot of status ailments as well as a custom block code, and I would love to be able to grant bonuses to chance to hit when attacking from the side or behind, such as in the style of FFT.

Looks like Pharonix actually solved this one a while back: https://forums.rpgmakerweb.com/inde...ical-battle-system-0-77-2b.71572/post-1069495
Thanks mate! I did have a look at this a long time ago, and while it seems useful, there are so many combinations I plan to do for the mech bodies and whatnot that are unique, that i'd have to make so many actors with unique possibilities (at least, that's all I can imagine I can do, the forum doesn't say much on the customizability of the matter.) Not too sure how to find a solution, my only other thought was to make unique actors for each combination and have them set as the sprite, but that's a ridiculous amount of work for both me, and my artist. Anyone elses ideas would help immensely!
If you don't mind making the assets (I mean they would be need to be made anyways, just overlaid either with rpgmaker mv or in photoshop/gimp), I am sure there is some way to use a script to automatically overlay different pictures in the desired combination in your image editing software of choice. You would have possibly thousands of sprite sheets, but if the initial equipment is designed I am sure there are ways to have the images automatically created based on set conditions. Might require a tad bit of programming knowledge to make photoshop or another program do this, but there might very well be scripts or programs designed to do this already.

For example, I saw that the Octopath traveler sprites were all based off of the same template, and created in bulk with the different outfits and weapon animations per character. This way you only need to make the initial sprites/outfits and let the program fill in everything else once everything is properly organized and positioned. Just an idea, and one I will probably end up trying out once I get the initial development of the engine down and start making original assets myself.

----

So I have a question now, I think I might be able to figure this one out with a day or two of testing, but something tells me others have already solved this issue so I might as well ask... how do I prevent an aoe attack from hitting the user who casts it? I don't want to completely remove the aoe from hitting allies, but the attack is a moving whirlwind attack (spinning axe swing), where my character moves 1 tile and creates an aoe hitting all surrounding cells. The problem is, he also hits himself when doing this! Ideally I would like to make this attack hit the surrounding cells of every tile my character passes through (say with a 2 tile moving range), hitting the surrounding tiles of which my character passes. I might just stick with 1 tile movement as this seems much easier, and not to mention saves me from having to figure out how to allow diagonal movement for this single attack (currently just teleporting to the tile in question that is 1x1 panel away).

Example here: My character is in slot 1, and intends to move upwards to the left diagonally 1x tile, and in doing so he targets all surrounding cells in a square(1) aoe scope.
1650293912223.png

If I go with this type of movement, all that I really need to do is prevent hitting the self, and I would be happy with that. However... ideally I would want to move 2x panels, diagonally or straight, and hit all surrounding cells for the path my character takes.

Any ideas?

::edit::

found some leads in regards to overlaying images based on folders in photoshop, seems like a common request: https://community.adobe.com/t5/phot...verlay-two-different-images-batch/m-p/8103441
If you don't mind making the assets (I mean they would be need to be made anyways, just overlaid either with rpgmaker mv or in photoshop/gimp), I am sure there is some way to use a script to automatically overlay different pictures in the desired combination in your image editing software of choice. You would have possibly thousands of sprite sheets, but if the initial equipment is designed I am sure there are ways to have the images automatically created based on set conditions. Might require a tad bit of programming knowledge to make photoshop or another program do this, but there might very well be scripts or programs designed to do this already.

For example, I saw that the Octopath traveler sprites were all based off of the same template, and created in bulk with the different outfits and weapon animations per character. This way you only need to make the initial sprites/outfits and let the program fill in everything else once everything is properly organized and positioned. Just an idea, and one I will probably end up trying out once I get the initial development of the engine down and start making original assets myself.

----

So I have a question now, I think I might be able to figure this one out with a day or two of testing, but something tells me others have already solved this issue so I might as well ask... how do I prevent an aoe attack from hitting the user who casts it? I don't want to completely remove the aoe from hitting allies, but the attack is a moving whirlwind attack (spinning axe swing), where my character moves 1 tile and creates an aoe hitting all surrounding cells. The problem is, he also hits himself when doing this! Ideally I would like to make this attack hit the surrounding cells of every tile my character passes through (say with a 2 tile moving range), hitting the surrounding tiles of which my character passes. I might just stick with 1 tile movement as this seems much easier, and not to mention saves me from having to figure out how to allow diagonal movement for this single attack (currently just teleporting to the tile in question that is 1x1 panel away).

Example here: My character is in slot 1, and intends to move upwards to the left diagonally 1x tile, and in doing so he targets all surrounding cells in a square(1) aoe scope. View attachment 223544
If I go with this type of movement, all that I really need to do is prevent hitting the self, and I would be happy with that. However... ideally I would want to move 2x panels, diagonally or straight, and hit all surrounding cells for the path my character takes.

Any ideas?

::edit::

found some leads in regards to overlaying images based on folders in photoshop, seems like a common request: https://community.adobe.com/t5/phot...verlay-two-different-images-batch/m-p/8103441
Thanks man! This looks pretty good, my only worries are:
1. The amount of different combinations of parts
2. How would I make it so they constantly change and update in the game? If there were so many parts, how would one keep track and manage it so that game and LeTBS is pulling the proper combination of parts?

I talked to my concept artist and we sketched out a drawing of all the parts that could be interchanged on a mech. It can be seen in this glorious diagram below 🙂
Thanks for all the help by the way! I'll do my best to wrap my head around that AoE thing for you!
Spoiler: Mech Image
MechDesign.png
Well as I understand it, you would still need to create individual sprites for every combination, however using the help of a script like that could greatly speed up the process of making them. As far as specific conditions to refer to each unique sprite, I think there should be plenty of info as to how to do this in this thread and the help file. I unfortunately have not got that far, but I imagine it would be as simple as adding a new sequence or event in LeTBSConfig.js (probably a different section, but more or less the same process I would think). I believe you are looking for "poses", and adding one per visual equipment piece should do the trick. Once you have the correct "poses", you would need to add a line like this to event sequences in the aforementioned config file:

Code:
    "downed": [
    "play_pose: user, critical"
    ],

Then make a state that applies to the character based on equipment. In the state notebox put

<downed_pose> or whatever your equivalent tag is. Play_pose refers to the new pose you added, which step I have omited due to lack of know how. I haven't gotten to adding new poses yet as mentioned, but I am sure the answer is relatively simple and should be easy to find.

No worries on the AOE thing, I am kind of hoping the legend himself comes back to offer us newbs some assistance ^_^

... and it looks like this was easy enough to solve, adding

aoe_options: exclude_center to the attack prevents my character from hitting himself with an aoe teleporting attack. I will probably worry about increasing the movement range and hitting all targets around the path at a later time, if ever. Don't need to make my Berserker class too strong, so this may actually be ideal as it is. aoe_options: exclude_self also is a tag that can come in handy, but it didn't seem to work with this attack (likely as the character moved after the scope was set). The info in this thread is legitimately a life saver when it comes to configuring the system to your liking.


::edit::

Found some bugs with the accelerate skill. If you have a party member who is one position before you in the turn order, and you cast accelerate on yourself, it will bump your character up in line before your party member and give them a second turn. This is likely due to turn order following the ending turn of the active actor. Using accelerate on yourself when you are the last in the turn order also causes the following error:
1650301324863.png


I would caution using accelerate on self until there is a fix for this. I worry decelerate might have similar bugs.

Upon more testing it seems accelerate is very buggy, causing crashes for some unknown reason, and both accelerate and decelerate only seem to work on allies. Here is the accelerate and decelerate code in LeTBSTimelineControl.js:

Code:
BattleManagerTBS.applyTimelineControlEffects = function (user, item, target) {
    if (Math.random() < item.TagsLetbs.extraTurn) {
        this.addExtraTurn(target);
    } else if (Math.random() < item.TagsLetbs.accelerateTurn) {
        this.accelerateTurn(user, target, 1);
    } else if (Math.random() < item.TagsLetbs.decelerateTurn) {
        this.accelerateTurn(user, target, -1);
    } else if (Math.random() < item.TagsLetbs.instantTurn) {
        this.setInstantTurn(user, target);
    } else if (Math.random() < item.TagsLetbs.extraInstantTurn) {
        this.setInstantTurn(user, target, true);
    }
};

BattleManagerTBS.accelerateTurn = function (user, target, value) {
    var userIndex = this._turnOrderVisual.getEntityIndex(user);
    var targetIndex = this._turnOrderVisual.getEntityIndex(target);
    var newIndex = targetIndex - value;
    if (newIndex >= this._turnOrder.length || newIndex < 0 || newIndex === userIndex) return;

    this.allEntities().forEach(function (entity) {
        entity._oldTurnOrderIndex = this._turnOrderVisual.getEntityIndex(entity);
    }.bind(this));

    var e = this._turnOrder[newIndex];
    this._turnOrder[targetIndex] = e;
    this._turnOrder[newIndex] = target;
    var text = value > 0 ? Lecode.S_TBS.TimelineControl.accelerationText : Lecode.S_TBS.TimelineControl.decelerationText;
    var fs = value > 0 ? Lecode.S_TBS.TimelineControl.accelerationFontSize : Lecode.S_TBS.TimelineControl.decelerationFontSize;
    var color = value > 0 ? Lecode.S_TBS.TimelineControl.accelerationColor : Lecode.S_TBS.TimelineControl.decelerationColor;
    target.addTextPopup(text, fs, color);
    target._turnAccelerated = true;
    this._turnOrderVisual.updateOnExtraTurn(this._turnOrder, this._activeIndex);
};

Not sure what I did, but messing around with agi and the turn settings in the plugin manager fixed the crash, but I still can't use accelerate on myself without issues. I can use decelerate and accelerate on both allies and enemies now, however the turn order is reset to the default once the current round ends. Wish there was more documentation on using these correctly, but even out of the box decelerate wasn't working so I am thinking I might be alone on this one.

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