Lecode Tactical Battle System 0.77.2B

More interestingly, can you manually call a sequence from the editor? I.E in script plugin line?

upload_2019-8-18_23-18-17.png



Like with either of those?
More interestingly, can you manually call a sequence from the editor? I.E in script plugin line?

View attachment 121523

Like with either of those?

What exactly are you trying to do
I was actually working on something like that. I actually got a "Transfigure Skill" working. Where it transformed actors/enemies into puppies.
I'll try to get you the correct steps tomorrow.
Thanks man.
What exactly are you trying to do

Something like a "combo" system

I figured out how to make it functional(ish) -I think, I noticed that you can define sequences in common commands

upload_2019-8-20_2-59-4.png



So I aim to have it where a player does a qte correctly, they will get additional attacks
Something like a "combo" system

I figured out how to make it functional(ish) -I think, I noticed that you can define sequences in common commands

View attachment 121607


So I aim to have it where a player does a qte correctly, they will get additional attacks
Then you will need a few lines

var skill = $dataSkills[skillId];
//This to get the actual Skill you want them to use

entity = BattleManagerTBS.activeEntity();
//This gets the active Entity (The guy attacking)

BattleManagerTBS.forceAction(skill, entity);
//This should force the skill to be used by the entity.

Now, if you use pass_on_use
This may or may not work. I have yet to try ANY of this in a common event as part of the skill, so I can't guarantee these work.
Thanks man.
Apparently all I did was use yanfly's states and stuff, to use apply/remove effects

So the "Transmutate skill" simply added a state, which used this.
However, it is very inelegant, and may not work properly.

For the "Rock Transform" I made an enemy that was a rock with max stats (to prevent damage).
Then I gave it no skills, no movement, and basically made settings that forced it to wait instead of making a move.
Then when the state wore off they went back to normal.
This was crude and didn't always work, not to mention it didn't work on player characters.

Spoiler: Transmutate
<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Archive the previous enemy ID.
user._prevEnemyId = user._enemyId;
// Set the target enemy ID you want the enemy to change into.
var transformEnemyId = 35;
// Transform the user.
user.transform(transformEnemyId);
}
</Custom Apply Effect>


<Custom Remove Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Retrieve the archived enemy ID.
var transformEnemyId = user._prevEnemyId;
// Transform the enemy back.
user.transform(transformEnemyId);
// Clear the archived data.
user._prevEnemyId = undefined;
}
</Custom Remove Effect>
Apparently all I did was use yanfly's states and stuff, to use apply/remove effects

So the "Transmutate skill" simply added a state, which used this.
However, it is very inelegant, and may not work properly.

For the "Rock Transform" I made an enemy that was a rock with max stats (to prevent damage).
Then I gave it no skills, no movement, and basically made settings that forced it to wait instead of making a move.
Then when the state wore off they went back to normal.
This was crude and didn't always work, not to mention it didn't work on player characters.

Spoiler: Transmutate
<Custom Apply Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Archive the previous enemy ID.
user._prevEnemyId = user._enemyId;
// Set the target enemy ID you want the enemy to change into.
var transformEnemyId = 35;
// Transform the user.
user.transform(transformEnemyId);
}
</Custom Apply Effect>


<Custom Remove Effect>
// Check if the user is an enemy.
if (user.isEnemy()) {
// Retrieve the archived enemy ID.
var transformEnemyId = user._prevEnemyId;
// Transform the enemy back.
user.transform(transformEnemyId);
// Clear the archived data.
user._prevEnemyId = undefined;
}
</Custom Remove Effect>
Oh well, thanks for trying to help, I'll just keep experimenting with stuff to try and figure out a way to make it work.

Edit: So just to confirm, there isn't a way to make a players sprite change mid battle?
Oh well, thanks for trying to help, I'll just keep experimenting with stuff to try and figure out a way to make it work.

Edit: So just to confirm, there isn't a way to make a players sprite change mid battle?
I use class change core, and set up graphics that take place when they change classes.
at this time, I am not sure if they change graphics in battle if you change their class. I know this works with yanfly core, but I do not know whether it works inside LeTBS.
I would need to do testing.
I use class change core, and set up graphics that take place when they change classes.
at this time, I am not sure if they change graphics in battle if you change their class. I know this works with yanfly core, but I do not know whether it works inside LeTBS.
I would need to do testing.
I'll go ahead and test this to see if it works or not, thanks again.

Edit: So I got the plugin working and everything but now when I go into a battle it says "Cannot read property 'fittingHeight' of undefined"
I'll go ahead and test this to see if it works or not, thanks again.

Edit: So I got the plugin working and everything but now when I go into a battle it says "Cannot read property 'fittingHeight' of undefined"

I'm sorry, I'm an idiot, Yanfly Battle Core was conflicting with everything so as soon as I got rid of it battles started working
Alright, found my modifications. You'll need to open up LeTBS_RTPUse.js, find these two functions, and replace them with the versions I have here:

Code:
Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig = TBSEntity_Sprite.prototype.processBitmapsConfig;
TBSEntity_Sprite.prototype.processBitmapsConfig = function (poseConfig, hue) {
    var pose = poseConfig.pose;
    var data = poseConfig.data;
    var battler = this._entity.battler();
    if (data.match(/use_chara/)) {
        this._useFrameOrder[pose] = true;
        this._poses.push(pose);
        var array = data.split(",");
        // DrQ: Actors still use params, if they have them
        var charaName = (battler.isActor() && !array[1]) ? battler.characterName() : array[1].trim();
        var fullBitmap = ImageManager.loadCharacter(charaName, hue);
        fullBitmap.addLoadListener(this.createCharaBitmap.bind(this, fullBitmap, array, pose));
        return;
    }
    Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig.call(this, poseConfig, hue);
};

TBSEntity_Sprite.prototype.createCharaBitmap = function (fbitmap, array, pose) {
    var battler = this._entity.battler();
    // DrQ: Actors still use params, if they have them
    var charaIndex = (battler.isActor() && !array[2]) ? battler.characterIndex() : Number(array[2].trim());
    var lineIndex = array[3] ? Number(array[3].trim()) : undefined;
    var frameIndex = array[4] ? Number(array[4].trim()) : undefined;
    //var bitmap = new Bitmap(48 * 3, 48 * 4);
    var pw = fbitmap.width / 4;
    var ph = fbitmap.height / 2;
    var bitmap = new Bitmap(pw, ph);
    var n = charaIndex;
    var sx = (n % 4) * pw;
    var sy = Math.floor(n / 4) * ph;
    bitmap.blt(fbitmap, sx, sy, pw, ph, 0, 0);
    if (lineIndex >= 0) {
        ph /= 4;
        sy = lineIndex * ph;
        if (frameIndex >= 0) {
            pw /= 3;
            sx = frameIndex * pw;
            //var newBmp = new Bitmap(48, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, sx, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 0;
            this._nbrLines[pose] = 1;
        } else {
            //var newBmp = new Bitmap(48 * 3, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, 0, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 2;
            this._nbrLines[pose] = 1;
        }
    } else {
        this._maxFrame[pose] = 2;
        this._nbrLines[pose] = 4;
        this._bitmaps[pose] = bitmap;
    }
    this._frameLoaded++;
};

This should work for sprites of any size, but does still demand they be arranged as usual (eight sheets arranged 4x2, each sheet is 3x4)- so no using the $bigmonster sprites directly, not that you'd necessarily want to anyway considering none of them have multiple facing directions.


When I tried this, it only make the taller people shift side to side.
Alright, found my modifications. You'll need to open up LeTBS_RTPUse.js, find these two functions, and replace them with the versions I have here:

Code:
Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig = TBSEntity_Sprite.prototype.processBitmapsConfig;
TBSEntity_Sprite.prototype.processBitmapsConfig = function (poseConfig, hue) {
    var pose = poseConfig.pose;
    var data = poseConfig.data;
    var battler = this._entity.battler();
    if (data.match(/use_chara/)) {
        this._useFrameOrder[pose] = true;
        this._poses.push(pose);
        var array = data.split(",");
        // DrQ: Actors still use params, if they have them
        var charaName = (battler.isActor() && !array[1]) ? battler.characterName() : array[1].trim();
        var fullBitmap = ImageManager.loadCharacter(charaName, hue);
        fullBitmap.addLoadListener(this.createCharaBitmap.bind(this, fullBitmap, array, pose));
        return;
    }
    Lecode.S_TBS.RTPUse.oldTBSEntitySprite_processBitmapsConfig.call(this, poseConfig, hue);
};

TBSEntity_Sprite.prototype.createCharaBitmap = function (fbitmap, array, pose) {
    var battler = this._entity.battler();
    // DrQ: Actors still use params, if they have them
    var charaIndex = (battler.isActor() && !array[2]) ? battler.characterIndex() : Number(array[2].trim());
    var lineIndex = array[3] ? Number(array[3].trim()) : undefined;
    var frameIndex = array[4] ? Number(array[4].trim()) : undefined;
    //var bitmap = new Bitmap(48 * 3, 48 * 4);
    var pw = fbitmap.width / 4;
    var ph = fbitmap.height / 2;
    var bitmap = new Bitmap(pw, ph);
    var n = charaIndex;
    var sx = (n % 4) * pw;
    var sy = Math.floor(n / 4) * ph;
    bitmap.blt(fbitmap, sx, sy, pw, ph, 0, 0);
    if (lineIndex >= 0) {
        ph /= 4;
        sy = lineIndex * ph;
        if (frameIndex >= 0) {
            pw /= 3;
            sx = frameIndex * pw;
            //var newBmp = new Bitmap(48, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, sx, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 0;
            this._nbrLines[pose] = 1;
        } else {
            //var newBmp = new Bitmap(48 * 3, 48);
            var newBmp = new Bitmap(pw, ph);
            newBmp.blt(bitmap, 0, sy, pw, ph, 0, 0);
            this._bitmaps[pose] = newBmp;
            this._maxFrame[pose] = 2;
            this._nbrLines[pose] = 1;
        }
    } else {
        this._maxFrame[pose] = 2;
        this._nbrLines[pose] = 4;
        this._bitmaps[pose] = bitmap;
    }
    this._frameLoaded++;
};

This should work for sprites of any size, but does still demand they be arranged as usual (eight sheets arranged 4x2, each sheet is 3x4)- so no using the $bigmonster sprites directly, not that you'd necessarily want to anyway considering none of them have multiple facing directions.
whenever an actor or a foe dies, this error pops up on my screen can you help?
whenever an actor or a foe dies, this error pops up on my screen can you help?
can you attach the console output.
As well as what version you're using
As well as the entire notebox for an/the entity that causes this issue.
Im using 0.77.2
cant open the console idk why
here is the notebox:
<letbs_sprite>

pose(idle): use_chara, Evil, 0

pose(dead): use_chara, Damage2, 0, 0

turn_order: auto

status_sprite: auto

</letbs_sprite>
Alright, I can confirm, there is no way as of now to change an actors sprite mid battle. Hopefully Lecode adds something to help.
Im using 0.77.2
So you're using 0.77.2 and not 0.77.2B?
Because that makes things way easier for me, since I do not use version B
But add this plugin to your project, this should enable the console(F8 I believe) But it should open automatically anyway
HEY guys ^^

Anybody knows if we can integrate this for some battle only?
For example you play in default battle system and in the game orcs attack a castle and the combat in tactical mode begin?
Obviously after the fight everything go back to DBS ^^
HEY guys ^^

Anybody knows if we can integrate this for some battle only?
For example you play in default battle system and in the game orcs attack a castle and the combat in tactical mode begin?
Obviously after the fight everything go back to DBS ^^

Just turn off LeTBS and it'll enable other stuff.
Plugin Command:
LeTBS OFF

Alright, I can confirm, there is no way as of now to change an actors sprite mid battle. Hopefully Lecode adds something to help.
I'm looking into it, I'll let you know what I come up with.
@Pharonix is that simple? few month ago some people told me its will be hard to switch because of the engine itself ^^"
@Pharonix is that simple? few month ago some people told me its will be hard to switch because of the engine itself ^^"
It sorta works for me at least:
Just don't see allies, because I don't set side-view chars, because I don't use it.
upload_2019-8-21_11-25-49.png


The Biggest issue is making sure the skills work properly.

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