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

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
104
Reaction score
22
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
33,993
Reaction score
8,627
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
43,758
Reaction score
15,317
First Language
English
Primarily Uses
RMMV

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

 

Banjo

Veteran
Veteran
Joined
Jan 4, 2013
Messages
104
Reaction score
22
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
33,993
Reaction score
8,627
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
43,758
Reaction score
15,317
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
104
Reaction score
22
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
43,758
Reaction score
15,317
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

Can't wait for next update! :)
I really want to get a cat... but our puppy is still... well... a puppy and would eat and bark at a cat if we got one... *sighs* I guess I'll wait a couple of years~
unintentionally made a track that sounds straight out of Yume Nikki
Revisiting one of my older projects in a long time to work some more on the mechanics. I've been working on- and off-again for about a year now on recreating the Force and Mystic systems from Wild ARMs. And I think I've finally made some good breakthroughs on that!

Still, it is not perfect and I may post my thoughts at a later time to see if there are any other suggestions or alternatives I've missed.
actor name string, why you gotta be case sensitive like that?

Forum statistics

Threads
116,110
Messages
1,095,877
Members
151,516
Latest member
HevaCat
Top