Lecode Tactical Battle System 0.77.2B

Just finished putting in all of the Notetags to make the plugin run, but how do I event it so that a Battle starts once I transfer the player to a new map?
make an event that is autorun in your very first map that your character starts on. Invisible and hidden away somewhere. And then use plugin command in that event. Write 'LeTBS ON' for your plugin command, without the parenthesis. That will automatically turn your battle system into lecodes battle system.
@Black Mamba someone else a few pages back had been attempting to implement a height system, but will probably need to redo it for the new version. As it stands, height systems are made awkward by the fact that RPGMaker doesn't do isometric, so your fake height (north pretends to be up) results in your maps being really weird, and usually not working the way you'd like.
@Black Mamba someone else a few pages back had been attempting to implement a height system, but will probably need to redo it for the new version. As it stands, height systems are made awkward by the fact that RPGMaker doesn't do isometric, so your fake height (north pretends to be up) results in your maps being really weird, and usually not working the way you'd like.

I thought in doing it by regions, the dev set the region, higher region, higher the height


@Pharonix where can i download your height system?
@SKBrook , @chengsta something a lot of people don't realize is that transferring to a new map doesn't automatically end the event- you can just set up and start your battle after the transfer, then transfer back after the battle finishes, all inside the same event. I'm partial to this method as it keeps things organized, and means I could use the same map for different battles, if I wanted to.
Got all the eventing done, however, when I start the battle it gives me this error in the Dev Console
So I'm having some problems with the demo. Whenever I use the Mana Ball it gives me a type error saying that it 'cannot read property 'getCell' of null' and when I use mega spark it says 'this._sequence.unshift is not a function'.

This is with the base demo and no extra plugins or anything added. Anybody have any insights?
Hello, do you know how to make a certain types of trap disappear when a skill is used, by example, the skill water destroy all of the trap fire on the map ?
I have a problem using a RTP that uses different character sprite proportion than the original MV RTP. I'm using Time Fantasy RTP and whatever I do I keep getting cropped out characters (both actors and enemies) that are constantly flashing out in between different indexes.

I tried out a bunch of stuff but by importing a normal, original RTP character, it showed up in battle normally.

So... how do I make the script use Time Fantasy characters without bugs? btw character images with 8 sprites are 936x864, while individual characters are 234x432.

Any help is appreciated!
in the note tags, try changing the number to 1 if the sprite poses only have 1 frame.
Chengsta, I was wondering if you could help me. I've been trying to implement the back_dmg_bonus to skills, but I havent been able to do it. I even tested on my pure demo version and it wasn't working. I couldnt even get it to work as a state. The only way I could get the directional damage to change was by directly changing it in the LeTBS plugin which affects everyone.

I put it in exactly as you said:

<letbs>
scope: circle(1)
back_dmg_bonus: 500%
</letbs>

The 500% was for testing purposes.
So, I see that this forum is still very active and I hope that someone has the answer to my predicament. I sat down the other day to give this plugin another go and ran into a problem. I was trying to implement taller sprite graphics, standard 48 width but 96 pixels tall and I get a problem. When I go to start a battle the character is either cut off or -if I upload an image of the sprite to the img/battlers, then they flicker. Is there something obvious I'm missing here? It's clear by some of the sprites in the demo its possible and I remember someone else saying they were using taller sprites too. I am scrstching my head over here.
in the note tags, try changing the number to 1 if the sprite poses only have 1 frame.
Thank you for the reply, I tried adding 1 after the "use_chara" tag, if that's what you meant, but saw no changes. Right now my actor note tag looks like this:


<letbs_sprite>

pose(idle): use_chara

pose(dead): use_chara

turn_order: auto

status_sprite: auto

</letbs_sprite>


I tried adding ",1" in different places to no effect. Should it be somewhere else?

Another question: my enemies seem to fly over tiles that should be blocking or over them (like water and tree tops). Am I missing something? Unfortunetly the documentation in the first post is no longer avaliable
@Leon_Artmann it's under the "old documentation" link, near the top of the new documentation page.

There are some issues with the RTPUse plugin that make it not work for anything other than 48x48 sprites- I can try to post the fixes I made to it tonight.
Chengsta, I was wondering if you could help me. I've been trying to implement the back_dmg_bonus to skills, but I havent been able to do it. I even tested on my pure demo version and it wasn't working. I couldnt even get it to work as a state. The only way I could get the directional damage to change was by directly changing it in the LeTBS plugin which affects everyone.

I put it in exactly as you said:

<letbs>
scope: circle(1)
back_dmg_bonus: 500%
</letbs>

The 500% was for testing purposes.
oh shoot you know what? I screwed up. I'm sorry, it doesn't work. I just tried it again, and I realized that I was using the wrong skill. it only works on actors and states.
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.
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.

Thanks for helping out, Doktor! I managed use the taller sprites without cropping or flickering by turning OFF "the LeTBS_RTPUse.js" and editing the "leTBSconfig.js": I just had to specify that the number of columns that the new battler I added had .

However, it would really be helpful to just use the RTPUse plugin so that I could just use the "use_character" command in the actor notes. I couldn't make it work because, by changing the functions you told me to, I got the error I "Cannot read property 'match' of undefined". What have I forgot to define?


Again, thank you very much for the help!

upload_2019-5-7_17-34-51.png
anyone else notice that there are a lot of little things broken with lecode's battle system? For example, if statements not counting variables when states are involved. Force actions not working, enemies/allies aura still operates even when they're dead and gone, troop events don't run, etc?
anyone else notice that there are a lot of little things broken with lecode's battle system? For example, if statements not counting variables when states are involved. Force actions not working, enemies/allies aura still operates even when they're dead and gone, troop events don't run, etc?
Yes. That's probably part of the reason lecode has decided it would be best to do a full reboot of the underlying code.
is it possible at all to remove the whole set-up for the battle? as in, instead of putting up actor and enemy cells, just making the battle work with events (enemies) and keeping the party position as it was before the battle started?

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