Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,370
Reaction score
1,985
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
Veteran
Joined
Feb 22, 2016
Messages
2,370
Reaction score
1,985
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
Veteran
Joined
Feb 22, 2016
Messages
2,370
Reaction score
1,985
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
3
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
Veteran
Joined
Feb 22, 2016
Messages
2,370
Reaction score
1,985
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

Veteran
Veteran
Joined
Nov 19, 2012
Messages
94
Reaction score
20
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:

Latest Threads

Latest Posts

Latest Profile Posts

You thought kids rooms were messy. Look at this.
Back in the house and I'm hungry
Yoshi!
DNPwhy.gif

You're using that item wrong... TwT

Trying to get the mechanics down for a cute, story-driven board game! I think I've accomplished dice movement, item effects, and activating a space's event when you land on it. Art is WIP. Hope to open a thread about the game soon!
My entire family and I have Covid... If it's this bad with the vaccine, without must be terrible. Stay safe, everyone. This thing is a doozy.

Forum statistics

Threads
118,527
Messages
1,116,646
Members
155,544
Latest member
Merodu
Top