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,316
Reaction score
8,755
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,160
Reaction score
15,541
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,316
Reaction score
8,755
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,160
Reaction score
15,541
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,160
Reaction score
15,541
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

I think it's ready - Chapter Selection:
unknown.png
On another more gaming topic, I paid 20 bucks for a visual novel to emotionally destroy me. I may write an entry about that.
1638611395177.png
Reading about metaverses recently. I can totally imagine myself in the future, logging in with VR glasses to a virtual beach villa sitting in a virtual chair, with a virtual laptop facing the sea...coding 16-bit RM.
Mod name: "[Game name] Gameplay Overhaul"
What they actually mean: "Here is a mod that makes the game harder."
I decided to reinstall one of my most favourite game of all times, Gothic 2. Time to get back to Khorinis!

Forum statistics

Threads
117,174
Messages
1,105,156
Members
153,287
Latest member
kwa1g
Top