Set the default cursor/choice option with a variable

● ARCHIVED · READ-ONLY
Started by Theguysayshi 4 posts View original ↗
  1. Sorry in advance if this has been asked already, but I've searched all over and to no avail on any scripts that do this.

    I have a game play idea that revolves around the the changing the default cursor position in menus. This would be done through a variable (Eg. when variable is set to 0, default is choice 1. When variable is set to 1, default is choice 2)

    This seems simple enough, but I can't find a script anywhere that does it. The only one I did find was in Japanese, and had a bunch of different other choice options that conflicted with another script I had (Galv's Visual Novel Choices).

    It doesn't need to be anything complicated or anything. Any help at all is much appreciated!
  2. It might be better if you tell us what you want to do instead of how you want to do it - something like that might require some big changes, and there aren't many scripters for Ace left.

    The only thing I ever saw that comes even near this (and I once took a month to check through the entire ace master script list) is a script that allows the creation of tutorials by restricting and forcing menu commands.
  3. Give this a go:
    Spoiler
    Code:
    =begin
    #==============================================================================#
    #   Cursor Position Variable
    #   Version 1.01
    #   Original Script: Jupiter Penguin (Option Extension ver.3.4)
    #   URL: http://woodpenguin.blog.fc2.com/
    #------------------------------------------------------------------------------#
    #   Edited by: AMoonlessNight
    #   Date: 20 Jul 2018
    #   Latest: 20 Jul 2018
    #==============================================================================#
    #   UPDATE LOG
    #------------------------------------------------------------------------------#
    # 20 Jul 2018 - created the script based on Jupiter Penguin's Option Extension
    #               script
    #==============================================================================#
    #   TERMS OF USE
    #------------------------------------------------------------------------------#
    # - As according to the original script by Jupiter Penguin:
    #   http://woodpenguin.blog.fc2.com/blog-category-4.html
    #==============================================================================#
        INSTRUCTIONS
    
     ** Use the following notetag in your event's comment box:
     
        <cursor_storage: n>
        
      Where n is the variable ID. The cursor will initially set to the value of
      the specified variable.
    
     ** For details on the original script, please see the following website:
        http://woodpenguin.web.fc2.com/rgss3/choice_ex.html
     
    =end
    
    #==============================================================================
    #  Please do not edit below this point unless you know what you are doing.
    #==============================================================================
    
    class Game_Message
      attr_accessor :choice_var_id
      alias amn_choices_gamemessage_clear clear
      def clear
        amn_choices_gamemessage_clear
        @choice_var_id = 0
      end
    end
    
    class Game_Interpreter
     
      alias amn_choices_gameinterpreter_command_108 command_108
      def command_108
        amn_choices_gameinterpreter_command_108
        @comments.each do |comment|
          case comment
          when /<cursor_storage:\s*(\d+)>/i
            $game_message.choice_var_id = $1.to_i
          end
        end
      end
    
    end
    
    class Window_ChoiceList
    
      alias amn_choices_windowchoicelist_start  start
      def start
        amn_choices_windowchoicelist_start
        if $game_message.choice_var_id > 0
          select($game_variables[$game_message.choice_var_id])
        end
      end
     
    end
  4. A-Moonless-Night said:
    Give this a go:
    Spoiler
    Code:
    =begin
    #==============================================================================#
    #   Cursor Position Variable
    #   Version 1.01
    #   Original Script: Jupiter Penguin (Option Extension ver.3.4)
    #   URL: http://woodpenguin.blog.fc2.com/
    #------------------------------------------------------------------------------#
    #   Edited by: AMoonlessNight
    #   Date: 20 Jul 2018
    #   Latest: 20 Jul 2018
    #==============================================================================#
    #   UPDATE LOG
    #------------------------------------------------------------------------------#
    # 20 Jul 2018 - created the script based on Jupiter Penguin's Option Extension
    #               script
    #==============================================================================#
    #   TERMS OF USE
    #------------------------------------------------------------------------------#
    # - As according to the original script by Jupiter Penguin:
    #   http://woodpenguin.blog.fc2.com/blog-category-4.html
    #==============================================================================#
        INSTRUCTIONS
    
     ** Use the following notetag in your event's comment box:
     
        <cursor_storage: n>
     
      Where n is the variable ID. The cursor will initially set to the value of
      the specified variable.
    
     ** For details on the original script, please see the following website:
        http://woodpenguin.web.fc2.com/rgss3/choice_ex.html
     
    =end
    
    #==============================================================================
    #  Please do not edit below this point unless you know what you are doing.
    #==============================================================================
    
    class Game_Message
      attr_accessor :choice_var_id
      alias amn_choices_gamemessage_clear clear
      def clear
        amn_choices_gamemessage_clear
        @choice_var_id = 0
      end
    end
    
    class Game_Interpreter
     
      alias amn_choices_gameinterpreter_command_108 command_108
      def command_108
        amn_choices_gameinterpreter_command_108
        @comments.each do |comment|
          case comment
          when /<cursor_storage:\s*(\d+)>/i
            $game_message.choice_var_id = $1.to_i
          end
        end
      end
    
    end
    
    class Window_ChoiceList
    
      alias amn_choices_windowchoicelist_start  start
      def start
        amn_choices_windowchoicelist_start
        if $game_message.choice_var_id > 0
          select($game_variables[$game_message.choice_var_id])
        end
      end
     
    end

    Thanks! This is exactly what I want to do, and works perfectly with no problems. Thank you so much!