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.

Adding a SE to this script?

Hi - I have the following script:

Code:
class Scene_Intro

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor_index : actor index

  #--------------------------------------------------------------------------

  def initialize

      $ads = 0

  end

  #--------------------------------------------------------------------------

  # * Main Processing

  #--------------------------------------------------------------------------

  def main

    # Load database

    $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

    @window = Window_Intro.new

    @frame = 0

    Audio.me_stop

    Audio.bgs_stop

    Graphics.transition

    loop do

      Graphics.update

      Input.update

      update

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    if Graphics.frame_count / Graphics.frame_rate != @total_sec

      @frame += 0.7

      @total_sec = Graphics.frame_count / Graphics.frame_rate

    end

    if @frame >= 5

      @window.contents_opacity -= 10

      if @window.contents_opacity < 1

         if $ads == 0

         @window.dispose

         $scene = Scene_Title.new

         else

         $ads +=1

         @window.contents_opacity = 255

         @frame = 0

         @window.refresh

         end

      end

    end

  end

end

 

class Window_Intro < Window_Base

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(-16, -16, 672, 512)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.opacity = 0

    refresh

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    bitmap1 = RPG::Cache.picture("digibeetproduction")

    bitmap = [bitmap1]

    self.contents.blt(0, 0, bitmap[$ads], Rect.new(0, 0, 640, 480))

  end

end

 

It basically shows a picture before the main menu. How do I make it play a SE whilst showing the picture. (I'm guessing it's simply an easy couple of lines of code that need to be added to this script? ) The SE is called "scratch" and is in the Audio/SE folder.

Thanks
 
Why not show us the answer? Although some of us may also be able to find the answer on our own, it would be nice to help those who stumble across this thread in search of an aswer to the same question.
 

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