List choice positioning.

Hello, I was recommended by Tsukihime to seek further assistance here regarding this script: http://forums.rpgmakerweb.com/index.php?/topic/6747-large-choices-built-in-multiple-choices/

My current assignment on my project is to work out my character create screen, so far it is brilliant- you select your name, background, and starting money-shop etc.

Using this script I have so far 14 choices combined into a single choice event, it works but the problem is the default window positioning forces the choice window to sit on the top right of the screen- concealing the first two options. I am only interested in having so far this screen only having this large choice window positioned either on the left side of the screen to perhaps feature some artwork on the empty background

or even positioned in the center. I have managed to find this script http://www.rpgmakervxace.net/topic/23341-tips-on-working-with-game-system/#entry168578 by Sourpo777 which has allowed this window to sit nicely on the left, but upon entering the testing town I have made I found that various other choice windows

(two options) have there window shrinked-cutting off several words.

I'm not exactly a code wiz, but I have managed to piece together various scripts nicely, this one however is giving me strife, how do I position these windows where I want them? I understand sort of about using the y-x axis but I don't understand how I am supposed to change them without the game crashing.

If anyone can help me here I'd much appreciate it.

-Skurge

NOTE: Sorry if this is the wrong forum to place this kind of request.
Also does there exist a script that allows certain shopkeepers to buy of certain item classes off you? For example a blacksmith will only buy armors and weapons of you instead of buying literally anything with a price.
I have no idea if this will work with the scripts you mentioned, but I did it like this in my game:

Spoiler
class Game_Interpreter def choice_pos(x,y,w,h) SceneManager.scene.message_window.choice_window.x = x SceneManager.scene.message_window.choice_window.y = y SceneManager.scene.message_window.choice_window.width = w SceneManager.scene.message_window.choice_window.height = h end endclass Window_Message < Window_Base attr_accessor :choice_window endclass Window_ChoiceList < Window_Command def update_placement # Removed... endendclass Scene_Map < Scene_Base attr_accessor :message_windowend
This snippet will give you the option to position your choice window wherever you like.

You do that with the script call 'choice_pos(x,y,width,height)'.

You can place it wherever you want, and you can also re-size it if you need.

But you will need to call this before every choice command if you need the choice window re-positioned or re-sized (you will most probably need to re-size it often if you are using more than 4 choices with Tsuki's script). So, the auto-positioning and re-sizing has been removed completely with this snippet to give the developer control over these.

You should probably make another topic for your other question thou, because that is a completely different thing.

I can't help you with that, sorry. 😛
I tried out your script, I don't see any reason for this not to work, however events that call the script crash with this message:

WV2J8hW.png


As you can see I've PROBABLY screwed up my positioning, I've tried various other figures to see if anything changed.

Returning to editor and checking the script tab lead me to this line:

OI9gIvk.png


Oddly enough without the call script event normal conversations don't crash- but they are all bunched up into a tiny cube top left of the screen, the default position of choices does not bother me- but sadly this awesome multi choice script seems to have conflicts with it :/

Unless I am missing something I have overlooked I'm sure there is some way around this, also pardon for my little extra question there- I'm a little unfamiliar with mass-detailed scripting.
You added an extra space line in the script call.


It goes like this:

choice_pos(100,100,200,120)So, no space between the 'choice_pos' and the arguments in the brackets, and you must add 4 arguments, which are the X position, Y position, width and height of the choice window.
All of them are counted in pixels!


If you are unsure how much height you need for a specific number of choices, here is how you can properly calculate the height:

24 * number_of_choices + 24This way the choice window will show all of the choices at once, without needing to scroll down.
And the width really depends on your choices' length, so you must experiment with that on your own, but should not be much trouble to set it to a fitting value.
Mate you are a bloody legend. I dunno if anyone out there has made a character create screen before with rpg maker, but let it be known you helped me sort out a dire issue here.

One last thing, After the creation screen is done, I want future rooms with choices to revert back to the default coordinates, do you know what they are or where I can find that line?

If anything a script call that just reverts back the standard choice positions/width height.
I removed the lines responsible for automatic choice positions.

It used to be in the Window_ChoiceList class, in the 'update_placement' method (where I wrote the "#Removed..." comment).

But I guess you can toggle it with a simple switch operation. I never bothered restoring that function, because I don't need it, but I guess the below snippet can do that:

def update_placement if $game_switches[99] == true self.width = [max_choice_width + 12, 96].max + padding * 2 self.width = [width, Graphics.width].min self.height = fitting_height($game_message.choices.size) self.x = Graphics.width - width if @message_window.y >= Graphics.height / 2 self.y = @message_window.y - height else self.y = @message_window.y + @message_window.height end end endReplace the 'update_placement' definition in the snippet I posted previously with this one.Change the 99 in $game_switches[99] to the switch ID you want to use for this.

After this, in the game, you can simply turn ON the selected switch to use the default positioning. You can turn the switch OFF anytime too, and place the choice window wherever you want again with the script call from the snippet if you want.

I did not test this thou, but it should work, I think.
Ok dId implemented the script as you said. I made the ID switch in the event- so that AFTER the custom positioning the switch should trigger to revert positioning and size back to the RPG Maker VX Ace to the default properties.

Regardless of what happened it crashed upon testing.

the message read out as: 

Script 'Window Positioning SEE CHARACTER CREATE' line 32:

SyntaxError occurred.

unexpected $send,expecting key_word end

end

I'm not sure what I did wrong- I hate to ask but I need a little more info on this situation. I really do appreciate the assistance.
Seems like you miss an 'end' line somewhere. It can be due to some typos (it really says "$send" and not "$end"?), or if you missed the placement of the above method, or maybe you did not copy/paste the whole definition.

Anyway, here is how it should look like after inserting the method from above:

Spoiler
class Game_Interpreter def choice_pos(x,y,w,h) SceneManager.scene.message_window.choice_window.x = x SceneManager.scene.message_window.choice_window.y = y SceneManager.scene.message_window.choice_window.width = w SceneManager.scene.message_window.choice_window.height = h end endclass Window_Message < Window_Base attr_accessor :choice_window endclass Window_ChoiceList < Window_Command def update_placement if $game_switches[99] == true self.width = [max_choice_width + 12, 96].max + padding * 2 self.width = [width, Graphics.width].min self.height = fitting_height($game_message.choices.size) self.x = Graphics.width - width if @message_window.y >= Graphics.height / 2 self.y = @message_window.y - height else self.y = @message_window.y + @message_window.height end end end endclass Scene_Map < Scene_Base attr_accessor :message_windowend
You can replace the whole snippet with this one.
That seems to work, must of been a typo somewhere on my part. This lets me progress very well. 🙂

Just for particular moments I happen to need to reposition it, or even change the defaults to say center bottom or bottom right hand side etc, would I need to edit a line somewhere in that snippet?
EDIT: I came across a strange bug, after character creation going through the large and wide customized windows-then I proceed to turn on the switch to restore window size/position defaults. Works fine everything is in order- however when a conversation is made with a character that has a label between the text and the following choices- the text window is removed leaving a rather lonely choice window that is usually accompanied by the text window below. Do you know what can be done to fix this?

*Crap I thought I edited post, sorry admins :s
You can make your own default settings if you like (but I don't recommend it). I just restored the engine's default placement, which can not be changed by default, and it is always at the right side, sitting above the message window.

The choice window will be always at that position when the switch is turned ON.

To make your own default settings, you need to edit the 'update_placement' definition (the one you just changed). But keep in mind, that you will need to make a dynamic formula for that, to account for all the possible widths and heights of the choice window (unless you make a static setting for width and height), which is why I say, leave this how it is.

If you need to re-position the choice window, simply turn OFF the switch, and call the 'choice_pos' script call to move the window wherever you want. As long as the switch is turned OFF, you can place it wherever you want and re-size it however you want. If you need the default position, just turn ON the switch again.

In case you really want to change the default, here is how you do it:

def update_placement if $game_switches[99] == true self.width = *your new default width (or width formula) goes here* self.height = *your new default height (or height formula) goes here* self.x = *your new default X pos (or X pos formula) goes here* self.y = *your new default Y pos (or Y pos formula) goes here* end endSo, basically, you just set your own default X, Y, width and height for the window.About the disappearing text box...

It's the default engine's behavior, not caused by my script. I usually just put my labels above a text message, and call the choice command after the message. Also, any command placed between a text and choice command will cause that behavior, not just labels (even comments and script calls, switch operations, etc). So make sure you use the position change script call (and the switch toggle for default positioning) for the choice window before the text message command you want to show, and not between the text and choice commands.
Ah I see your point, in that case I might just leave that default placing alone for now.

I accidentally created a new post prior to yours but it states a bug in your previous fix.

Edit:

Hmmm this seems really kinda awkward for in game conversations sake with choices, for example I have a black smith named Lloyd who when you first speak to him he says "aye?" choices are:

1) What wares do you sell?

2) Let us barter.

3) I must depart.

After each choice aside #3 he says "was there anything else you are after?" in turn command : jump to label "store" reverting back to the choices,  his dialog prior is meant to be underneath "was there anything else you are after?" but it's gone. It just doesn't seem right to not have the dialog connect.

I made a visual example of my problem that might expand a resolve. I have considered entering the scripts and switches but they dont work or i am misplacing them (or the wrong ones) I feel like an idiot..

Z5s2xAi.png
There is no easy solution/workaround for that problem, it's one of those things I call "badly designed parts of the engine", but seeing why it happens, I can see why it is so hard to make that work without some workarounds...

Anyway, you can get around that problem if you use Modern Algebra's Special Message Codes script with this little snippet of mine:

Spoiler
class Game_System attr_accessor :temp_txt alias add_temp_txt9954 initialize def initialize add_temp_txt9954 @temp_txt = "" end end
The above snippet creates a temporary text variable, which can be set anytime in the game and can be shown in message boxes thanks to Modern Algebra's script.

You use it like this:

Spoiler
example1.png
So, as you can see, I set the temp text to be a greeting message at the start. After that, comes the label, than the choices. At the end of each choice which would jump back to the label created before, I set the temp text to something else. That other text will now show up instead of the greeting text the next time the choices are shown.

You must use Modern Algebra's script for this to work thou. And remember to use the eval message code for this ( this one: #\{code} ), or else it won't work.

This is an easy workaround, and works for me.

Also with this, you can make different texts show up after choosing different choices. For example, one can earn the favor of the event, while others can piss it off, and you can even show this with texts.

Fixing the core of the issue would require some very complex checks in Game_Interpreter, which I don't plan to make. And that made me think of the above workaround which was way easier to pull off, and I could even make a "piss off the event permanently after saying something to him/her" system based on this. 😀
Ok I emulated your event and got the resources placed where you want them. It works how I want these kind of events to work.

However, after assuming that my normal message bars would go ( "\c[6]Llyod\c[0]Aye?" ) As just a test greeting with actual dialogue and a coloured name with his message below it. It brings me this error:

Script 'ARS: Special Message Codes' line 560:NoMethodError occurred.

undefined method 'upcase' for nil:NilClass

I'm not sure what the hell this means haha, I figured throughout my tests it doesn't like the text options such as colour etc.

Any clue as what to do there? I think if this slight issue is over that might just conclude this problem entirely.
You show up those names on all the message boxes, or not?

If you do, you can simply enter that in your regular message box command, and call the code part after that.

It would look like this:

\c[6]Name_goes_here\c[0]\#{$game_system.temp_txt}Or you can use a message script which can display the name text outside of the message box, which would make it more appealing and saves a whole line in your message box.Either way, you should leave out message codes like that from the eval message code, it won't work with those.
Yeah so far that Is what I have in texts at the moment, followed by key characters having a mugshot.

Which by the way would this require anything regarding mugshots on scripted messages?

I did what you asked and it works, but messages afterwards will crash if I try to implement the name/colour functions in the script

that acts as a temp text. If you happen to have a way around this could you provide a screenshot so I can mark it down to the right spot? I feel this is nearly over 🙂

I like the sound of that name box script aswell, I might have to look into that-But I don't know where to start.
Sorry if this is confusing as hell.
I hate doing this but.

Bump*

Original thread: https://forums.rpgmakerweb.com/threads/list-choice-positioning.42957/