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,267
Reaction score
8,722
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,086
Reaction score
15,501
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,267
Reaction score
8,722
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,086
Reaction score
15,501
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,086
Reaction score
15,501
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

Of course, I bought a handful of games on the Steam Black Friday sale. Will I try them? Will I complete any? Who knows...
I don't really have any neat updates today about how I screwed up programming... But if you want to observe the intensenes of me programming, then you can check out my stream :)
New Weapons.gif
No more spam from me today, I promise! Just wanted to upload this, people have been giving me feedback that my weapon sprites (which were RTP) clashed badly with my battlers for ages, so today I finally took the plunge and updated them! Really happy with how they came out :D :D
So Facebook fraudulently took money from me. They even went through my PayPal accounts to find a card that had the money on it. Thinking about deleting my Facebook account because this doesn't happen on twitter, not even close.
Today the 2nd part of the RPGMakergame "A Thief's voyage" came out.


Go show DutchPowerCreations some love.

Forum statistics

Threads
116,995
Messages
1,103,694
Members
152,895
Latest member
duc17265
Top