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.

[Resolved] Error with Three Image Title edited by Trickster

Status
Not open for further replies.
oops there was a bug in that (Due to Seph not documenting something)

Here is a correct version
Code:
=begin
#==============================================================================
# ?? Three Image Title Screen
#------------------------------------------------------------------------------
# Ccoa - made SDK compliant by Trickster
# Version 1.0
# Date 2/17/07
# Goto RMXP.org for updates/bug reports/comment
#
# Instructions:
#   1) Add Three Images Named 1, 2, and 3 to your Graphics/Titles Folder
#   2) Edit this line 10 change the transition
#      @transition_frames = 10
#      To the Number of Frame the Transition lasts
#==============================================================================
=end
  
#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log("Three Image Title Screen", "Ccoa/Trickster", 1.0, "2.17.07")
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3, 4])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?("Three Image Title Screen")
  
class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    main_sprite                   # Main Sprite Initialization
    main_variable                 # Main Variable Initialization
    main_spriteset                # Main Spriteset Initialization
    main_window                   # Main Window Initialization
    main_audio                    # Main Audio Initialization
    main_transition               # Main Transition Initialization
    loop do                       # Scene Loop
      main_loop                   # Main Loop
      break if main_break?        # Break If Breakloop Test 
    end                           # End Scene Loop
    Graphics.freeze               # Prepare for transition
    main_dispose                  # Main Dispose
    main_end                      # Main End
  end
  #--------------------------------------------------------------------------
  # * Background Initialization
  #--------------------------------------------------------------------------
  alias_method :trick_ccoa_threeimage_title_main_sprite, :main_sprite
  def main_sprite
    # Load System Info
    $data_system = load_data("Data/System.rxdata")
    # The Usual
    trick_ccoa_threeimage_title_main_sprite
    # Create Back Ground Sprite
    @back_sprite = Sprite.new
    # Set Z
    @back_sprite.z = @sprite.z - 10
    # transition between images, set to 0 if none
    @transition_frames = 10
    # Get Change (Delta)
    @delta = 255 / @transition_frames
    # Setup Wait Variable
    @wait = 0
  end
  #--------------------------------------------------------------------------
  # * Main Menu Initialization
  #--------------------------------------------------------------------------
  alias_method :trick_ccoa_threeimage_title_main_window, :main_window
  def main_window
    # The Usual
    trick_ccoa_threeimage_title_main_window
    # Disable Command Window
    @command_window.visible = false
    @command_window.active = false
  end
  #--------------------------------------------------------------------------
  # * Main Test Continue
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Scene_Title, :main_test_continue)
  def main_test_continue
    # Continue enabled determinant
    # Check if at least one save file exists
    # If enabled, make @continue_enabled true; if disabled, make it false
    @continue_enabled = false
    for i in 0..3
      if FileTest.exist?("Save#{i+1}.rxdata")
        @continue_enabled = true
      end
    end
    # If continue is enabled, move cursor to "Continue"
    if @continue_enabled
      # Set Bitmaps
      @sprite.bitmap = RPG::Cache.title('2')
      @back_sprite.bitmap = RPG::Cache.title('2')
      # Ser Index
      @index = 1
    else
      # Set Bitmaps
      @sprite.bitmap = RPG::Cache.title('1')
      @back_sprite.bitmap = RPG::Cache.title('1')
      # Set Index
      @index = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Update
  #--------------------------------------------------------------------------
  SDK.log_overwrite(:Scene_Title, :update)
  def update
    # If Wait is Greater than 0
    if @wait >= 0
      # If Wait is 0
      if @wait == 0
        # Set Bitmap and opacity
        @sprite.bitmap = RPG::Cache.title((@index+1).to_s)
        @sprite.opacity = 255
      else
        # Reduce Opacity
        @sprite.opacity -= @delta
      end
      # Reduce Wait
      @wait -= 1
      # Return
      return
    end
    # If directional buttons are pressed
    if Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
      # Cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Reduce By 1 Restrict to 0-2
      @index = (@index - 1) % 3
      # Set Wait
      @wait = @transition_frames
      # Set Bitmap
      @back_sprite.bitmap = RPG::Cache.title((@index+1).to_s)
    end
    # If directional buttons are pressed
    if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
      # Cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Add 1 Restrict to 0-2
      @index = (@index + 1) % 3
      # Set Wait
      @wait = @transition_frames
      # Set Bitmap
      @back_sprite.bitmap = RPG::Cache.title((@index+1).to_s)
    end
    # If C is Pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @index
      when 0  # New game
        command_new_game
      when 1  # Continue
        command_continue
      when 2  # Shutdown
        command_shutdown
      end
    end
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
 
You are Welcome, I did have that script just forgot to update it in that topic sorry for that

This topic has been resolved. If Jonny or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
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