RMMV YEP_X_InBattleStatus.js via Common Event? (edit: also YEP_X_ChangeBattleEquip)

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,598
First Language
English
Primarily Uses
RMMV
Hi, I'm looking for a way to bring up the "InBattleStatus" scene via a Common Event. The plugin only has 2 plugin commands and those are only to show/hide the command itself during the battle scene. This doesn't work for me since I'll never be in the default battle scene due to me using LTBS. So I thought linking an LTBS command to a Common Event that brings up Yanfly's "InBattleStatus" screen might work. All I need is the scriptcall to manually call it.


I think one of these code blocks might contain what I need, but I'm too noob to tell lol...
JavaScript:
//=============================================================================
// Window_InBattleStatus
//=============================================================================

function Window_InBattleStatus() {
    this.initialize.apply(this, arguments);
}

Window_InBattleStatus.prototype = Object.create(Window_Base.prototype);
Window_InBattleStatus.prototype.constructor = Window_InBattleStatus;
JavaScript:
//=============================================================================
// Window_BattleStatus
//=============================================================================

Window_BattleStatus.prototype.setInBattleStatusWindow = function(win) {
  this._inBattleStatusWindow = win;
};
JavaScript:
//=============================================================================
// Scene_Battle
//=============================================================================

Yanfly.IBS.Scene_Battle_createAllWindows =
  Scene_Battle.prototype.createAllWindows;
Scene_Battle.prototype.createAllWindows = function() {
  Yanfly.IBS.Scene_Battle_createAllWindows.call(this);
  this.createInBattleStatusWindows();
};

Scene_Battle.prototype.createInBattleStatusWindows = function() {
  this._inBattleStatusWindow = new Window_InBattleStatus();
  this.addChild(this._inBattleStatusWindow);
  var win = this._inBattleStatusWindow;
  this._inBattleStateList = new Window_InBattleStateList(win);
  this._inBattleStateList.setHelpWindow(this._helpWindow);
  this._inBattleStateList.setStatusWindow(this._statusWindow);
  this.addChild(this._inBattleStateList);
  this._inBattleStateList.setHandler('cancel',
    this.onInBattleStatusCancel.bind(this));
  this._statusWindow.setInBattleStatusWindow(this._inBattleStateList);
};

Yanfly.IBS.Scene_Battle_createPartyCommandWindow =
  Scene_Battle.prototype.createPartyCommandWindow;
Scene_Battle.prototype.createPartyCommandWindow = function() {
  Yanfly.IBS.Scene_Battle_createPartyCommandWindow.call(this);
  var win = this._partyCommandWindow;
  win.setHandler('inBattleStatus', this.commandInBattleStatus.bind(this));
};

Scene_Battle.prototype.commandInBattleStatus = function() {
  this._helpWindow.show();
  this._inBattleStatusWindow.show();
  this._inBattleStateList.show();
  this._inBattleStateList.activate();
  this._inBattleStateList.setBattler($gameParty.battleMembers()[0]);
  if (Imported.YEP_X_PartyLimitGauge) {
    this._showPartyLimitGauge = $gameSystem.isShowPartyLimitGauge();
    this._showTroopLimitGauge = $gameSystem.isShowTroopLimitGauge();
    $gameSystem.setShowPartyLimitGauge(false);
    $gameSystem.setShowTroopLimitGauge(false);
  }
};
Let me know if I need to remove the code I pasted since it's a paid plugin. My thinking is that since it's only a small fraction of the plugin, it can't actually be used w/ just what I posted.

Edit:
I also need to do the same w/ YEP_X_ChangeBattleEquip.js, which I think will require a similar solution.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,778
Reaction score
7,872
First Language
German
Primarily Uses
RMMV
due to me using LTBS.
it would really help your topics (this one as well as past ones) if you would bother to explain what LTBS is for those who don't know, and link to its website...
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,598
First Language
English
Primarily Uses
RMMV
it would really help your topics (this one as well as past ones) if you would bother to explain what LTBS is for those who don't know, and link to its website...
Good idea, will do. LTBS = LeCode's Tactical Battle System which is a very deep TBS plugin for MV, however the developer (LeCode) is no longer active. Here's his documentation page. For the purposes of this thread, all you need to know is that using this plugin means the game no longer uses the side-view battle scene, having the battles take place on the map instead. Hence, none of the usual battle commands (Fight, Status, Escape, etc...) are available. LTBS includes its own command system instead that allows you to put in your own commands (skill or item or common event) as well as a few it comes w/ (move, attack, guard, pass, etc...).

So I'm basically trying to use a Common Event to call up these 2 Yanfly plugins, but I need the script call/code to do so. For this thread, the detail of LTBS doesn't really matter imo. I just need these plugins in the form of a Common Event. So I think we should just pretend LTBS doesn't exist for this matter and focus on the Common Event instead.
 
Last edited:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
835
Reaction score
526
First Language
English
Primarily Uses
RMMV
Unfortunately, I don't think you'll be able to do this without heavily editing the YEP_X_InBattleStatus plugin. From what you pasted, the windows it draws are extensions to the battle scene, and LTBS doesn't take place inside a battle scene, as far as I know.

The plugin would either need to be edited to draw windows on the map scene, which is probably going to be tricky, because the windows can make a lot of assumptions about information they have access to in battle, but on the map, a lot of that info isn't readily present or available at all, and some of the info that is available is stored entirely differently.

What you're probably better off doing is making your own status window to be called from the map scene. You could just push the menu status scene on top of the map scene directly, but you'd probably need to edit something a bit to make you cancel out to the map instead of the main menu.

You could use a hud plugin like SRDs to make a big status window that can be called on and off from a common event. Or you could try to use the common event menu plugins from YEP to make it. Both of these are designed to work on the map scene, and the common event menu is even designed to be called from a common event.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,778
Reaction score
7,872
First Language
German
Primarily Uses
RMMV
@Frostorm
The answer of the poster above is basically the reason why I asked, because I guessed something similar - that your game places the battles on the maps.
and the map is drastically different than placing something on the scene - even if you found the script call to open the screens programmed by yanfly, they would be on the battlescreen and need battlerdata that simply doesn't work with an on-map-battlesystem.

I think yyour best option is to request a new plugin that creates the screens you want as independent screens and add-ons to the LTBS.
 

Frostorm

[]D[][]V[][]D aka "Staf00"
Veteran
Joined
Feb 22, 2016
Messages
1,846
Reaction score
1,598
First Language
English
Primarily Uses
RMMV
@ramza Hmm, I guess this is gonna be a lot harder than I thought then. So basically what you're saying is I have to create the status menu from scratch? I do have both SRD HUD plugin as well as Yanfly's Common Event Menu plugin.

Edit: Ok, actually I looked into LTBS and I think it actually does take place in the battle scene...except its just made to LOOK like the map scene. It basically takes a screenshot of the map you were on and places that as the background. Then it draws all the units using character sprites instead of SV sprites. This is the 1st function under the "Scene Battle" Section of LTBS:
JavaScript:
/*-------------------------------------------------------------------------
* Scene_Battle
-------------------------------------------------------------------------*/
Lecode.S_TBS.oldSB_create = Scene_Battle.prototype.create;
Scene_Battle.prototype.create = function () {
    if (Lecode.S_TBS.commandOn) {
        Scene_Base.prototype.create.call(this);
        this.createDisplayObjects();
    } else {
        Lecode.S_TBS.oldSB_create.call(this);
    }
};
Would this change the situation for me at all? Is there still a script call/code I can use to call the InBattleStatus (IBS) screen? For instance, what would be the correct syntax if I were NOT using LTBS and was trying to call the IBS via a Common Event?

I think yyour best option is to request a new plugin that creates the screens you want as independent screens and add-ons to the LTBS.
I would be wiling to pay for this, but it seems like everyone avoids anything to do w/ LTBS like the plague lol. I already have a Classifieds thread from several days ago for various LTBS fixes I need, but got no responses.

I was really hoping to at least get ChangeBattleEquip (CBE) working, to take advantage of @ramza's amazing DW plugins in combat. (i.e. switching from 1H mode to 2H mode or swapping weapons altogether). Wouldn't the CBE plugin be an easier one to implement compared to InBattleStatus (IBS) since it basically just opens up the equip scene?
 
Last edited:

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
835
Reaction score
526
First Language
English
Primarily Uses
RMMV
@Frostorm I looked at the plugin for a minute, and if this does take place in the battle scene, you should be able to call the function that is called when you would normally hit the status command. Based on what I'm looking at, that's going to be Scene_Battle.prototype.commandInBattleStatus(), so from your common event, try putting in a script call this.commandInBattleStatus(). If you run into issues closing the window after, take a look at the command to close it. It looks like it activates the party command window when you close the status window, so you might need to edit that to make it activate a different window.

Edit:
If that script call doesn't work, try SceneManager._scene.commandInBattleStatus() instead.
 

Latest Threads

Latest Posts

Latest Profile Posts

3am me: So how do you feel about a character inviting their own character portrait to a tea party? =D

3pm me: //facepalms
I turned 17 two months ago and I feel like I've grown (personality-wise) more in this 1 year than all the 16 years I had lived combined.
Ugh, I may have been cumbersomely eventing a bunch of stuff I could have easily done changing the tileset "Passage (4 dir)" and "Ladder" options. Oops :D
I have no idea why some of the program "splash screen" always on top. E.g, RMMZ loading screen stuck on the top blocking anything I want to do until it fully loaded. What is even the purpose?
One of the secret places in the game.

Forum statistics

Threads
107,640
Messages
1,031,078
Members
139,764
Latest member
servalchan
Top