Lecode Tactical Battle System 0.77.2B

@Pharonix Thanks, that worked! However, I just realized "isActor" simply checks if it's a unit and not if it's a friendly unit. What should I use instead so that I can check if the actor is a player character?
battler.isActor() should be the thing to do it.

In my Counter System, I need to differentiate between normal units and actual Player units
So I use
entity.battler().isActor()

If you need friendly units
TBSAiManager.prototype.isAlly(entity) will be your go-to

I altered these functions myself when I fixed the "charmed" thing.
That was a nightmare to fix and I had to edit many Lecode Functions.
Turns out if (BattleManagerTBS.activeEntity().isActor) { wasn't working after all, it was just using the else function so it seemed like it was working. When I try BattleManagerTBS.activeEntity().battler().isActor instead, I get an error...

Edit: Doh, I forgot the parenthesis again...
BattleManagerTBS.activeEntity().battler().isActor()

I found another issue though, which is more due to the way I approached this problem I think. Basically it's checking whether the current unit performing an action (unit who's turn it is) is an actor instead of checking whether the unit being selected (when the cursor is on a unit's tile) is an actor...what should I do?
Turns out if (BattleManagerTBS.activeEntity().isActor) { wasn't working after all, it was just using the else function so it seemed like it was working. When I try BattleManagerTBS.activeEntity().battler().isActor instead, I get an error...

Edit: Doh, I forgot the parenthesis again...
BattleManagerTBS.activeEntity().battler().isActor()

I found another issue though, which is more due to the way I approached this problem I think. Basically it's checking whether the current unit performing an action (unit who's turn it is) is an actor instead of checking whether the unit being selected (when the cursor is on a unit's tile) is an actor...what should I do?

Try getting the activeCell then getting the battler from that:
BattleManagerTBS._activeCell.getEntity().battler().isActor()
Dang, I just tried it and got "Cannot read property 'batter' of null"... I've also tried the following:
  • BattleManagerTBS._activeCell._Entity.isActor
  • BattleManagerTBS._activeCell._Entity().isActor
  • BattleManagerTBS._activeCell._Entity.isActor()
  • BattleManagerTBS._activeCell._Entity().isActor()
  • BattleManagerTBS._activeCell._Entity().battler().isActor
  • BattleManagerTBS._activeCell._Entity().battler().isActor()
  • BattleManagerTBS._activeCell.getEntity().isActor
  • BattleManagerTBS._activeCell.getEntity().isActor()
  • BattleManagerTBS._activeCell.getEntity().battler().isActor
  • BattleManagerTBS._activeCell.getEntity().battler().isActor()
Dang, I just tried it and got "Cannot read property 'batter' of null"... I've also tried the following:
  • BattleManagerTBS._activeCell._Entity.isActor
  • BattleManagerTBS._activeCell._Entity().isActor
  • BattleManagerTBS._activeCell._Entity.isActor()
  • BattleManagerTBS._activeCell._Entity().isActor()
  • BattleManagerTBS._activeCell._Entity().battler().isActor
  • BattleManagerTBS._activeCell._Entity().battler().isActor()
  • BattleManagerTBS._activeCell.getEntity().isActor
  • BattleManagerTBS._activeCell.getEntity().isActor()
  • BattleManagerTBS._activeCell.getEntity().battler().isActor
  • BattleManagerTBS._activeCell.getEntity().battler().isActor()
can you post the console output?
I'm trying to use letbs, but there is no demo in 0.8. The previous dmoe can't be used in the new script. Who can give me a 0.8 demo to show various effects and functions? Thank you very much.
I'm trying to use letbs, but there is no demo in 0.8. The previous dmoe can't be used in the new script. Who can give me a 0.8 demo to show various effects and functions? Thank you very much.
v0.8 hasn't been released. We're all using v0.77b or earlier...

can you post the console output?
1595017411854.png

This was using BattleManagerTBS._activeCell.getEntity().battler().isActor() as you suggested.
v0.8 hasn't been released. We're all using v0.77b or earlier...


View attachment 151703
This was using BattleManagerTBS._activeCell.getEntity().battler().isActor() as you suggested.
can you send me the full function?

However it seems like it is trying to run it before a cell is selected, so im not entirely sure how to fix that.

Though if i had the full function you put in, I might be able to think of something I hope.
JavaScript:
Window_TBSStatus.prototype.refresh = function () {
    this.contents.clear();
    this._gaugeHeight = null;
    this.resetFontSettings();
    if (!this._entity) return;
    var x, y, w, h;
    //- Face
    if (BattleManagerTBS._activeCell.getEntity().battler().isActor()) {
        this.drawFace();
    } else {
    this.drawSprite();
    }
    //- Name
    x = Lecode.S_TBS.Windows.statusWindowSpriteBoxW;
    y = -4;
    this.contents.fontSize += 3;
    this.changeTextColor(this.systemColor());
    this.leU_drawText(this._entity.battler().name(), 0, y + 56);
    this.contents.fontSize -= 3;
    //- HP Gauge
    y += this.lineHeight() - 8;
    this.drawActorHp(this._entity.battler(), x, y + 3, 156);
    //- MP Gauge
    y += this.lineHeight() - 8;
    this.drawActorMp(this._entity.battler(), x, y + 3, 156);
    //- TP Gauge
    if (Lecode.S_TBS.Windows.statusWindowShowTP) {
    y += this.lineHeight() - 8;
        this.drawActorTp(this._entity.battler(), x, y + 3, 156);
    }
    //- Move Points
    if (Lecode.S_TBS.Windows.statusWindowShowMovePoints) {
        y += this.lineHeight() + 4;
        var mp = this._entity.getMovePoints();
        var gw = (130 - mp * 4) / mp; //14
        x++;
        for (var i = 0; i < mp; i++) {
            this.contents.fillRect(x, y, gw, 2, this.textColor(Lecode.S_TBS.Windows.movePointsColor));
            x += gw + 4;
        }
    }
    // - States
    x = 2;
    y -= this.lineHeight();
    var max = Lecode.S_TBS.Windows.statusWindowMaxStates;
    this.drawActorIcons(this._entity.battler(), x - 2, y - 46, Window_Base._iconWidth * 8);
};
Also, I'm aware this.drawFace(); is probably incorrect, but at this point I'm just trying to get it to select the unit. I'll worry about drawing the portrait afterwards.

Edit: I noticed there's a plugin called LeChoiceWindow.js and was wondering what it did. Could it perhaps be used in a similar fashion to SRD's Skill Extender? (lol, just getting my hopes up)
it's been like 2 years, can we just assume that lecode is never coming back?
it's been like 2 years, can we just assume that lecode is never coming back?
His last update was actually like 6 months ago.
I took letbs documentation 0.8 as the version number. Sorry
Didn't the author post the content in the blog?

I choose auto combat when I run LeTBS_0772Bdemo. What's the matter
QQ图片20200719031743.png
Is it possible to have a single target Taunt instead of it affecting the entire enemy troop? Likewise with focused_by_ai_for_[type]: priority, is there a way to single target this?
QQ图片20200720045356.png

Demo how to solve these bugs
View attachment 151862
Demo how to solve these bugs
What did you change? Please give us some context...
What did you change? Please give us some context...

I didn't make any changes, just downloaded the demo,
Then automatic combat was selected



And these aren't the latest versions? https://github.com/LecodeMV/leTBS
I didn't make any changes, just downloaded the demo,
Then automatic combat was selected



And these aren't the latest versions? https://github.com/LecodeMV/leTBS
I just tried it on an untouched demo project, and it works just fine for me...
I just tried it on an untouched demo project, and it works just fine for me...
I didn't modify anything. Letbs is the most satisfying thing for me. I don't know what I should do now. You are also using letbs_ 0772b. Rar demo?
I didn't modify anything. Letbs is the most satisfying thing for me. I don't know what I should do now. You are also using letbs_ 0772b. Rar demo?
Yep, I'm also using v0.77.2b, if you haven't changed anything, it should work for u...

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