Basic Options Menu

Just an optional request.
Since I know how easy it is to change the textbox colours with \C(x), but I am rather scriptly impaired. Would you be able to make a textbox colour selection included?
First of all, LOVE the script, fantastic job.


Quick question though, how can I remove the switch section.


I don't want the player to be able to turn a switch on an off.


But I haven't a clue how to do this.
Select those areas (highlight them) and comment them out (press control+Q)


-------


Hi,


I seem to be running into a very strange issue: The script won't show up at all on the main menu.


I set it to display 5 columns, just in case. No dice. Here is a WIP screenshot: http://i.imgur.com/049N8FS.png


If anyone can help, that's be great.
Hi, i was wondering if this could be modified just a little bit. I use a script that lets you set higher resolutions than normal.. so any normal resolutions will work. I have the game set to 1024x768 by default now, but was wondering if you could make the resolution menu options actually change the "Graphics.resize_screen(1024, 768)" on the fly instead of using window stretching? That way once i see how you do it, i could add a couple of resolution options in there for people.

I tried to edit the resolution option myself, however i failed as i take there is probably more to it than what i tried. Either way thanks for your reply. 😛
Hi, I was wondering why it the music doesn't automically changes when I change the volume, but that I have to wait until the BGM fades in again. Is there a reason for and can this be fixed?
Is there anyway we could get some compatibility with Xall menu themes? Cause nothing is happening for me.
Hello i have Xail System Menu this is compatible ?
I am having a problem that it is not showing up on the title screen? I put the script in the right spot, I don't know why it isn't working.
Is there anyway we could get some compatibility with Xall menu themes? Cause nothing is happening for me.
Hello i have Xail System Menu this is compatible ?
I am having a problem that it is not showing up on the title screen? I put the script in the right spot, I don't know why it isn't working.
cyoGRWM.png


Just add this to your XaiL Menu Deluxe options. I had a hard time getting it to work.

I also placed this script above both XaiL core and menu scripts.

@Awesomeguy2561 It is not really related to your question, but you may switch from the vanilla menu and start using XaiL's improved menu script.

Thanks for the script, OP.
I'm a little bit confused about how the Header option works. The way I understand it (from looking at the script), switching it to 'on' will set a switch to on when you start the game, and the switch ID is determined by the SWITCH_ID value (in my case, I set the value to 200). However, when I try to playtest the game, set it to 'on', and begin a new game, it doesn't set the switch on. Am I misunderstanding the script or am I setting the value wrong?
This is awesome! But the autosave and res wont pop up. -_- How 2 fix?
Thank you for this script and your autosave script, also for your help using this script. 🙂


Can I change the autosave and message SE options into configure gamepad controls option and configure keyboard controls option?


Is it possible to configure the keyboard and gamepad controls without pressing F1?
Hey vlue, i'm new here and didn't have knowledge about coding.


Is there any way to remove the "Large" in resolution options?


I want to use only the "Normal" and "Fullscreen" ones, thankyou before 🙂
Found and fixed a couple bugs. For one, if you change the volume and then hit cancel instead of OK, the volume will not instantly revert to the original value, You will have to reopen the options dialog and tick the volume one more time to get the volume to adjust appropriately.

Also, if you turn the volume all the way down and keep pressing, you will get one extra black bar that goes past the intended range (there's also a weird double-adding blue bar issue at the top of the range).

The first bug can be fixed by scrolling to line 290 where this function is defined:
Spoiler: code
def command_ok
case @window_command.index
when 0
$game_options.save_options
$game_options.clear_memorize
return_scene
when 1
$game_options.copy_memorize
$game_options.clear_memorize
return_scene
end
end

And adding one line like so:

Spoiler: code
def command_ok
case @window_command.index
when 0
$game_options.save_options
$game_options.clear_memorize
return_scene
when 1
$game_options.copy_memorize
$game_options.clear_memorize
$game_map.autoplay if $game_map && $game_map.map_id > 0
return_scene
end
end


The other issue can be fixed by going to line 420 where we see:

Spoiler: code
def refresh(temp_value)
contents.clear
temp_value *= 100
temp_value.to_i.times do |i|
rect = Rect.new(4+i*4,6,2,8)
contents.fill_rect(rect, Color.new(75,100,255))
end
(100-temp_value).to_i.times do |i|
rect = Rect.new(396-i*4,6,2,8)
contents.fill_rect(rect, Color.new(0,0,0))
end
draw_text(0,0,contents.width,24,temp_value.to_i.to_s + "%",2)
end

Simply change the 396 to 400 and both instances of ".to_i" with ".round" like so:

Spoiler: code
def refresh(temp_value)
contents.clear
temp_value *= 100
temp_value.round.times do |i|
rect = Rect.new(4+i*4,6,2,8)
contents.fill_rect(rect, Color.new(75,100,255))
end
(100-temp_value).round.times do |i|
rect = Rect.new(400-i*4,6,2,8)
contents.fill_rect(rect, Color.new(0,0,0))
end
draw_text(0,0,contents.width,24,temp_value.to_i.to_s + "%",2)
end

I was quite surprised myself to find that the .to_round was necessary, but due to some nuances of floating point arithmetic (which you can read about here: http://floating-point-gui.de/), we get new weird errors if we only change 396 to 400. .round turns 1.999999 into 2 where .to_i turns it into 1.

Anyway, thanks so much for making this script! I've had a couple playtesters request volume controls, so i was thrilled to see this up for free and allowed in commercial games. Thanks!
Vlue,
1 - How could I add support to your mouse script so I could operate the options menu using the mouse cursor?
2 - How could add an extra option into the menu? In my case, I would like to put an option to change the game window's color, and give the player five different possibilities: Blue (default), Pink (custom option 1), Green (custon option 2), Yellow (custom option 3), AND White (custom option 4).

Thanks.
Anyone here who supports this script? Its really cool and I'd like to use it, but I found a bug.
I managed it to implement this script in the title screen, but it does not work there. You can change the volume, but nothing changes. And if you load a savegame and change volume there and go back to the title screen and change volume again, you hear the music from the last map where you have been xD
Could anyone fix this?
This script is much cooler than yanflys^^
What's the script call?
Oh, I totally forgot, sorry.
I found another person who kindly helped me out.
This is the script if you want to combine full screen and options in the title menu:
Code:
#==============================================================================
# Vollbild als Option im Startmenü
#==============================================================================

class Window_TitleCommand < Window_Command
  alias alt_make_command_list_vollbild_zion:make_command_list
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command("Vollbild", :vollbild)
    add_command("Optionen", :optionen) #optionen
    add_command(Vocab::shutdown, :shutdown)
  end
end
class Scene_Title < Scene_Base
  alias alt_create_command_window_vollbild_zion:create_command_window
  def create_command_window
    alt_create_command_window_vollbild_zion
    @command_window.set_handler:)vollbild, method:)command_vollbild))
    @command_window.set_handler:)optionen, method:)command_options))   #optionen
  end
  def command_vollbild
    $keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
    $keybd.call 0xA4, 0, 0, 0
    $keybd.call 13, 0, 0, 0
    $keybd.call 13, 0, 2, 0
    $keybd.call 0xA4, 0, 2, 0
    @command_window.activate
  end
#--------------------------------------------------------------------------
# * [Options] Command   #optionen
#--------------------------------------------------------------------------
def command_options
  SceneManager.call(Scene_Options)
end

end


Most of the script is from Nefertari.

Vlue's script needs to be changed as follows:

Code:
line 62, 2 new lines:
class Scene_Options < Scene_MenuBase
attr_reader :last_scene # neue Variable
def start
super
@last_scene = SceneManager.instance_variable_get:)@stack).pop.class # neu: merkt sich die aufrufende Scene
$game_options.memorize_options
...
line 252, 1 line out, 2 new lines in:
def change_volume(index, value)
return unless audio_index(index)
$game_options.set_volume:)master, value) if @window_index[index] == :master
$game_options.set_volume:)bgm, value) if @window_index[index] == :bgm
$game_options.set_volume:)se, value) if @window_index[index] == :se
@window_masterbar.refresh($game_options.master_volume)
@window_bgmbar.refresh($game_options.bgm_volume)
@window_sebar.refresh($game_options.se_volume)
Sound.play_cursor
# $game_map.autoplay if $game_map && $game_map.map_id > 0
$data_system.title_bgm.play if last_scene == Scene_Title # neu: spielt Titelmusik, wenn vorherige Scene der Title war
$game_map.autoplay if last_scene == Scene_Menu # neu: spielt Mapmusik, wenn vorherige Scene eine Map war
end
line 301, 2 lines out, 2 new lines in:
def command_ok
case @window_command.index
when 0
$game_options.save_options
$game_options.clear_memorize
# return_scene
SceneManager.call(last_scene) # neu: ruft vorherige Scene auf
when 1
$game_options.copy_memorize
$game_options.clear_memorize
# return_scene
SceneManager.call(last_scene) # neu: ruft vorherige Scene auf
end
end
Oh, I totally forgot, sorry.
I found another person who kindly helped me out.
This is the script if you want to combine full screen and options in the title menu:

Spoiler
#==============================================================================
# Vollbild als Option im Startmenü
#==============================================================================

class Window_TitleCommand < Window_Command
alias alt_make_command_list_vollbild_zion:make_command_list
def make_command_list
add_command(Vocab::new_game, :new_game)
add_command(Vocab::continue, :continue, continue_enabled)
add_command("Vollbild", :vollbild)
add_command("Optionen", 😮ptionen) #optionen
add_command(Vocab::shutdown, :shutdown)
end
end
class Scene_Title < Scene_Base
alias alt_create_command_window_vollbild_zion:create_command_window
def create_command_window
alt_create_command_window_vollbild_zion
@command_window.set_handler🙂vollbild, method🙂command_vollbild))
@command_window.set_handler🙂optionen, method🙂command_options)) #optionen
end
def command_vollbild
$keybd = Win32API.new 'user32.dll', 'keybd_event', ['i', 'i', 'l', 'l'], 'v'
$keybd.call 0xA4, 0, 0, 0
$keybd.call 13, 0, 0, 0
$keybd.call 13, 0, 2, 0
$keybd.call 0xA4, 0, 2, 0
@command_window.activate
end
#--------------------------------------------------------------------------
# * [Options] Command #optionen
#--------------------------------------------------------------------------
def command_options
SceneManager.call(Scene_Options)
end

end

Most of the script is from Nefertari.

Vlue's script needs to be changed as follows:

Spoiler
  1. line 62, 2 new lines:
  2. class Scene_Options < Scene_MenuBase
  3. attr_reader :last_scene # neue Variable
  4. def start
  5. super
  6. @last_scene = SceneManager.instance_variable_get🙂@stack).pop.class # neu: merkt sich die aufrufende Scene
  7. $game_options.memorize_options
  8. ...
  9. line 252, 1 line out, 2 new lines in:
  10. def change_volume(index, value)
  11. return unless audio_index(index)
  12. $game_options.set_volume🙂master, value) if @window_index[index] == :master
  13. $game_options.set_volume🙂bgm, value) if @window_index[index] == :bgm
  14. $game_options.set_volume🙂se, value) if @window_index[index] == :se
  15. @window_masterbar.refresh($game_options.master_volume)
  16. @window_bgmbar.refresh($game_options.bgm_volume)
  17. @window_sebar.refresh($game_options.se_volume)
  18. Sound.play_cursor
  19. # $game_map.autoplay if $game_map && $game_map.map_id > 0
  20. $data_system.title_bgm.play if last_scene == Scene_Title # neu: spielt Titelmusik, wenn vorherige Scene der Title war
  21. $game_map.autoplay if last_scene == Scene_Menu # neu: spielt Mapmusik, wenn vorherige Scene eine Map war
  22. end
  23. line 301, 2 lines out, 2 new lines in:
  24. def command_ok
  25. case @window_command.index
  26. when 0
  27. $game_options.save_options
  28. $game_options.clear_memorize
  29. # return_scene
  30. SceneManager.call(last_scene) # neu: ruft vorherige Scene auf
  31. when 1
  32. $game_options.copy_memorize
  33. $game_options.clear_memorize
  34. # return_scene
  35. SceneManager.call(last_scene) # neu: ruft vorherige Scene auf
  36. end
  37. end
I meant what's the script call for opening the options menu?
I've scripted my game so the title screen is skipped and i've made a custom menu.
It's in the first script I posted:

SceneManager.call(Scene_Options)
can you fix the code entry. it has smiley's all over it. Use a proper code block
Spoiler: code
Code:
def create_resolution_window
    if Module.const_defined?(:Window_Resize)
      @window_resolution = Window_OR.new(48+24 * @current_index)
      @window_resolution.set_handler(:ok, method(:resolution_ok))
      @back_window.add_text(24 * (@current_index - 1),OPT_STR::RESOLUTION)
      @current_index += 2
      @size += 1
      @window_index.push(:resolution)
    end
  end

Original thread: https://forums.rpgmakerweb.com/threads/basic-options-menu.18476/