Lecode Tactical Battle System 0.77.2B

T^T I don't understand codes where should I put it?

I DO use one time move in my game

I also wonder why the demo's Fire support doesn't work and how to put skills in that format (e.g. skill group (Chivalry for example) >> list of skills included inside)
@Alphaistimz I made a plugin that should let you undo moves properly regardless of your plugin settings. I'll try to upload it once I get home this evening- just keep in mind it won't undo the effects of any tiles or marks you step on, because it's pretty much impossible to anticipate what those will do. I'd suggest not using anything that triggers the moment you step on it.
I‘ve made movement cancel function.
If you don't use <one_time_move> tag, you can add a _lastCell field for Entity.
Save last cell in the BattleManagerTBS.validateMoveSelection.
Set it null in the BattleManagerTBS.onActionEnd and BattleManagerTBS.turnEnd.
Add undo codes in the BattleManagerTBS.processCommandCancel.
Like this:
Code:
if(this.activeEntity()._lastCell != null){
        var lastcell = this.activeEntity()._lastCell;
        this.activeEntity().teleport(lastcell);
        this.centerCell(this.activeEntity().getCell());

        if (this.activeEntity().oneTimeMove()){
            this.activeEntity().setMovePoints();
        } else {
            this.activeEntity()._movePoints = this.activeEntity()._lastStep;
        }
      

        this.activeEntity()._movePerformed = false;
    }
    BattleManagerTBS.setCursorCell(this.activeEntity().getCell());


I actually did something similar, but added a parameter to the plugin to enable/disable this. But it doesn't work. the "Cancel" doesn't apply properly when you select what you want to do next.
@Alphaistimz just unzip this plugin and put it below the other LeTBS plugins and it should work, no configuration involved. Hitting cancel from the main action menu should undo your previous move, but it (for obvious reasons) doesn't let you undo attacks, skills, items, or ending your turn. If there's nothing to undo, then cancel will bring up the "options/escape/etc" menu, like normal.

While you can undo your movement after, say, stepping on a damage tile, it won't undo the damage, so I'd again recommend not using it together with anything that makes any form of lasting status change as a result of a movement. Auras seem to work fine.
I actually did something similar, but added a parameter to the plugin to enable/disable this. But it doesn't work. the "Cancel" doesn't apply properly when you select what you want to do next.
I don't know what's wrong in your condition.But my project ran properly.
The main point in this function is to save last position of the entity, and reset _movePoints and _movePerformed when cancelled.
Or you can try the plugin of @Doktor_Q.
I found that the skill animations played first time in the battle will cause a lag, and actions of entity with complicated settings(Boss enemy) will even cause more critical lag.
Lags make a terrible game experience.
Is there anyone has a solution for reducing lag?
Is there a way to make a character have several actions per turn ?

Like having 5 Action Points, with abilities, attack and moving costing Action Points ; said character would end its turn as his Action Points reach zero.
You could gain several actions and movement by turning "one time action" and "one time move" in the plugin menu off.

I think someone has mentioned this already but you can make skill cost move points by using YEP_SkillCore.
The following is a skill that cost 1 move point
Spoiler: Skill Notetag Example
<Custom Requirement>
value = a.getEntity().getMovePoints() > 0;
</Custom Requirement>

<Custom Execution>
a.getEntity().changeMovePoints(-1);
</Custom Execution>

Spoiler: Probably not important
The difficult part is to make an enemy Ai perform multiple actions and movements, smartly. This requires quite a bit of work with each specific ai. Not to mention the bugs that it will bring along. This is actually what I spent months doing. You can see an example of it on my IGMC 2018 entry:
Oh wow! It looks handy!
Thanks @Doktor_Q
Will probably mod doctor Qs script to take a variable.
On tile triggers or skill, itll set can_undo to 0

Itll take a little bit, mainly since I don't have the time roght now
Will probably mod doctor Qs script to take a variable.
On tile triggers or skill, itll set can_undo to 0

Itll take a little bit, mainly since I don't have the time roght now

Much easier way to do it: just call the "clear" function when you step on an effect tile, the same way the script already does when you use an item or skill.

I suppose I can probably implement it for various tile effects and marks, and just set up parameters to control which ones you can still undo after.
I've tried playing around the plugin and a bit troubled by ai_pattern and use_condition
What are the other patterns (other than melee_fighter and ranged_fighter)?
And I need other use_condition than HP (like having or not having certain state)
I also need to differentiate buffs, debuffs, and ailments. Should I use type: healing, support for buffs and offense, support for debuffs and ailments?

Btw I wonder how to make enemy AI to do something like this:
I have 6 enemies, 3 front, 2 middle, and 1 back (the boss)
front charges immediately
after 2 of them die, middle charges
and finally, after only 1 enemy other than the boss, the boss starts charging forward
the middle and boss stay idle until condition is met OR if one of them is attacked before their charging time.

I think something like that will surely make my game more balanced...
If anyone can help me with this issue I would so much appreciate it.

I'm trying to use the default 'Bat' enemy for combat, but I get an error when trying to use him.

It's either: battler 'Bat' has no sprite configuration!
or
if I set him up with this code
Spoiler: Code
pose([Pose Name]): use_chara, [Filename], [Index], [LineIndex], [FrameIndex]
he uses only that frame and the sprite flashes in and out of existence.

Yes, I am using LeTBS_RTPUse.js. Yes, I started altering from the Demo so everything is still the same, minus me deleting classes/skills/actors.
I also have the same problem
everything works up to the time I start the battle and I get error 'pose' undefined
all of my battlers use characters and no pose whatsoever...
I think the github documentation and the demo is a bit different here and there
I even copy paste the note tags in the demo and see no mistake whatsoever (but still doesn't work)...
I also have the same problem
everything works up to the time I start the battle and I get error 'pose' undefined
all of my battlers use characters and no pose whatsoever...
I think the github documentation and the demo is a bit different here and there
I even copy paste the note tags in the demo and see no mistake whatsoever (but still doesn't work)...

Hey, so after a fresh look at this and looking at the "Mago" enemies the demo had setup, I found this piece of code that allows the bat to work properly!

Spoiler: LeTBS Enemy Sprite Code
<letbs_sprite>

pose(idle): use_chara, Monster, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>
I just started to use this amazing battle system but I have on little problem. I changed the resolution to be a little smaller than the original
and I noticed that the battle windows were little too big and could't fit to the screen properly. They can be changed from the plungin editor but
the only window that I couldn't resize was at the start of a battle where you choose your battler's position. Is there a way to resize that window?
@wintersgrace Do you mean bandit? I don't see that in mago

I use that note tags too, but doesn't work

all of my enemies are humans btw so I don't use monsters

Did you get these errors too?
@wintersgrace Do you mean bandit? I don't see that in mago

I use that note tags too, but doesn't work

all of my enemies are humans btw so I don't use monsters

Did you get these errors too?

That's weird that you're getting an error from using the Bandit. He's part of the Demo and worked for me.




Spoiler: Pictures
upload_2019-2-4_8-27-45.png
upload_2019-2-4_8-28-2.png

That's how I have the Bat enemy setup, and the code I used is ripped straight from the Bandit code. I don't even get the console to show up on my game, so I've been diagnosing and troubleshooting using the one or two lines of error messages I get in game. I've spent countless hours digging through the scripts so I have a very rough idea of what is going on.

Do you have the LeTBS_RTPUse.js plugin? If you don't, that would explain why this is breaking.

Spoiler: Script Pic
upload_2019-2-4_8-30-46.png

EDIT:
I'm currently running into an issue where my enemies are using only skill, even when the other skills should be available to them. In particular, it's support skills that they're not using.

I have a skill that lowers the enemies defense (by applying a state) with the following note tag:
Spoiler: Notetag Code
<letbs>

scope: circle(4)

</letbs>



<letbs_AI>

type: support

use_condition: !b.states().contains(5)

</letbs_AI>

<Cooldown: 4>

-33% Defense
I use RTP
the only ones I don't use are SpreadState, TilesMarksAura, TimelineControl, and Summoning since they aren't used in my game
My enemies are custom but they use characters only, so as the actors

This is what I use for all actors:
Spoiler
<letbs_sprite>

pose(idle): use_chara

pose(dead): use_chara, Ahi, 4, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>

This is for enemies:
Spoiler
<letbs_sprite>

pose(idle): use_chara, Yuna, 0

pose(dead): use_chara, Yuna, 4, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>


<letbs>

scope: line(3,2)

aoe: circle(1)

move_points: 3

ai_pattern: ranged_fighter

passable_on_death

</letbs>



<Static Level: 3>

<Base Parameters on Class: 29>

<Passive State: 15>

<Enemy Drops>

Magical I: 100%

Soul Gem I: 100%

</Enemy Drops>

I see nothing wrong there... that's why I'm confused
I also use some of Yanfly's plugins, but since they're not mentioned in the error, and I even tried turning them off (and still get the same error), they're not related.
I use RTP
the only ones I don't use are SpreadState, TilesMarksAura, TimelineControl, and Summoning since they aren't used in my game
My enemies are custom but they use characters only, so as the actors

This is what I use for all actors:
Spoiler
<letbs_sprite>

pose(idle): use_chara

pose(dead): use_chara, Ahi, 4, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>

This is for enemies:
Spoiler
<letbs_sprite>

pose(idle): use_chara, Yuna, 0

pose(dead): use_chara, Yuna, 4, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>


<letbs>

scope: line(3,2)

aoe: circle(1)

move_points: 3

ai_pattern: ranged_fighter

passable_on_death

</letbs>



<Static Level: 3>

<Base Parameters on Class: 29>

<Passive State: 15>

<Enemy Drops>

Magical I: 100%

Soul Gem I: 100%

</Enemy Drops>

I see nothing wrong there... that's why I'm confused
I also use some of Yanfly's plugins, but since they're not mentioned in the error, and I even tried turning them off (and still get the same error), they're not related.

Alright, I've got to get class here shortly but I copied my notebox for my enemies:

Spoiler: Notebox for Enemies
<letbs_sprite>

pose(idle): use_chara, enemySquireM, 0

pose(dead): use_chara, enemySquireMDamage, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>

<letbs>

move_points: 4

ai_pattern: melee_fighter

</letbs>[/SPOILER

My game uses different looking characters based on their class, but this code works for me just fine. The folder you have these enemies and actors in is the img/characters folder right? You don't want these in the img/letbs/battlers folder

Edit: Maybe we can help each other out: Do you have any issues with your enemies not using skills listed with:
[letbs_AI]
type: support
[/letbs_AI]

Mine won't use them at all and it's bugging me haha
Any idea with this plugin that might be causing lag? On my main machine I don't see any lag but it's also an overkill workstation (Threadripper 1950x CPU and 1070ti), the gaming laptop I have is an AMD RX 560 for the video card and quad core Ryzen 2500u for the CPU but in the parts of the game with LETBS, it starts the battle at 60FPS (the part before you lay your characters down in their selected spots), as I lay each character down, I notice a drop in framerate. After I place more than 4 characters it gets down to 3FPS.

Not sure what causes this but I know I run into weird lag issues with RPG Maker MV all the time, I hope with a future update they fix that because it's ridiculous that 2d games lag this bad. I even see in the task manager that it's only using 2% of the CPU and 10% of the GPU, just frustrating.

I've seen this type of situation with a lot of plugins though, I know it's some kind of flaw in the base engine, have been looking for years to find a lag fix but might have to end up just working around it.

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