Lecode Tactical Battle System 0.77.2B

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
@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.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,113
Reaction score
787
First Language
English
Primarily Uses
RMMV
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?
 
Last edited:

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
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()
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,113
Reaction score
787
First Language
English
Primarily Uses
RMMV
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()
 
Last edited:

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
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?
 

huoixn

Veteran
Veteran
Joined
Mar 11, 2019
Messages
32
Reaction score
1
First Language
Chinese
Primarily Uses
RMMV
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.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,113
Reaction score
787
First Language
English
Primarily Uses
RMMV
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.
 

Pharonix

Shadow Walker
Veteran
Joined
Apr 22, 2012
Messages
747
Reaction score
340
First Language
English
Primarily Uses
RMMV
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.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,113
Reaction score
787
First Language
English
Primarily Uses
RMMV
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)
 
Last edited:

chengsta

Veteran
Veteran
Joined
Jan 14, 2019
Messages
53
Reaction score
7
First Language
english
Primarily Uses
RMMV
it's been like 2 years, can we just assume that lecode is never coming back?
 

huoixn

Veteran
Veteran
Joined
Mar 11, 2019
Messages
32
Reaction score
1
First Language
Chinese
Primarily Uses
RMMV
I choose auto combat when I run LeTBS_0772Bdemo. What's the matter
QQ图片20200719031743.png
 

Pootscooter

Veteran
Veteran
Joined
Jun 7, 2020
Messages
41
Reaction score
10
First Language
Mandarin
Primarily Uses
RMMV
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?
 

huoixn

Veteran
Veteran
Joined
Mar 11, 2019
Messages
32
Reaction score
1
First Language
Chinese
Primarily Uses
RMMV
QQ图片20200720045356.png
Demo how to solve these bugs
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,113
Reaction score
787
First Language
English
Primarily Uses
RMMV

huoixn

Veteran
Veteran
Joined
Mar 11, 2019
Messages
32
Reaction score
1
First Language
Chinese
Primarily Uses
RMMV
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?
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,113
Reaction score
787
First Language
English
Primarily Uses
RMMV
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...
 

Users Who Are Viewing This Thread (Users: 1, Guests: 7)

Latest Threads

Latest Posts

Latest Profile Posts

Stream will be live shortly with some Darkest Dungeon! Feel free to drop by!
Unpopular opinion: I always consider my players as my guinea pig for my experiment (my game) :p
Error brain.exe is not responding. Shutdown and run pillow.exe and bed.exe instead?

Forum statistics

Threads
100,447
Messages
976,037
Members
132,082
Latest member
nwr
Top