Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Is this a repost or a newer edit of the counter plugin?
It's a repost since some people may not know about it. That's why I attached it.
 
Last edited:

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
@Frostorm You still crashing out LeTBS with supertools?

I just got it working by exempting all of the leTBS windows like so:

1637501772138.png

You can just copypaste this in to the text version of that param if you don't want to hunt down all the window names.
Code:
["Window_BattleLog","Window_MapName","Window_TBSPositioning","Window_TBSConfirm","Window_TBSStatus","Window_TBSCommand","Window_TBSSkillList","Window_TBSItemList","Window_TBSEndCommand","Window_TBSAutoMode","Window_TBSEntityHud","Window_TBSScan","Window_TBSSkillBubble","Window_TBSEntityTurn","Window_TBSWinConditions","Window_TBSPositioningConfirm",""]

and when I hit an error checked out the console and started tracking down errors.

For whatever I had to bypass an error check in YEP_EnhancedTP as well:

JavaScript:
//=============================================================================
// Utilities
//=============================================================================

Yanfly.Util = Yanfly.Util || {};

if (!Yanfly.Util.toGroup) {
    Yanfly.Util.toGroup = function(inVal) {
        return inVal;
    }
};

Yanfly.Util.getRange = function(n, m) {
    var result = [];
    for (var i = n; i <= m; ++i) result.push(i);
    return result;
};

Yanfly.Util.onlyUnique = function(value, index, self) {
    return self.indexOf(value) === index;
};

Yanfly.Util.displayError = function(e, code, message) {
  console.log(message);
  console.log(code || 'NON-EXISTENT');
  console.error(e);
  if (Utils.RPGMAKER_VERSION && Utils.RPGMAKER_VERSION >= "1.6.0") return;
   if (Utils.isNwjs() && Utils.isOptionValid('test')) {
   /* if (!require('nw.gui').Window.get().isDevToolsOpen()) {
      require('nw.gui').Window.get().showDevTools();
    } */
  }
};

I've got supertools running, used the menu editor to edit non-LeTBS menus like yanfly item core, and LeTBS runs fine, including the debug menus to give items in the middle of battle and stuff.

1637502020727.png
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
Alright awesome. Here's a puzzler for ya.

Trying to set up enemy battler sprites, right. My rat has a functioning idle sprite set and the following note tags:


Code:
<letbs_sprite>
pose(idle): _idle, 4
turn_order: auto
status_sprite: auto
</letbs_sprite>

Status and turn order sprites are generated properly at the beginning of the battle, but as soon as I get to the end of the first turn (As in full combat turn, after all battlers have moved) I crash out with the following on the error stack:

Code:
TypeError: Cannot read property 'width' of undefined
    at TBSTurnOrderVisual.getSpriteBitmap (LeTBS_RTPUse.js:194)
    at TBSTurnOrderVisual.makeSprites (LeTBSTurnOrderA.js:241)
    at TBSTurnOrderVisual.refresh (LeTBSTurnOrderA.js:204)
    at TBSTurnOrderVisual.set (LeTBSTurnOrderA.js:169)
    at Function.BattleManagerTBS.determineTurnOrderFair (LeTBS.js:2984)
    at Function.BattleManagerTBS.determineTurnOrder (LeTBS.js:2931)
    at Game_Interpreter.interpretLeTBS_AddEntity (LeTBS.js:11673)
    at Game_Interpreter.pluginCommand (LeTBS.js:11185)
    at Game_Interpreter.pluginCommand (LeTBS_WinConditions.js:102)
    at Game_Interpreter.pluginCommand (YEP_EventMiniLabel.js:223)

The line in question in LeTBS_RTPUse seems like it shouldn't have a problem assembling the sprite (indeed it did it at the start of battle):

JavaScript:
/*-------------------------------------------------------------------------
* TBSTurnOrderVisual
-------------------------------------------------------------------------*/
Lecode.S_TBS.RTPUse.oldTBSTurnOrderVisual_getSpriteBitmap = TBSTurnOrderVisual.prototype.getSpriteBitmap;
TBSTurnOrderVisual.prototype.getSpriteBitmap = function (entity) {
    var battler = entity._battler;
    var object = battler.rpgObject().TagsLetbsSprite.turnOrder;
    if (object && object.match(/auto/i)) {
        var sprite = entity._sprite;
        var fbitmap = sprite._bitmaps["idle"];
        var bitmap = new Bitmap(40, 40);
        var pw = fbitmap.width / (sprite._maxFrame["idle"] + 1); //<------ This one is the crash
        var ph = fbitmap.height / 4;
        var y = ph <= 40 ? 0 : 6;
        bitmap.blt(fbitmap, pw / 2 - 20, y, 40, 40, 0, 0);
        return bitmap;
    }
    return Lecode.S_TBS.RTPUse.oldTBSTurnOrderVisual_getSpriteBitmap.call(this, entity);
};

This error seems to be telling me that fbitmap was never defined, which i don't get as the unit is obviously using its proper idle sprite all over the place before it calls this on the turn changes.

you you using LeTBS_RTPUse, and if so, does this TBSTurnOrderVisual function match yours?
 
Last edited:

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Yea, I was having issues w/ LeTBS_RTPUse.js as well, which mostly stems from my use of custom (and varying) sprite sizes. Thus, I had no other choice than to set up each enemy the normal way (tedious, I know). That is quite a strange bug you got there... add a console.log(fbitmap) right before or after the line that says if (object && object.match(/auto/i)) {. Let's see what happens...
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
after some further investigation it seems to be something wrong with the event the demo scene calls on turn 2, likely the sprite referenced isn't my rats but one of the units that spawns during that event. Strange, as the bandits that spawn have just the same note tags as the demo, and the scene, in general is unchanged from the demo, and was working before I replaced the default enemies in the troop with my rats.


Code:
<letbs_sprite>
pose(idle): use_chara, Evil, 0
pose(dead): use_chara, Damage2, 0, 0
turn_order: auto
status_sprite: auto
</letbs_sprite>
 

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
So umm...anyone got MZ and wanna try LeTBS w/ FOSSIL? lol...
 

qiujunkun77

Villager
Member
Joined
Jul 25, 2017
Messages
5
Reaction score
0
First Language
中文
Primarily Uses
RMMV
Hi,may I know how to set up the enemy AI,so that he is willing to resurrect his teammates?
 

bbvmhh

Warper
Member
Joined
Oct 15, 2021
Messages
4
Reaction score
0
First Language
eng
Primarily Uses
RMMV
View attachment 205452
Code:
<swordANDshield>
  <Custom Passive Condition>
  if (user.isStateAffected(204) && user.isStateAffected (205)) {
    BattleManagerTBS.activeBattler().addNewState(210);
    condition = true;
  } else {
    BattleManagerTBS.activeBattler().eraseState(210);
    condition = false;
  }
  </Custom Passive Condition>

Tried both syntaxes. Seems like in either case yanfly can't properly talk to LeTBS. maybe I got the syntax wrong or something.

I'm considering just ripping out the auto-state stuff and doing the same condition comparisons directly in the LeTBS functions in stead. That would work, but it wouldn't solve the problem I'd really like to solve which is getting the yanfly conditional tags to work so I can use them for other stuff later in a similar fashion to automate state interactions.

Edit: SOLVED it.

Turns out the real problem was that yanfly auto passives aren't ACTUALLY removed under any circumstances, and thus the LeTBS functions weren't triggering because according to LeTBS the SwordANDShield state was still there (even though its icon stopped existing in the buff monitor and any effects it had were removed)

So here's what I did, very simple:
Made a single global auto-state, called it Dual_Wield_Manager
Removed the custom scripting from the SwordANDshield state so it just has the meta tag my sprite changing code checks.

Set up the yanfly note tags thus:
Code:
  <Custom Passive Condition>
  if (user.isStateAffected(204) && user.isStateAffected (205)) {
    user.addState(210);
  } else {
    user.removeState(210);
  }
  </Custom Passive Condition>

Then just repeated that for each dual wield case. Now that the state is actually added or removed appropriately, it works just like it should. Arban spawns in to battle with both his sword and shield, I dispel the sword, his sprite is updated to be holding just the shield. I can still read the dual wield states for evals on abilities and stuff like I wanted, and in general everything works perfectly (aside from needing to add some note tags to remove the popups from the invisible states when removed)

Turns out I the problem all along wasn't that LeTBS wasn't seeing a state change, but that as far as LeTBS was concerned the state wasn't changing at all!

Here's a video!


Interesting. i want to know more
such as attach poses image
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
Interesting. i want to know more
such as attach poses image
Pose image is set up the same as the idle pose. Its just the same sprite with the weapons equipped. In this instance I have poses and sprite sheets for _idle, _sword_Equipped, _shield_Equipped, _sword_and_shield

This was a big workaround for not having actual overlay sprites (a feature that was going to be in 0.8) and it does require actually making sprites/poses for any possible combinations you want a unit to be able to equip.

All my swords have the sword state on them, which also unseals any sword skills the unit uses, as different classes have aslightly different set of sword skills. That state automatically adds the sword_equipped state. The "equipped" state is tracked to update the sprite. Its done this way because LeTBS reads "real" adding and removal of states, but yanfly auto states are never "really" removed. Therefore all the auto states generally exist just to apply a removable "real" state at the start of battle if I need to use it for a sprite update.

This means anywhere I want to have a custom sprite I can just easily write code control for the sprite on states and all I have to do for the LeTBS setup is add another pose.

The little invisible eval state common to all units there just basically says "if this unit has both the sword and shield states, then give it the 'sword and shield' state, if it does not, remove that state" and I have versions of this for all the possible combinations of 1h weapons in my game. This means when a sword is disarmed, as in the video, it removes the state, LeTBS sees a state removed, and it runs my sprite code to check if there are any states that should override idle. In this case the unit still has the Shield_Equipped state, so it switches the sprite according to that pose since it is now the highest ordered (and only) pose with a state attached.

Those states have no icon, and generally don't do anything themselves, but my sprite code reads them and updates the sprite accordingly. For instance, only units currently effected with one of the dual wield states can be targeted with a disarm ability, as I only allow dual wielders to be disarmed.

You could use the same setup to have state combinations for "if this unit is poisoned and equipping sword/mace, then use the pose _Sword_and_mace_poisoned" or change the sprite if all the items from a set are equipped, or have an ability or item that adds a dummy state to have like a werewolf transformation or ultimate form, etc. you'd just need to make a lot more sprite sheets.

Its not as nice as having proper layers for sprites, takes more setup, but it does the job and works. It isn't really abstract enough to use outside my game since I just hardcode in any states/poses I need for the system.
 
Last edited:

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
I was thinking about overlay sprites... so what if we reverse engineer the BattleManagerTBS.activeEntity().addPopup() or BattleManagerTBS.activeEntity().addTextPopup() function? Since they are able to lock onto the unit's position on the screen and display something relative to that position. Basically, instead of showing text, we show a sprite instead. Thoughts?
 

PopeUrban

Villager
Member
Joined
Oct 19, 2021
Messages
20
Reaction score
7
First Language
English
Primarily Uses
RMMV
I was thinking about overlay sprites... so what if we reverse engineer the BattleManagerTBS.activeEntity().addPopup() or BattleManagerTBS.activeEntity().addTextPopup() function? Since they are able to lock onto the unit's position on the screen and display something relative to that position. Basically, instead of showing text, we show a sprite instead. Thoughts?
Honestly I no longer have a use case for it since my entire workflow is optimized around discreet sprite flips now. It would be cool but I have so much to do on my project alone I can't really devote much time to features I'm not actually using.
 

Siul

Regular
Regular
Joined
Nov 19, 2012
Messages
109
Reaction score
22
First Language
Spanish
Primarily Uses
I already posted on plugin request but I have to ask here too: Any chances to port this plugin to MZ?
 

jazhoom

Warper
Member
Joined
Dec 30, 2021
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello everyone. First time poster here.
I recently got into RPG Maker MV, and want to try making a Tactics style game.
I downloaded the demo the is available from page 1 of this thread, but when I use certain abilities the game crashes.
At first Ice Wall and Mega Spark were giving me trouble but I figured those out on my own.
I can't get Fire Support to work though. If no allies are standing next to the enemy, I can use it. If an ally is standing next to the enemy, it crashes with cannot ready property "isAttack" error.

Any ideas?
 
Last edited:

GatesOfAvalon

Villager
Member
Joined
Apr 25, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello to anybody who's still active here,
I've been using this plugin for a few months but just now having a problem I can't seem to solve on my own. I've tried using the plugin command "LeTBS HideEntity" on an actor, which works, but when it gets to the point in the turn order when the actor should act, the game crashes with the error 'Cannot set property 'bitmap' of null'. This happens even if the actor has a state that stops it from acting.
 
Last edited:

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Hello to anybody who's still active here,
I've been using this plugin for a few months but just now having a problem I can't seem to solve on my own. I've tried using the plugin command "LeTBS HideEntity" on an actor, which works, but when it gets to the point in the turn order when the actor should act, the game crashes with the error 'Cannot set property 'bitmap' of null'. This happens even if the actor has a state that stops it from acting.
Can you press "F8" when the error occurs and screenshot the console, please?
 

ZenJestr

Warper
Member
Joined
Oct 16, 2021
Messages
1
Reaction score
0
First Language
Spanish
Primarily Uses
RMMV
Is it possible to "turn off" this plugin for certain battles? Let's say I want to use this tactics system for standard mobs but use the default MV battle system for large bosses, is this possible? Or am I stuck with one or the other, but not both?
 

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Is it possible to "turn off" this plugin for certain battles? Let's say I want to use this tactics system for standard mobs but use the default MV battle system for large bosses, is this possible? Or am I stuck with one or the other, but not both?
Yes, totally doable. The script call is: Lecode.S_TBS.commandOn = true; or false if you want it off.

Edit: plugin command is...
  • LeTBS ON
  • LeTBS OFF
 
Last edited:

Frostorm

[]D[][]V[][]D
Regular
Joined
Feb 22, 2016
Messages
2,788
Reaction score
2,236
First Language
English
Primarily Uses
RMMV
Does using <Enemy Cell: index> instead of <Enemy Cell> work for you guys? I tried to set up a 2 enemy troop with <Enemy Cell: 0> & <Enemy Cell: 1> but it doesn't seem to have any effect. The monsters still randomly appear in either cell. So half the time they are in the wrong cell. Basically, the player will see a Spearman and a Defender on the field (visible encounters), but once you engage them, the 2 will sometimes switch spots!

1645603817836.png
1645603791695.png

So I went and took a look at the code in LeTBS.js...
JavaScript:
BattleManagerTBS.createStartCells = function () {
    this.getLayer("scopes").clear();
    this._startCells = [];
    $gameMap.events().forEach(function (eventObj) {
        var x = eventObj.x;
        var y = eventObj.y;
        var note = eventObj.event().note;
        var data = {};
        if (note.match(/<Enemy Cell>/i)) {
            data.type = "enemy";
        } else if (note.match(/<Enemy Cell\s?:\s?(.+)>/i)) {
            data.type = "enemy";
            data.fixed = Number(RegExp.$1);
        } else if (note.match(/<Actor Cell>/i)) {
            data.type = "actor";
        } else if (note.match(/<Actor Cell\s?:\s?(.+)>/i)) {
            data.type = "actor";
            data.fixed = Number(RegExp.$1);
        }
        if (data.type) {
            var cell = new TBSCell(x, y);
            cell._event = eventObj.event();
            cell._positioningData = data;
            this.createPositioningCell(data.type, x, y, cell);
            this._startCells.push(cell);
            if (!this._entitiesEvents[x])
                this._entitiesEvents[x] = {};
            this._entitiesEvents[x][y] = eventObj;
        }
    }.bind(this));
};
Looks like it sets data.fixed to equal w/e index # you put in the event's note. But then it doesn't seem to do anything with data.fixed! So that explains why I'm not seeing any difference using <Enemy Cell: index> vs <Enemy Cell>. Idk what to do...please HALP!
 

Latest Threads

Latest Profile Posts

Me with the fireplace, a space heater, and a heated blanket. My preferred lizard temperature.

I'm gonna riff on Macross's "Deculture" and adopt "Descope" as my motto! :wub God knows I'm gonna need it...

As an aside, did any of ya sweeties watch Macross Delta and if so, was it good, bad, or horrible?
Is an extension for the jam time limit from 20 min to 30 min possible? :ysad::ysad::ysad: My entry will have a few battles, it seems >.<
Background and composition study
GAbBmfDaIAAEzVM

Forum statistics

Threads
136,715
Messages
1,269,041
Members
180,431
Latest member
ZOOMNOTA
Top