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.

Minor Edit

I'm just looking for another minor edit, well maybe not to minor. :-/

Anyway, I'm using a credit script to display the credits but I really don't like how it's stationary. The credits zoom over a stationary background title image.

Their is two edits I would like made to the script:

1) The background should play as soon as the call script is given, for some reason the author only made the credits scene display and not have music. You should be able to customize the music, such as volume and pitch through the script as well

So something like:

game.bgm.play =

@volume = 100

@pitch = 90

2) I would like several images to be displayed throughout the credits. Every x frames, the image that would be currently displayed would switch to another image. So the background is never the same. The images would be placed in the pictures folder.

For example I'm not sure if anyone has ever played Final Fantasy 8 but if you have you notice the intro has the music playing and it scrolls through a bunch of pictures. I want these credits to do the same. When one image is switched to another, I would like a fading effect.

Code:
CREDITS_FONT = "Times New Roman"
CREDITS_SIZE = 24
CREDITS_OUTLINE = Color.new(0,0,127, 255)
CREDITS_SHADOW = Color.new(0,0,0, 100)
CREDITS_FILL = Color.new(255,255,255, 255)

#==============================================================================
# ? Scene_Credits
#------------------------------------------------------------------------------
#  Scrolls the credits you make below. Original Author unknown. Edited by
#  MiDas Mike so it doesn't play over the Title, but runs by calling the following:
#  $scene = Scene_Credits.new
#==============================================================================

class Scene_Credits

  # This next piece of code is the credits.
  
    CREDIT=<<_END_
#Start Editing
Untitled Project

Director
---------------
MiDas Mike

Scripts
---------------
SephirothSpawn
Deke
Dubealex
Momomomo? (yes, that's their name)
Wachunga
Near Fantastica
Datriot
MeisMe
rpgmaker
CogWheel
BudsieBuds

Graphics
---------------
Tana
zanyzora
ccoa
Enterbrain
TR-the-one-and-only

Music and sound
---------------
Andrew Estrada
DoomWorld.com
IcePlug
Andy Smith
Enterbrain
Joe Gallagher
drenrin2120

Mapping
---------------
MiDas Mike

Storyline
---------------
MiDas Mike

Beta Testers
---------------


Special Thanks
---------------
Unlimited Adventures - "Without that game, this game would never
have made a start. UA is where Journey of Heroes first started."

Trickster - "Thanks for fixing the scripts. I greatly appreciate your
help in this project."

---------------

Thank you for playing this game. We hope you enjoyed it. Watch for
other titles by MiDas Productions in the future..

#Stop Editing
_END_
  def main
    
    #-------------------------------
    # Animated Background Setup
    #-------------------------------
    @sprite = Sprite.new
    #@sprite.bitmap = RPG::Cache.title($data_system.title_name)
    @backgroundList = ["Land of Arcania"] #Edit this to the title screen(s) you wish to show in the background. They do repeat.
    @backgroundGameFrameCount = 0
    # Number of game frames per background frame.
    @backgroundG_BFrameCount = 3.4
    @sprite.bitmap = RPG::Cache.title(@backgroundList[0])
    
    #------------------
    # Credits Setup
    #------------------
    
    credit_lines = CREDIT.split(/\n/)
    credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
    credit_lines.each_index do |i|
      line = credit_lines[i]
      credit_bitmap.font.name = CREDITS_FONT
      credit_bitmap.font.size = CREDITS_SIZE
      x = 0
       credit_bitmap.font.color = CREDITS_OUTLINE
       credit_bitmap.draw_text(0 + 1,i * 32 + 1,640,32,line,1)
       credit_bitmap.draw_text(0 - 1,i * 32 + 1,640,32,line,1)
       credit_bitmap.draw_text(0 + 1,i * 32 - 1,640,32,line,1)
       credit_bitmap.draw_text(0 - 1,i * 32 - 1,640,32,line,1)
       credit_bitmap.font.color = CREDITS_SHADOW
       credit_bitmap.draw_text(0,i * 32 + 8,640,32,line,1)
       credit_bitmap.font.color = CREDITS_FILL
      credit_bitmap.draw_text(0,i * 32,640,32,line,1)
    end
    @credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
    @credit_sprite.bitmap = credit_bitmap
    @credit_sprite.z = 9998
    @credit_sprite.oy = -430
    @frame_index = 0
    @last_flag = false
    
    #--------
    # Setup
    #--------
    
    # ME?BGS ??????
    Audio.me_stop
    Audio.bgs_stop
    Audio.se_stop
    # ?????????
    Graphics.transition
    # ??????
    loop do
      # ????????
      Graphics.update
      # ???????
      Input.update
      # ??????
      update
      # ????????????????
      if $scene != self
        break
      end
    end
    # ?????????
    Graphics.freeze
    @sprite.dispose
    @credit_sprite.dispose
  end
  
  #Checks if credits bitmap has reached it's ending point
  def last?
    return (@frame_index >= @credit_sprite.bitmap.height + 480)
  end
  def last
    if not @last_flag
      @last_flag = true
      @last_count = 0
    else
      @last_count += 1
    end
    if @last_count >= 300
      $scene = Scene_Map.new
    end
  end
  
  #Check if the credits should be cancelled
    def cancel?
    if Input.trigger?(Input::C)
      $scene = Scene_Map.new
      return true
    end
    return false
  end
  
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    @backgroundGameFrameCount = @backgroundGameFrameCount + 1
    if @backgroundGameFrameCount >= @backgroundG_BFrameCount
     @backgroundGameFrameCount = 0
     # Add current background frame to the end
     @backgroundList = @backgroundList << @backgroundList[0]
     # and drop it from the first position
     @backgroundList.delete_at(0)
     @sprite.bitmap = RPG::Cache.title(@backgroundList[0])
   end
    return if cancel?
    last if last?
    @credit_sprite.oy += 1
  end
end

I know I wasn't to clear with my explanations but if you have any questions please don't hesitate to ask! ;)
 
Bump.

I'll include more info:

The script resembles one created by Seph:

Code:
#==============================================================================
# ** Introduction & Splash System
#------------------------------------------------------------------------------
# SephirothSpawn
# Version 4
# 2006-12-06
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1 -------------------------------------------- (Aprrox. 2005-01-01)
#   Version 2 ---------------------------------------------------- (2005-01-08)
#    - Update : Re-scripted Much of the System
#   Version 3 ---------------------------------------------------- (2006-08-04)
#    - Update : Re-scripted Much of the System
#    Version 3.01 ------------------------------------------------ (2006-10-17)
#     - Bug Fix : Made Introduction Scene Child Class of Scene Base
#   Version 4 ---------------------------------------------------- (2006-12-06)
#    - Update : Re-scripted Much of the System Adding New Features
#------------------------------------------------------------------------------
# * Requirements :
#
#   Scene_Base
#------------------------------------------------------------------------------
# * Description :
#
#   This Script was designed to create an introduction before the title screen
#   in your game. You will also have the option to display a splash screen,
#   where an image will flash (Usually Press Start). It also adds a timer at
#   both the splash screen and in the title screen, so after X seconds, it
#   will replay the introduction and splash. The splash is completely
#   optional. You can "hold" images for a defined duration before the image
#   disappears as well.
#
#   You can now add skip function, that will allow you to skip the introduction
#   if: skip if first play, skip additional plays, skip if savefile is found.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place The Script Below the SDK and Above Main.
#   To Setup Introduction, refer to customization below.
#------------------------------------------------------------------------------
# * Customization :
#
#   Play in Debug Mode
#    - Play_Intro_In_Debug_Mode = true (ON) or false (OFF)
#
#   ** Skip Options **
#
#   Can Skip if Savefile Present
#    - Can_Skip_Savefile = true or false
#
#   Can Skip Intro If First Play
#    - Can_Skip_FirstPlay = true or false
#
#   Can Skip Intor If Additonal Play
#    - Can_Skip_AdditionalPlays = true or false
#
#   ** Intor Options **
#
#   Intorduction Pictures
#    - Intro_Pictures         = ['filename', ...]
#
#   Introduction Wait Counts
#    - Intro_WaitCounts       = [n, ...]
#
#   Splash Image
#    - Splash_Picture         = 'filename' or nil
#
#   Start Image
#    - Start_Picture          = 'filename'
#
#   Introduction Image Speed
#    - Intro_Speed            = n
#
#   Start Image Speed
#    - Start_Speed            = n
#
#   Seconds To Restart Introduction from Splash
#    - Splash_Restart_Seconds = n
#
#   Seconds To Restart Introduction from Title
#    - Title_Restart_Seconds  = n
#
#   Introduciton BGM
#    - Introduction_BGM       = RPG::AudioFile
#==============================================================================

#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Introduction & Splash System', 'SephirothSpawn',4, '2006-12-06')

#------------------------------------------------------------------------------
# * Scene Base Test
#------------------------------------------------------------------------------
unless SDK.state('Scene Base')
  # Print Error
  p 'Scene Base Not Found. Introduction & Splash System Disabled.'
  # Disable Encounter Control
  SDK.disable('Introduction & Splash System')
end

#------------------------------------------------------------------------------
# * Begin SDK Enable Test
#------------------------------------------------------------------------------
if SDK.state('Introduction & Splash System')

#==============================================================================
# ** Play Introduction in Debug Mode
#==============================================================================

Play_Intro_In_Debug_Mode = false
  
#==============================================================================
# ** Scene_Introduction
#==============================================================================

class Scene_Introduction < Scene_Base
  #--------------------------------------------------------------------------
  # * Skip Intro Test
  #
  #   Can_Skip_Savefile = true or false
  #    - When Savefile is present
  #   Can_Skip_First_Play = true or false
  #    - When Game First Opening Intro
  #   Can_Skip_AdditionalPlays = true or false
  #    - When Returning From Title Screen (Replay)
  #--------------------------------------------------------------------------
  Can_Skip_Savefile = true
  Can_Skip_FirstPlay = false
  Can_Skip_AdditionalPlays = true
  #--------------------------------------------------------------------------
  # * Options
  #
  #  Intro_Pictures         = ['filename', ...]
  #  Intro_WaitCounts       = [n, ...]
  #  Splash_Picture         = 'filename' or nil
  #  Start_Picture          = 'filename'
  #  Intro_Speed            = n
  #  Start_Speed            = n
  #  Splash_Restart_Seconds = n
  #  Title_Restart_Seconds  = n
  #  Introduction_BGM       = RPG::AudioFile
  #--------------------------------------------------------------------------
  Intro_Pictures         = ['001-Title01', '001-Title01', '001-Title01']
  Intro_WaitCounts       = [40, 20, 10]
  Splash_Picture         = nil
  Start_Picture          = 'Press Start'
  Intro_Speed            = 5
  Start_Speed            = 5
  Splash_Restart_Seconds = 10
  Title_Restart_Seconds  = 15
  Introduction_BGM       = load_data('Data/System.rxdata').title_bgm
  #--------------------------------------------------------------------------
  # * Main Processing : Variable Initialization
  #--------------------------------------------------------------------------
  def main_variable
    # Sets Phase, Picture Index & Wait Count
    @index, @phase, @wait_count = 0, 0, 0
    # Sets Intro Pic Speed & Splash Pic Speed
    @sprite_speed, @start_speed = Intro_Speed, Start_Speed
    # Turns Extra Play off
    @extra_play = false
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Sprite Initialization
  #--------------------------------------------------------------------------
  def main_sprite
    # Background Images
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title(Intro_Pictures[@index])
    @sprite.opacity = 0
    # Start Logo
    unless Splash_Picture.nil?
      @start = Sprite.new
      @start.bitmap = RPG::Cache.title(Start_Image)
      @start.x = 320 - @start.bitmap.width / 2
      @start.y = 480 - @start.bitmap.height - 32
      @start.z = 10
      @start.opacity = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Audio Initialization
  #--------------------------------------------------------------------------
  def main_audio
    # Play Introduction BGM
    Audio.bgm_play('Audio/BGM/' + Introduction_BGM.name)
  end
  #--------------------------------------------------------------------------
  # * Main Processing : Ending
  #--------------------------------------------------------------------------
  def main_end
    # Fade BGM
    Audio.bgm_fade(5)
    # If Premain
    $pre_main ? $pre_main = false : $scene = Scene_Title.new
  end
  #--------------------------------------------------------------------------
  # * Can Skip?
  #--------------------------------------------------------------------------
  def can_skip?
    # If Savefile
    if Can_Skip_Savefile
      # Checks Each File
      for i in 0..3
        if FileTest.exist?("Save#{i+1}.rxdata")
          # Return True
          return true
        end
      end
    end
    # If First Play & Can Skip First Play
    if $pre_main && @extra_play == false
      # Return Can Skip First Play
      return Can_Skip_FirstPlay
    # If Title Play & Can Skip Title Plays
    else
      # Return Can Skip Additional Plays
      return Can_Skip_AdditionalPlays
    end
    # Return False
    return false
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    case @phase
    when 0 # Introduction Procreesing
      update_intro
    when 1 # Splash Procreesing
      update_splash
    when 2 # Splash Transition
      to_splash_transition
    when 3 # Title Transition
      to_title_transition
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Intro Images
  #--------------------------------------------------------------------------
  def update_intro
    # If C is pressed
    if Input.trigger?(Input::C)
      # If Can Skip
      if can_skip?
        # Invert Speed
        @sprite_speed *= -1 if @sprite_speed > 0
        # Switch Phase
        @phase = Splash_Picture.nil? ? 3 : 2
        return
      end
    end
    # If Wait Count
    if @wait_count > 0
      # Decrease Wait Count
      @wait_count -= 1
      return
    end
    # Updates Sprite Opacity
    @sprite.opacity += @sprite_speed
    # Changes Direction & Sets Wait Count
    if @sprite.opacity >= 255
      @sprite_speed *= -1 if @sprite_speed > 0
      @wait_count = Intro_WaitCounts[@index]
      return
    end
    # Change Sprite
    if @sprite.opacity <= 0
      # Increase Index & Inverts Intro Speed
      @index += 1 ; @sprite_speed *= -1
      # Switches Phase If Last Picture or Changes Intro Picure
      @index == Intro_Pictures.size ? @phase = Splash_Picture.nil? ? 3 : 2 :
        @sprite.bitmap = RPG::Cache.title(Intro_Pictures[@index])
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Splash Image
  #--------------------------------------------------------------------------
  def update_splash
    # If Restart on splash and seconds reached
    unless Splash_Restart_Seconds.nil?
      if Graphics.frame_count % 
         (Graphics.frame_rate * Seconds_Until_Restart) == 0
        # Restart Scene
        $scene = self.new
        # Turns Extra Play On
        @extra_play = true
        return
      end
    end
    # If C is pressed
    if Input.trigger?(Input::C)
      # Make Intro Speed Negative
      @sprite_speed *= -1 if @sprite_speed > 0
      # Make Splash Speed Negative
      @start_speed *= -1 if @start_speed > 0
      # Switches To Title Phase
      @phase = 3
      return
    end
    # Loads Sprite Splash Bitmap
    @sprite.bitmap = RPG::Cache.title(Splash_Picture)
    # Updates Sprite Opacity
    @sprite.opacity += @sprite_speed
    # Updates Start Logo Opacity
    @start.opacity += @start_speed
    # Changes Direction
    @start_speed *= -1 if @start.opacity >= 255 || @start.opacity <= 0
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Intro To Splash Transistion
  #--------------------------------------------------------------------------
  def to_splash_transition
    # Make Sprite Speed Negitve (If Not)
    @sprite_speed *= -1 if @sprite_speed > 0
    # Decrease Intro Pic Opacity
    if @sprite.opacity > 0
      @sprite.opacity += @sprite_speed
      return
    end
    # Switch Phase
    @phase = 1
  end
  #--------------------------------------------------------------------------
  # * Frame Update : Splash To Title Transistion
  #--------------------------------------------------------------------------
  def to_title_transition
    # Make Sprite Speed Negitve (If Not)
    @sprite_speed *= -1 if @sprite_speed > 0
    @start_speed  *= -1 if @start_speed  > 0
    # Decrease Intro Pic Opacity
    if @sprite.opacity > 0
      @sprite.opacity += @sprite_speed
    end
    # Updates Splash Opacity
    unless @start.nil?
      if @start.opacity > 0
        @start.opacity += @start_speed
      end
    end
    # Stop If Opacities Not 0
    if @sprite.opacity > 0 || ( (not @start.nil?) && @start.opacity )
      return
    end
    # End Introduction
    $scene = nil
    # Restart Graphics Frame Count
    Graphics.frame_count = 0
  end
end
 
#==============================================================================
# ** Scene_Title
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias seph_intro_scnttl_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If Play in Debug or Not In Debug Mode
    if Play_Intro_In_Debug_Mode || (not $DEBUG)
      # If Restart && Seconds Reached
      unless (secs = Scene_Introduction::Title_Restart_Seconds).nil?
        if Graphics.frame_count % (Graphics.frame_rate * secs) == 0
          # Switch to Splash Scene
          $scene = Scene_Introduction.new
        end
      end
    end
    # Original Update
    seph_intro_scnttl_update
  end
end

#==============================================================================
# ** Pre-Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

# If Play in Debug or Not In Debug Mode
if Play_Intro_In_Debug_Mode || (not $DEBUG)
  begin 
    # Sets Pre-main flag
    $pre_main = true
    # Prepare for transition
    Graphics.freeze
    # Proceed to Introduction & Splash Scene
    $scene = Scene_Introduction.new
    # Call main method as long as $scene is effective
    while $scene != nil
      $scene.main
    end
  end
end

#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end

One key change I want from this script is the ability to scroll text from down to up over these splash screens, similar to how the text scrolls in the credits script listed above. And I'd like this script only to be activated by call script.

If you need further info, please ask!
 
Alright, one last try at trying to explain this:

This credit script is called by:

Code:
$scene = Scene_Credits.new

When I use the call script command, their is no music playing with the script. I have to add it manually. I want music to play when the script starts.

As you can see, the credit script scrolls text above a background image. What I want the script to do is fade that background image to another image while having the text continue to scroll. And do this for about x amount of images. When the script has run out of images to display, the rmxp program shuts down.

This request shouldn't be a "brain buster." I hope someone can get to this.
 
haha... i learned this ... but im not a scriptor... try this... at the very top...

Type in this :

BGM_FILENAME = " (NOW PUT the name of the file here) "

now at the point after the background display add this line here...

Audio.bgm_play("Audio/BGM/" + BGM_FILENAME)

it should work...

Edit: PS: your signature... i thought at the End of the game it says sometimes a devil may cry?
 

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