Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Fairly simple title screen request.

Status
Not open for further replies.
Ok here is the situation:

I used mog title screen for my game. But now my title screen has the new game, continue and quit option next to each other instead of above each other. Now I tried to figure out how to make so that ONLY in the title screen I can use left and right to navigate through the choices.

I tried editing the inputs in the window_selectable, and that worked but it worked so well it stuck in the whole game rofl. I want just for the intro screen to be able to go left and right.

Thanks in advance for any help.

If you need more info let me know and I'll provide as much as I can.

-Lisker
 
After def update in Scene_Title add this :

Code:
    if Input.trigger?(Input::RIGHT)
      if @command_window.index < 2        
    $game_system.se_play($data_system.cursor_se)
    @command_window.index += 1
      end
      end
    if Input.trigger?(Input::LEFT)
      if @command_window.index >= 1        
    $game_system.se_play($data_system.cursor_se)
    @command_window.index -= 1
      end
      end

In Window_Selectable after :

Code:
    if self.active and @item_max > 0 and @index >= 0

Add this :

Code:
     unless $scene.is_a?(Scene_Title)

Then before

Code:
      if Input.repeat?(Input::UP)

add one more 'end'

then after that end add

Code:
     unless $scene.is_a?(Scene_Title)

then after

Code:
      @index = (@index - @column_max + @item_max) % @item_max

add one more 'end'.

Cheers.
 
That doesn't seem to work, would this work with the mog menu's aswell?

The code for window_selectable is this now:
Code:
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
#  This window class contains cursor movement and scroll functions.
#==============================================================================

class Window_Selectable < Window_Base
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :index                    # cursor position
  attr_reader   :help_window              # help window
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x      : window x-coordinate
  #     y      : window y-coordinate
  #     width  : window width
  #     height : window height
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item_max = 1
    @column_max = 1
    @index = -1
  end
  #--------------------------------------------------------------------------
  # * Set Cursor Position
  #     index : new cursor position
  #--------------------------------------------------------------------------
  def index=(index)
    @index = index
    # Update Help Text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
    # Update cursor rectangle
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  # * Get Row Count
  #--------------------------------------------------------------------------
  def row_max
    # Compute rows from number of items and columns
    return (@item_max + @column_max - 1) / @column_max
  end
  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    # Divide y-coordinate of window contents transfer origin by 1 row
    # height of 32
    return self.oy / 32
  end
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------
  def top_row=(row)
    # If row is less than 0, change it to 0
    if row < 0
      row = 0
    end
    # If row exceeds row_max - 1, change it to row_max - 1
    if row > row_max - 1
      row = row_max - 1
    end
    # Multiply 1 row height by 32 for y-coordinate of window contents
    # transfer origin
    self.oy = row * 32
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    # Subtract a frame height of 32 from the window height, and divide it by
    # 1 row height of 32
    return (self.height - 32) / 32
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_item_max
    # Multiply row count (page_row_max) times column count (@column_max)
    return page_row_max * @column_max
  end
  #--------------------------------------------------------------------------
  # * Set Help Window
  #     help_window : new help window
  #--------------------------------------------------------------------------
  def help_window=(help_window)
    @help_window = help_window
    # Update help text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 32 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If cursor is movable
    if self.active and @item_max > 0 and @index >= 0
    
    unless $scene.is_a?(Scene_Title)
      
        # If pressing down on the directional buttons
      if Input.repeat?(Input::DOWN)
        # If column count is 1 and directional button was pressed down with no
        # repeat, or if cursor position is more to the front than
        # (item count - column count)
        if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
           @index < @item_max - @column_max
          # Move cursor down
          $game_system.se_play($data_system.cursor_se)
          @index = (@index + @column_max) % @item_max
        end
      end
  
      unless $scene.is_a?(Scene_Title)
      
      # If the up directional button was pressed
      if Input.repeat?(Input::UP)
        # If column count is 1 and directional button was pressed up with no
        # repeat, or if cursor position is more to the back than column count
        if (@column_max == 1 and Input.trigger?(Input::UP)) or
           @index >= @column_max
          # Move cursor up
          $game_system.se_play($data_system.cursor_se)
          @index = (@index - @column_max + @item_max) % @item_max
        end
        end
        end
      end
      # If the right directional button was pressed
      if Input.repeat?(Input::RIGHT)
        # If column count is 2 or more, and cursor position is closer to front
        # than (item count -1)
        if @column_max >= 2 and @index < @item_max - 1
          # Move cursor right
          $game_system.se_play($data_system.cursor_se)
          @index += 1
        end
      end
      # If the left directional button was pressed
      if Input.repeat?(Input::LEFT)
        # If column count is 2 or more, and cursor position is more back than 0
        if @column_max >= 2 and @index > 0
          # Move cursor left
          $game_system.se_play($data_system.cursor_se)
          @index -= 1
        end
      end
      # If R button was pressed
      if Input.repeat?(Input::R)
        # If bottom row being displayed is more to front than bottom data row
        if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
          # Move cursor 1 page back
          $game_system.se_play($data_system.cursor_se)
          @index = [@index + self.page_item_max, @item_max - 1].min
          self.top_row += self.page_row_max
        end
      end
      # If L button was pressed
      if Input.repeat?(Input::L)
        # If top row being displayed is more to back than 0
        if self.top_row > 0
          # Move cursor 1 page forward
          $game_system.se_play($data_system.cursor_se)
          @index = [@index - self.page_item_max, 0].max
          self.top_row -= self.page_row_max
        end
      end
    end
    # Update help text (update_help is defined by the subclasses)
    if self.active and @help_window != nil
      update_help
    end
    # Update cursor rectangle
    update_cursor_rect
  end
end


Thanks for the help ^_^.
 
Just copy window_selectable, name it window_selectable2 (class Window_Selectable2). Then instead of refering to Window_Selectable, use Window_Selectable2. You can change everything in Window_Selectable2 (so left to right).

Tell me if there are any problems :)
 
There is one problem, I do not see where ti calls window selectable in the mog menu:

Code:
#_________________________________________________
# MOG Animated Title Celia V1.1            
#_________________________________________________
# By Moghunter      
#_________________________________________________
if true
module MOG
#Auto FullScreen.  
FULL_SCREEN = false
#Number of frames.(Title pictures).
BACKTITLEREF = 0
#Animation Speed.
BACKTITLESPEED = 0
#Title picture name.
TITLEIMG = "Title"
#Transition Type.
TRANS_TITLE = "Transi.png"
#Transition Time.
TRANS_TIME = 0
#Command Picture name.
COM = "Com"
#Command Position.
COM_X = 0  # Com X Pos
COM_Y = 0  # Com Y Pos
end
$mogscript = {} if $mogscript == nil
$mogscript["title_celia"] = false
#----------------------------------
# Scene_Title
#----------------------------------
$full_screen = 0
class Scene_Title
  def main
    if $BTEST
      battle_test
      return
    end
    $full_screen += 1
    if MOG::FULL_SCREEN == true and $full_screen == 1
    $showm = Win32API.new 'user32', 'keybd_event', %w(l l l l), ' ' 
    $showm.call(18,0,0,0) 
    $showm.call(13,0,0,0) 
    $showm.call(13,0,2,0) 
    $showm.call(18,0,2,0)
    end             
    $data_actors        = load_data("Data/Actors.rxdata")
    $data_classes       = load_data("Data/Classes.rxdata")
    $data_skills        = load_data("Data/Skills.rxdata")
    $data_items         = load_data("Data/Items.rxdata")
    $data_weapons       = load_data("Data/Weapons.rxdata")
    $data_armors        = load_data("Data/Armors.rxdata")
    $data_enemies       = load_data("Data/Enemies.rxdata")
    $data_troops        = load_data("Data/Troops.rxdata")
    $data_states        = load_data("Data/States.rxdata")
    $data_animations    = load_data("Data/Animations.rxdata")
    $data_tilesets      = load_data("Data/Tilesets.rxdata")
    $data_common_events = load_data("Data/CommonEvents.rxdata")
    $data_system        = load_data("Data/System.rxdata")
    $game_system = Game_System.new
    s1 = "New Game"
    s2 = "Continue"
    s3 = "Give up"
    @command_window = Window_Command.new(192, [s1, s2, s3])
    @command_window.back_opacity = 160
    @command_window.x = 320 - @command_window.width / 2
    @command_window.y = 288
    @command_window.visible = false
    @com = Sprite.new
    @com.bitmap = RPG::Cache.title(MOG::COM + "_01")
    @com.z = 10
    @com.x = (MOG::COM_X)
    @com.y = (MOG::COM_Y)
    @continue_enabled = false
    @frmtitle = Sprite.new
    @frmtitle.bitmap = Bitmap.new(640,480)
    @frmtitle.bitmap = RPG::Cache.title("")
    @backtitleref = 0 
    @backtitlespeed = 0
    for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    if @continue_enabled
      @command_window.index = 1
    else
      @command_window.disable_item(1)
    end
    $game_system.bgm_play($data_system.title_bgm)
    Audio.me_stop
    Audio.bgs_stop
    Graphics.transition(MOG::TRANS_TIME, "Graphics/Transitions/" + MOG::TRANS_TITLE )
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @frmtitle.dispose
    @com.dispose
  end
  def update
    @command_window.update
     case @command_window.index
     when 0
     @com.bitmap = RPG::Cache.title(MOG::COM + "_01")       
     when 1
     @com.bitmap = RPG::Cache.title(MOG::COM + "_02")       
     when 2
     @com.bitmap = RPG::Cache.title(MOG::COM + "_03")
     end       
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0  
        command_new_game
      when 1  
        command_continue
      when 2 
        command_shutdown
      end
    end
     @backtitlespeed += 1    
  if @backtitlespeed > MOG::BACKTITLESPEED 
     @backtitleref += 1
     @backtitlespeed = 0
  end
  if @backtitleref > MOG::BACKTITLEREF
     @backtitleref = 0 
  end  
  @frmtitle.bitmap = RPG::Cache.title(MOG::TITLEIMG + @backtitleref.to_s)
  end
  def command_new_game
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_stop
    Graphics.frame_count = 0
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    $game_party.setup_starting_members
    $game_map.setup($data_system.start_map_id)
    $game_player.moveto($data_system.start_x, $data_system.start_y)
    $game_player.refresh
    $game_map.autoplay
    $game_map.update
    $scene = Scene_Map.new
  end
  def command_continue
    unless @continue_enabled
      $game_system.se_play($data_system.buzzer_se)
      return
    end
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_Load.new
  end
  def command_shutdown
    $game_system.se_play($data_system.decision_se)
    Audio.bgm_fade(800)
    Audio.bgs_fade(800)
    Audio.me_fade(800)
    $scene = nil
  end
  def battle_test
    $data_actors        = load_data("Data/BT_Actors.rxdata")
    $data_classes       = load_data("Data/BT_Classes.rxdata")
    $data_skills        = load_data("Data/BT_Skills.rxdata")
    $data_items         = load_data("Data/BT_Items.rxdata")
    $data_weapons       = load_data("Data/BT_Weapons.rxdata")
    $data_armors        = load_data("Data/BT_Armors.rxdata")
    $data_enemies       = load_data("Data/BT_Enemies.rxdata")
    $data_troops        = load_data("Data/BT_Troops.rxdata")
    $data_states        = load_data("Data/BT_States.rxdata")
    $data_animations    = load_data("Data/BT_Animations.rxdata")
    $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
    $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
    $data_system        = load_data("Data/BT_System.rxdata")
    Graphics.frame_count = 0
    $game_temp          = Game_Temp.new
    $game_system        = Game_System.new
    $game_switches      = Game_Switches.new
    $game_variables     = Game_Variables.new
    $game_self_switches = Game_SelfSwitches.new
    $game_screen        = Game_Screen.new
    $game_actors        = Game_Actors.new
    $game_party         = Game_Party.new
    $game_troop         = Game_Troop.new
    $game_map           = Game_Map.new
    $game_player        = Game_Player.new
    $game_party.setup_battle_test_members
    $game_temp.battle_troop_id = $data_system.test_troop_id
    $game_temp.battle_can_escape = true
    $game_map.battleback_name = $data_system.battleback_name
    $game_system.se_play($data_system.battle_start_se)
    $game_system.bgm_play($game_system.battle_bgm)
    $scene = Scene_Battle.new
  end
end
end
 
Ugh, that is one ugly set of code.
Anyways, it's using a Window_Command, which is a child class of Window_Selectable.
Ideally, you should just be able to set
@command_window.column_max = 3
after the command_window is initiated, but I'm not sure if you have access to column_max.

If that doesn't work for you, I'll take a better look once I'm at home and have access to look things up.

[Edit] Ok, I'm at home, so I could play. Add this command anywhere above the Mogmenu as well as adding the line I mentioned above under the command window initialization
Code:
class Window_Command < Window_Selectable
  def column_max=(col_max)
    @column_max = col_max
  end
end
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top