RMMV Item Select command... can you set the window position?

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
108
Reaction score
25
First Language
English
Primarily Uses
RMVXA
I want to use the "Select Item" command, but when called it seems to just randomly decide if the popup window appears at the top or bottom of the screen. Is there a way to specify the position the way you can with normal message boxes? More importantly, can you make it appear in the *middle* of the screen rather than top/bottom?

If not, what vanilla code would I change to make it always appear in the middle? I am happy to make my own plugin to do this, or else appeal to others to make one that allows the position to be changed.
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,363
Reaction score
8,772
First Language
German
Primarily Uses
RMMV
t seems to just randomly decide if the popup window appears at the top or bottom of the screen
there is no random effect anywhere in any computer.

I haven't looked at the code, but most likely it does something similar to the show choices command.
the choice window is positioned based on a check if there is a show text immediatly before the show choice, and if yes where the text message is set in that command.
Basically it has a default and is moved to a different position if that default position was already used by the show text.

check your events if they had that combination when the select item window jumps around...
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV

I've moved this thread to Plugin Requests. Thank you.

 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
108
Reaction score
25
First Language
English
Primarily Uses
RMVXA
[move]Plugin Requests[/move]
Thanks. Can I take that also as a confirmation that there's no way to change the Select Item window position in vanilla MV? Happy to make it a plugin request if that's the case and will edit the first post accordingly.

I haven't looked at the code, but most likely it does something similar to the show choices command.
the choice window is positioned based on a check if there is a show text immediatly before the show choice, and if yes where the text message is set in that command.
Basically it has a default and is moved to a different position if that default position was already used by the show text.
Is there a way around this behaviour (i.e. adding something between Show Text calls to reset the proper default position)? I noticed the same issue with the Show Choice box popping up in odd positions (too "low" when set to middle) and had no idea why but from how I interpret your post above it is almost certainly due to the quirk you outlined where the "default" gets messed up by a previous text box call.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,363
Reaction score
8,772
First Language
German
Primarily Uses
RMMV
(i.e. adding something between Show Text
exatly that - the code checks if a show text command comes before.
if any other command is between them, the effect is skipped.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
Can I take that also as a confirmation that there's no way to change the Select Item window position in vanilla MV?
There is no way change the window position without some sort of script. It's always better to write a plugin, even if it's only a few lines, than to change the core scripts.

If you find the relevant part of code, you can make your own plugin simply by copying that function into a new .js file and making the change there.
 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
108
Reaction score
25
First Language
English
Primarily Uses
RMVXA
There is no way change the window position without some sort of script. It's always better to write a plugin, even if it's only a few lines, than to change the core scripts.

If you find the relevant part of code, you can make your own plugin simply by copying that function into a new .js file and making the change there.
Cool, thanks. Yup, that's what I'm trying to do. I've made little plugins like that before to replace vanilla code (like you say, much better than editing the real code) but I have no idea what I need to change to centralise the Select Item window. Presumably the code is the section in "rpg_objects.js" that includes the line "case 104: // Select Item" but I'm pretty lost trying to figure out what to change to make it assume a "center" parameter when no parameter is normally accepted. :(

exatly that - the code checks if a show text command comes before.
if any other command is between them, the effect is skipped.
Thanks. For now (though it seems a bit "hacky"), I've tried adding "Show Text" event commands set to transparent, bottom and the contents as "\^" which results in nothing being shown but the default position seemingly being reset as the next time a centered Show Choice opens, it is properly centered.

I am also able to do the same but with the "top" position and when Select Item is called next, it always positions at the bottom of the screen. While I would prefer the center, this is far preferable to the top of the screen at least!
 
Last edited:

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,200
Reaction score
15,547
First Language
English
Primarily Uses
RMMV
Presumably the code is the section in "rpg_objects.js" that includes the line "case 104: // Select Item"
Actually, no. Now that I've finished work, I can look a little more ... but as you've been tinkering with little plugins like this already, I'll just point you to the bit of code you need and let you do the rest :)

It's in rpg_windows.js and you're looking for Window_EventItem - specifically the updatePlacement function. In my code, which is version 1.6.2, it starts on line 4202.
 

Latest Threads

Latest Posts

Latest Profile Posts

since all my maps are hand drawn... I admit, I super envy those who can make the tileset's work. I'm garbage at mapping, but slightly less bad at just drawing my own areas. plus it's easier to draw my own sprites than edit others to look like my characters.
Guys, I made a trailer! And, I also launched the Steam page! If you would like to support the game, please Wishlist it :ahappy: ->
working on some tilesets _ノ乙(、ン、)_

CIBl8xT.png


Oq8WKHX.png
aww man, color hex code #C4C4C4 doesn't work for the tint value in this scene I need something darker, which stinks just because I liked that one it was my favorite plastic explosive three times...#696969 (nice) should work better (WHY IS MY BRAIN LIKE THIS)
Tell it to me straight, doc. If I've been trying to piece together a "shorter" game to learn stuff outside of game jams... am I just running away from my WIP? :v

Forum statistics

Threads
117,284
Messages
1,106,132
Members
153,469
Latest member
CPGPPC
Top