MZ How to make the Battle Status UI appear on the map?

Hey there! I'm currently learning how to use JavaScript amd I've been etching my way through everything, though, I have one simple question because I feel a bit confused.

I wanted to try something a bit silly to get a better understanding on how windows work in MZ, and that's bringing the battle status UI appear on the map. For those who are confused, I'm talking about this window where it displays the character HP, MP, and TP in battles.
images.jpeg

I tried just plopping the functions that create and draw the window into the Scene_Map, but I feel like I'm missing something important as it didn't show up
without plugin and still smooth, you can look [here], it might not work in MZ,
but similar can be applied to scene map, there are several ways.

it really depends how too, like picture based, windows based, hud's based.
I tried just plopping the functions that create and draw the window into the Scene_Map, but I feel like I'm missing something important as it didn't show up
id have to see exactly what youve done, but if you copied anything that created the window, did you use the show() command to make it visible? are you certain that the commands to create the window are actually being ran?
id have to see exactly what youve done, but if you copied anything that created the window, did you use the show() command to make it visible? are you certain that the commands to create the window are actually being ran?

All I did was add these two here, once again, I feel like I'm missing something, I did just try using the show function, but I'm getting an error. If you can explain what I'm doing wrong, iit'll be deeply appreciated
View attachment 329015
If you can explain what I'm doing wrong, iit'll be deeply appreciated
you cant just copy the battle scene functions paste them into the map scene and expect them to work with no other adjustments. in this case, its the second thing i mentioned - theyre not being ran.

you gave the map scene a createStatusWindow() method to create a status window, but nowhere in the existing code does it call it. the map scene never had one in the first place, and you never added that call into anything it already does.

look at where createStatusWindow() is called within the battle scene. its buried beneath a few layers of function calls, but theres a function called createAllWindows() that uses createStatusWindow() and gets ran off of create() which is ran as the scene is loaded.
the map scene also has a createAllWindows() function, so the first thing you'd want to do is add this.createStatusWindow() there.

the next thing is that the battle status window was made with the assumption that the player is in battle. there may or may not to be functions that youll have to remove and/or adjust because theyll be grabbing data thats expected to exist in the current scene that would be absent if that scene werent the battle scene.
if you get many errors resulting from that, it might be better to create a new custom window that inherits from the status base window the same way BattleStatus already does and then copy and adjust the BattleStatus changes you want from it
you cant just copy the battle scene functions paste them into the map scene and expect them to work with no other adjustments. in this case, its the second thing i mentioned - theyre not being ran.

you gave the map scene a createStatusWindow() method to create a status window, but nowhere in the existing code does it call it. the map scene never had one in the first place, and you never added that call into anything it already does.

look at where createStatusWindow() is called within the battle scene. its buried beneath a few layers of function calls, but theres a function called createAllWindows() that uses createStatusWindow() and gets ran off of create() which is ran as the scene is loaded.
the map scene also has a createAllWindows() function, so the first thing you'd want to do is add this.createStatusWindow() there.

the next thing is that the battle status window was made with the assumption that the player is in battle. there may or may not to be functions that youll have to remove and/or adjust because theyll be grabbing data thats expected to exist in the current scene that would be absent if that scene werent the battle scene.
if you get many errors resulting from that, it might be better to create a new custom window that inherits from the status base window the same way BattleStatus already does and then copy and adjust the BattleStatus changes you want from it
This helped me a lot, and thankfully, I didn't run into any errors regarding the data and if the game's in battle mode or not.

Had to add this.createStatusWindow(); under the Scene_Map's already existing createAllWindows() function, and add this._statusWindow.open() under the onMapLoaded() function. I also added the refresh function on the Start function, maybe a bad place for what I plan in the future, but it works!
Screenshot 2025-01-15 191434.png

Screenshot 2025-01-15 191443.png

Screenshot 2025-01-15 191449.png

This was the end result, along with editing the status menu's layout itself
Screenshot 2025-01-15 195945.png


Thanks a lot for the help!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-the-battle-status-ui-appear-on-the-map.174720/