Lecode Tactical Battle System 0.77.2B

Finally getting into messing around with this- is there a way to make sequences that take more than one parameter? I'm trying to make a projectile that is also a push, but putting two values inside the ()'s is just making it crash.

I am not sure about the specifics for that sequence. But I can tell you that all of the sequences and how they work are located in the LeTBSConfig.js file. You will see code that looks like:

"atk_push": [
"play_pose: user, atk",
"wait: 10",
"effects: {aoe}_battlers, current_obj, obj_anim",
"if: isHit('{aoe}_battlers')",
"set_speed: {aoe}_battlers, +6",
"push: {aoe}_battlers, user_cell, $1",
"set_speed: {aoe}_battlers, reset",
"end_if",
"wait: 60"
],

I do see that in that code for the part where it's for projectile says

"projectile": [
"play_pose: user, atk",
"wait: 10",
"projectile: $1, user_cell, {aoe}_battlers, current_obj, obj_anim",
"wait: 60"
],

You can kind of reverse engineer the sequences to come up with your own unique sequence.

Maybe Something like this would work, making your own sequence name with both components in it.

"atk_push_projectile": [
"play_pose: user, atk",
"wait: 10",
"projectile: $1, user_cell, {aoe}_battlers, current_obj, obj_anim",
"wait: 60"
"effects: {aoe}_battlers, current_obj, obj_anim",
"if: isHit('{aoe}_battlers')",

"set_speed: {aoe}_battlers, +6",
"push: {aoe}_battlers, user_cell, $1",
"set_speed: {aoe}_battlers, reset",
"end_if",
"wait: 60"
],


I've had to do this for my project to create new sequences that didn't fit what they already had (like plasma blaster, or something like that). It's kind of trial and error though. The demo though linked in the first post of this thread helped me out a lot.
I've made a projectile_push, the issue is that I have to either hard-code the projectile used, or hard-code the distance of the push- it seems like I can only pass down one parameter for it to use.
One of my friends directed me to this excellent plugin and I dug through the documentation to find out it does a lot of what a need, and a few things I didn't realize I needed! The one question I have right now is, does it support units that take up more than one tile? Not any particular funky shapes, but for example a 2x2 or 3x3 square unit.

I wanted to implement a few 'large' player and boss units that obeyed regular movement rules (with a few that have abilities to ignore things like small rocks in the way etc.)
One of my friends directed me to this excellent plugin and I dug through the documentation to find out it does a lot of what a need, and a few things I didn't realize I needed! The one question I have right now is, does it support units that take up more than one tile? Not any particular funky shapes, but for example a 2x2 or 3x3 square unit.

It does not. It's in the list of planned improvements, but it doesn't look like it's particularly near the top right now.
It does not. It's in the list of planned improvements, but it doesn't look like it's particularly near the top right now.

His priority is making the system more asynchronous and faster.

But I think its on the 0.80 list so it should be included.

Its been on his list for a while
Hello everyone, I finally have one of the first Beta version of LeTBS 0.8

There is the first little preview!
A new button appear in the title screen (you can disable it by disabling the corresponding plugin)

Spoiler: Image
1.png

If you click on this button, you gain access to a new window :

Spoiler: Image
2.png

The resources marked with a yellow star are the one by default, you can add or remove some.
For example this will make ally and enemy cells quickly rotate for a second before battle starts.

Actually the plugin is still WIP but nearly done!
Lecode is working on Linux but on windows, there is a silly bug soon to be corrected : ) preventing me to test the battles for now, I'll show you more when this is corrected!

There is also a completely new functionality added with this version :

Signals

With this, you will be able to inject your own code just after the start of the battle of after the action Y of an actor X so you will be able to DEEPLY customize your game!
Hello everyone, I finally have one of the first Beta version of LeTBS 0.8

There is the first little preview!
A new button appear in the title screen (you can disable it by disabling the corresponding plugin)

View attachment 102878

If you click on this button, you gain access to a new window :
View attachment 102886

The resources marked with a yellow star are the one by default, you can add or remove some.
For example this will make ally and enemy cells quickly rotate for a second before battle starts.

Actually the plugin is still WIP but nearly done!
Lecode is working on Linux but on windows, there is a silly bug

There is also a completly new functionality added with this version :

Signals

With this, you will be able to inject your own code just after the start of the battle of after the action Y of an actor X so you will be able to DEEPLY customize your game!


Wow

Thats sexy

Does the config wrote to a file?
If so could we use the 0.8 to build a config for older versions?

Im excited for 0.8 but its gonna take months to upgrade all my custom code and plugins.
Not to mention 500 unique enemies lol
Hi, anybody know how I can make AI switch behaviors in the middle of a battle or as a result of a state? I want to create a (Offense: target allies) behavior so that charmed enemies target allies with their attacks.
Hi, anybody know how I can make AI switch behaviors in the middle of a battle or as a result of a state? I want to create a (Offense: target allies) behavior so that charmed enemies target allies with their attacks.

Use the cinfusion state.
However lecodes logic was broken, so the ally and enemy lists were identical, causing the ai to skip a turn.
I however have fixed this in my project
It was a bit difficult
Use the cinfusion state.
However lecodes logic was broken, so the ally and enemy lists were identical, causing the ai to skip a turn.
I however have fixed this in my project
It was a bit difficult

Thanks! What do you mean by confusion state? Is it this one bundled with the letbs demo?

upload_2018-11-19_22-31-40.png


It doesn't appear to do anything.
Thanks! What do you mean by confusion state? Is it this one bundled with the letbs demo?

View attachment 102898

It doesn't appear to do anything.
Because lecodes logic in the getallies amd getenemies functions is broken

Both functions return the same data if confused.
So if enemy a and enemy b vs player a
And you confuse enemy b

Enemy b has enemy a, and enemy b as allies and enemies, because his enemies are his allies, it doesn't work.

I can send my code later its 11pm here right now.
Because lecodes logic in the getallies amd getenemies functions is broken

Both functions return the same data if confused.
So if enemy a and enemy b vs player a
And you confuse enemy b

Enemy b has enemy a, and enemy b as allies and enemies, because his enemies are his allies, it doesn't work.

I can send my code later its 11pm here right now.


Ahh, I tried it before but abandoned it after I couldn't get it to work. If you could send over the code that would be very appreciated!
Ahh, I tried it before but abandoned it after I couldn't get it to work. If you could send over the code that would be very appreciated!

Because there's 2 parts.
The first part is the "Which state is it" part.
The problem is Lecode's logic has it, if you have a state with attack ally he uses it as if it were "attack enemy units"
which was the wrong way.

So update those with the below:

Spoiler: Confusion Levels
Code:
/*-------------------------------------------------------------------------
* Game_BattlerBase
-------------------------------------------------------------------------*/
/*THESE ARE WRONG
Game_BattlerBase.prototype.hasConfusionStateAttackAlly = function () {
    return this.confusionLevel() === 1;
};
Game_BattlerBase.prototype.hasConfusionStateAttackAnyone = function () {
    return this.confusionLevel() === 2;
};
Game_BattlerBase.prototype.hasConfusionStateAttackEnemy = function () {
    return this.confusionLevel() === 3;
};
*/

//Confusion Level 0 = No Confusion
//Confusion Level 1 = Attack Enemy
//Confusion Level 2 = Attack Anyone
//Confusion Level 3 = Attack Ally

Game_BattlerBase.prototype.hasConfusionStateAttackEnemy = function () {
    return this.confusionLevel() === 1;
};   
Game_BattlerBase.prototype.hasConfusionStateAttackAnyone = function () {
    return this.confusionLevel() === 2;
};
Game_BattlerBase.prototype.hasConfusionStateAttackAlly = function () {
    return this.confusionLevel() === 3;
};

Next is the getAllies/Enemies codes.
The problem with Lecode's Logic, was the reliance of both functions on returning the Opposite function.
Which always returned the unit's allies as both allies and enemies if they were confused.
The below code has the original funcions commented out.

Spoiler: getAllies/Enemies Functions
Code:
/*
TBSAiManager.prototype.getEnemiesOf = function (battler, needAlive) {
    if (battler.hasConfusionStateAttackAlly())
        return this.getAlliesOf(battler, needAlive);
    if (battler.hasConfusionStateAttackAnyone() && Math.randomInt(2) === 0)
        return this.getAlliesOf(battler, needAlive);
    var group = battler.isActor() ? this.BM().enemyEntities() : this.BM().allyEntities();
    if (needAlive) {
        return group.filter(function (ent) {
            return !ent.battler().isDead();
        });
    } else {
        return group;
    }
};

TBSAiManager.prototype.getAlliesOf = function (battler, needAlive) {
    if (battler.hasConfusionStateAttackEnemy())
        return this.getEnemiesOf(battler, needAlive);
    if (battler.hasConfusionStateAttackAnyone() && Math.randomInt(2) === 0)
        return this.getEnemiesOf(battler, needAlive);
    var group = battler.isEnemy() ? this.BM().enemyEntities() : this.BM().allyEntities();
    if (needAlive) {
        return group.filter(function (ent) {
            return !ent.battler().isDead();
        });
    } else {
        return group;
    }
};*/

TBSAiManager.prototype.getEnemiesOf = function (battler, needAlive) {
    
    var group = battler.isActor() ? this.BM().enemyEntities() : this.BM().allyEntities();
    
    if (battler.hasConfusionStateAttackAlly())
        group = battler.isActor() ? this.BM().allyEntities() : this.BM().enemyEntities();
    if (battler.hasConfusionStateAttackAnyone() && Math.randomInt(2) === 0)
        group = battler.isActor() ? this.BM().allyEntities() : this.BM().enemyEntities();
    
    for (var i = 0; i<group.length-1; i++)
    {
        if (group[i].battler() == battler)
        {
            group.splice(i, 1);
        }
        
    }
    if (needAlive) {
        return group.filter(function (ent) {
            return !ent.battler().isDead();
        });
    } else {
        return group;
    }
};

TBSAiManager.prototype.getAlliesOf = function (battler, needAlive) {
    
    var group = battler.isActor() ? this.BM().allyEntities() : this.BM().enemyEntities();
    
    if (battler.hasConfusionStateAttackAlly())
        group = battler.isActor() ? this.BM().enemyEntities() : this.BM().allyEntities();
    if (battler.hasConfusionStateAttackAnyone() && Math.randomInt(2) === 0)
        return this.getEnemiesOf(battler, needAlive);
    
    
    if (needAlive) {
        return group.filter(function (ent) {
            return !ent.battler().isDead();
        });
    } else {
        return group;
    }
};

**** I Take No Responsibility If Your Project Explodes ****
Have an interesting when I use tag as below
Code:
<letbs_AI>
type: offense,move,push
</letbs_AI>
for enemy CanhSat. But AI did not seem to attack Player, As well the player can not move because of being blocked by four corpses
I feel this plugin is great and I used it for the contest igmc.

I'll use version 0.8 for commercial.
Thank you @Chaosicaa created a great battle system.
Hi! Im getting this error when trying to use a custom skill I made

https://gyazo.com/89ee05d2cd95f2619ef85f643e5440d0

heres the code for the animation I made

https://gyazo.com/ab3ae9a9882d5e6e08e43a4bde861c19

not sure what the issue could be because it seems like everything is fine
Have an interesting when I use tag as below
Code:
<letbs_AI>
type: offense,move,push
</letbs_AI>
for enemy CanhSat. But AI did not seem to attack Player, As well the player can not move because of being blocked by four corpses
I feel this plugin is great and I used it for the contest igmc.

I'll use version 0.8 for commercial.
Thank you @Chaosicaa created a great battle system.

Double check to make sure the Region to block movement isn't blocking that enemy.
Also the
Code:
<letbs_AI>
type: offense,move,push
</letbs_AI>
Should be used on the skill, not the enemy.

Hi! Im getting this error when trying to use a custom skill I made

https://gyazo.com/89ee05d2cd95f2619ef85f643e5440d0

heres the code for the animation I made

https://gyazo.com/ab3ae9a9882d5e6e08e43a4bde861c19

not sure what the issue could be because it seems like everything is fine

Can you send the notetags for the actual skill
as well as any code for the sequence(if used)


EDIT:

Regarding my previous post about the "Charm" state.
I have it working to a degree. The enemy unit doesn't seem to attack sometimes, but it does move towards their ally as if to attack. I gotta see if it is my own settings or something else that's doing it.
Double check to make sure the Region to block movement isn't blocking that enemy.
Also the
Code:
<letbs_AI>
type: offense,move,push
</letbs_AI>
Should be used on the skill, not the enemy.



Can you send the notetags for the actual skill
as well as any code for the sequence(if used)


EDIT:

Regarding my previous post about the "Charm" state.
I have it working to a degree. The enemy unit doesn't seem to attack sometimes, but it does move towards their ally as if to attack. I gotta see if it is my own settings or something else that's doing it.


here are the notes im using for the skill

<letbs>

scope: line(4)

sequence: mana_sabre

</letbs>



<letbs_AI>

type: offense

</letbs_AI>

the code I wrote up was in the 2nd picture was just the little mana_sabre sequence.
Because there's 2 parts.
The first part is the "Which state is it" part.
The problem is Lecode's logic has it, if you have a state with attack ally he uses it as if it were "attack enemy units"
which was the wrong way.


Thanks! Haha, my project didn't explode. I copypasted your code and I can see the AI trying to attack its allies, but I think it can't use its skills for some reason. It just circles allied AI and ends its turn.
Thanks! Haha, my project didn't explode. I copypasted your code and I can see the AI trying to attack its allies, but I think it can't use its skills for some reason. It just circles allied AI and ends its turn.

At least it functions better lol

Ill let you know if i fix the attacking
Should be used on the skill, not the enemy.
Yes, I was mistaken.
Double check to make sure the Region to block movement isn't blocking that enemy.
My mean is that it is blocked by 4 corpses of unit enemy. I have draw the RegionId
I think should settimeout (about 30 sec)to remove the corpse.

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