MV Script Call to see if player is navigating particular menu

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
86
Reaction score
23
First Language
English
Primarily Uses
RMMV
I have a HUD of sorts that I've designed that I would like to show, if possible, specifically when the player is navigating the menu in combat for a particular skill type.

Is there a script call that can return the menu that the player is in during battle?

The idea being that I do a check to see if that returned value matches a static value, and, if so, turn on the switch to which the HUD is tied.
 

Cormorant42

Veteran
Veteran
Joined
Sep 17, 2019
Messages
74
Reaction score
39
First Language
English
Primarily Uses
RMMV
You're going to have to find this yourself, because I'm too tired to delv through rpg_scenes.js for the specific script call that you're looking for. But I can give you some pointers on where to look and what to look for:

- The file you want to look in is either rpg_scenes.js or rpg_windows.js, depending on if you want it to be open during a certain menu or a certain part of a certain menu
- After glancing through rpg_scenes.js, since I'm betting that's what you want, I see a script call for "Scene_Base.prototype.isActive();" which will return a boolean value depending on whether the scene is active or not. Since that's a call for Scene_Base, it will almost always return true if the game is running (that's a guesstimate, I haven't checked that so don't fact check me)
- You'll probably want to find a version of the above script call that is specific to the scene that you want your HUD to be visible during

And I'm tired so that's all I can give you rn, hope it helps
 

xabileug

Veteran
Veteran
Joined
Jul 1, 2014
Messages
113
Reaction score
23
There's a plugin flash active window, i think it was japanese. It makes the active window pulse.
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
86
Reaction score
23
First Language
English
Primarily Uses
RMMV
You're going to have to find this yourself, because I'm too tired to delv through rpg_scenes.js for the specific script call that you're looking for. But I can give you some pointers on where to look and what to look for:

- The file you want to look in is either rpg_scenes.js or rpg_windows.js, depending on if you want it to be open during a certain menu or a certain part of a certain menu
- After glancing through rpg_scenes.js, since I'm betting that's what you want, I see a script call for "Scene_Base.prototype.isActive();" which will return a boolean value depending on whether the scene is active or not. Since that's a call for Scene_Base, it will almost always return true if the game is running (that's a guesstimate, I haven't checked that so don't fact check me)
- You'll probably want to find a version of the above script call that is specific to the scene that you want your HUD to be visible during

And I'm tired so that's all I can give you rn, hope it helps
Thanks! It's a start. I'll give it a shot, but my ability to parse javascript is fairly limited. However, a boolean value would be perfect.

I'm hoping to have it return true anytime you access the menu for a skill type I have created -- not just specific parts of the menu.

Why? I have a spellcaster's magic set up to consume reagents. The HUD is the number of reagents she has remaining. I just think it would be slick it it were visible to the player without having to use an ability to bring up the HUD and without it needlessly floating the HUD in battle over everyone else's turn.
 

yeahchris

Veteran
Veteran
Joined
Apr 14, 2020
Messages
86
Reaction score
23
First Language
English
Primarily Uses
RMMV
So.... found this.


Scene_Battle.prototype.isAnyInputWindowActive = function() {
return (this._partyCommandWindow.active ||
this._actorCommandWindow.active ||
this._skillWindow.active ||
this._itemWindow.active ||
this._actorWindow.active ||
this._enemyWindow.active);

But not finding anything that suggest how I could target a particular skill window. Would it be easier to try to target the battler whose turn it is maybe?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

made a bio for the protag in my project!
Beggar : "I haven't eat for days..."
Kid : "Just do crime! You will get daily necessity for free in prison~"
Stream is a bit late but will be live shortly with some game development! Feel free to drop by!
omg, why persona 5 is so good?

Forum statistics

Threads
99,157
Messages
962,423
Members
130,725
Latest member
teendinsaikha
Top