设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 92|回复: 0

[转载发布] VVulfSplash: The Splash Screen Script

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4469

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22945
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28308

    灌水之王

    发表于 6 天前 | 显示全部楼层 |阅读模式
    VVulfSplash
    The Splash Screen Script
    version 1.0




    INTRODUCTION
    There have been many splash scripts out there, but many force the game developer to use a fixed number of screens. And those that don't, those few rarely allow the setting  for how long a splash screen may last of if any music or audio plays when it is shown.   This splash screen script covers all of those features.



    DEMO
    (>HOWUU!!!<)



    SCRIPT
    Spoiler: The Script is here!
                    Code:        
    #============================================================================== # ** VVulfSplash #------------------------------------------------------------------------------ #    by DerVVulfman #    version 1.0 #    09-10-2019 #    RGSS / RMXP #============================================================================== # #  INTRODUCTION: # #  There have been many splash scripts out ther, but many force the game de- #  veloper to use a fixed number of screens. And those that don't, those few #  rarely allow the setting  for how long a splash screen may last of if any #  music or audio plays when it is shown.   This splash screen script covers #  all of those features. # # #------------------------------------------------------------------------------ # #  INSTALLATION: # #  Place this script right below Scene_Debug and above Main  for it to work. # #  If you find the need to 'FORCE' it to show immediately, you can erase the #  last two lines under the heading of 'Link System',  and replace the entry  #  of  $scene = Scene_Title.new with Scene_VVulfSplash.new.  # #  Configure as needed. # # #------------------------------------------------------------------------------ # #  RESOURCES: # #  It's a freakin splash screen script! OF COURSE IT NEEDS RESOURCES!  DUH! # #  Splash screens are kept within the new  'Graphics\Splash'  folder of your #  project.  And they are the classic 640x480 format. # #  If any audio files are to be played, they are in the Audio\BGM folder. # #------------------------------------------------------------------------------ # #  COMPATABILITY: # #  Fairly compatible for RPGMaker XP systems. It doesn't rewrite any methods #  in the system.  But it does create a caching system for a Graphics\Splash #  folder which does compress with the rest of your game. # #------------------------------------------------------------------------------ # #  TERMS OF USE: # #  Free for use, even in commercial games.  Only due credit is required. # # #==============================================================================    module VVulfSplash      #--------------------------------------------------------------------------   SPLASH = {} # Do Not Touch   #--------------------------------------------------------------------------      # SKIP SYSTEM   # ===========   # These editable values  control how your splash screen  will be controlled   # hy the player, or if the screen shows when you are playing in debug mode.   #--------------------------------------------------------------------------   #     SKIP      = true              # Is skip permitted?     SKIP_SE   = '002-System02'    # SE performed when skipped (or nil or "")     PLAYTEST  = true              # Perform Splashscreens in Playtest Mode         # INTRO SCREENS   # =============   # This is  a collection  of one (or more)  hash arrays,  each array holding    # various entries for each individual splash screen.  They must be in order.   #--------------------------------------------------------------------------   # MUSIC:  It can play a background music file if set (Audio\BGM)   #         By default,  it will fade out the music to match the screen fade.   #         If a 'music-fade' entry is added,  it will fade out based on that   #         value or until the screen fades, whichever is first.   #--------------------------------------------------------------------------   # Image ... Valid image for splash screen   # In ...... Fade-in delay for splash screen   # Show .... The time which the splash screen is shown   # Out ..... Fade-out time for splash screen   # Music ... (optional) The background music played for the splash screen   # MFade ... (optional) The amount of time it takes for the music to fade   #   #               Image     In    Show  Out   Music             MFade   #               =======   ===== ===== ===== ================= =====     SPLASH[0] = ['Intro 1', 51,   25,   51]     SPLASH[1] = ['Intro 2', 51,   75,   51,   'howl',            1.1]    end    #============================================================================== # ** RPG::Cache #------------------------------------------------------------------------------ #  This is a module that loads each of RPGXP's graphic formats, creates a  #  Bitmap object, and retains it. #==============================================================================  module RPG::Cache   #--------------------------------------------------------------------------   # * Splash Screen Cache   #     filename : splash screen filename   #--------------------------------------------------------------------------   def self.splash(filename)     self.load_bitmap("Graphics/Splash/", filename)   end end    #============================================================================== # ** Scene_VVulfSplash #------------------------------------------------------------------------------ #  This class performs splash screen processing. #==============================================================================  class Scene_VVulfSplash   #--------------------------------------------------------------------------   # * Main Processing   #--------------------------------------------------------------------------   def main     if $DEBUG && VVulfSplash::PLAYTEST == false     # If Debug and Playtest off       $scene = Scene_Title.new                      # Go to Title Screen     end         Audio.me_stop                                   # Stop playing ME     Audio.bgs_stop                                  # Stop playing BGS     main_variables                                  # Instance Variables     Graphics.transition                             # Execute transition     loop do                                         # Main loop       Graphics.update                               # Update game screen       Input.update                                  # Update input information       update                                        # Frame update       break if $scene != self                       # Abort loop if changed     end         Graphics.freeze                                 # Prepare for transition     @splash.dispose                                 # Dispose of Sprites   end   #--------------------------------------------------------------------------   # * Main Processing : Handling startup variables   #--------------------------------------------------------------------------   def main_variables     filename        = "Data/System.rxdata"          # Define system data file      $data_system    = load_data(filename)           # Load system data file     $game_system    = Game_System.new               # Create Game_System object     @splash         = Sprite.new                    # Create Sprite     @screens        = VVulfSplash::SPLASH.size      # Determine no. of splashes     @loaded         = false                         # Set splashes not loaded     @index          = 0                             # Set index to start     @wait           = 0                             # Set no wait time set     @audio_flag     = 0                             # Set no active audio flag   end   #--------------------------------------------------------------------------   # * Frame Update   #--------------------------------------------------------------------------   def update     update_exit     if update_decision? == true     # Exit on player input     intro_update                                    # Process Splashscreens   end   #--------------------------------------------------------------------------   # * Frame Update : Acquire player decision   #--------------------------------------------------------------------------   def update_decision?     return false unless VVulfSplash::SKIP == true    # Set False if no skip     return false unless Input.trigger?(Input::C)     # Set false if no decision     unless VVulfSplash::SKIP_SE.nil? or              # Only work if file not nil         VVulfSplash::SKIP_SE == ""                   # or file not empty       audiofile =                                    # Define the audiofile as           RPG::AudioFile.new(VVulfSplash::SKIP_SE)   # ...the one in the config       $game_system.se_play(audiofile)                # And play the file     end         return true                                      # Return as true   end   #--------------------------------------------------------------------------   # * Frame Update : Process through splashscreens   #--------------------------------------------------------------------------   def intro_update     return          if update_delay == true         # Pause after showing screen     update_load                                     # Load / reset each screen     update_audio                                    # Set (or fade out) music     update_reverse                                  # Determine if reversing     @splash.opacity += @speed                       # Apply opacity     update_advance                                  # Advance to next screen     update_exit     if @index == @screens           # Exit if screens played   end   #--------------------------------------------------------------------------   # * Frame Update : Pause Image before fade out   #--------------------------------------------------------------------------   def update_delay     return false    unless @wait > 0                # Exit unless delay valid     return false    unless @reversed == true        # Exit unless refersing set     @wait           -= 1                            # Decrease delay time     @audio_flag     = 2     if @wait < 2            # Set Audio Flag before end     Graphics.update                                 # Advance Graphics frame +1     return true                                     # Exit w/ active delay true   end   #--------------------------------------------------------------------------   # * Frame Update : Load image and data   #--------------------------------------------------------------------------   def update_load     return          if @loaded == true                # Exit if already loaded     filename        = VVulfSplash::SPLASH[@index][0]  # Obtain splash filename     @splash.bitmap  = RPG::Cache.splash(filename)     # Set splash graphic     speed_val       = VVulfSplash::SPLASH[@index][1]  # Obtain config speed     @speed          = (255.0 / speed_val).to_i        # Set actual speed     @wait           = VVulfSplash::SPLASH[@index][2]  # Obtain wait time     @splash.opacity = 0                               # Set initial opacity     @audio_flag     = 1                               # Set audio to start     @loaded         = true                            # Set loaded flag     @reversed       = false                           # Disable reverse flag   end   #--------------------------------------------------------------------------   # * Frame Update : Handling Audio Playback   #--------------------------------------------------------------------------   def update_audio     case @audio_flag                                # Branch on system action     when 1 ; update_audio_play                      # Screen load - start audio     when 2 ; update_audio_fade                      # Delay ended - fade audio     end     @audio_flag = 0                                 # Disable audio flag   end   #--------------------------------------------------------------------------   # * Frame Update : Handling Audio Start   #--------------------------------------------------------------------------   def update_audio_play     filename      = VVulfSplash::SPLASH[@index][4]  # Acquire filename     return        if filename.nil?                  # Exit if nil     return        if filename == ""                 # Exit if empty     playback      = RPG::AudioFile.new(filename)    # Set up the audio     $game_system.bgm_play(playback)                 # Play the audio   end   #--------------------------------------------------------------------------   # * Frame Update : Handling Audio Fade   #--------------------------------------------------------------------------   def update_audio_fade     return if VVulfSplash::SPLASH[@index][4].nil?   # Exit if no audio played     flag  = (VVulfSplash::SPLASH[@index][5] == nil) # is no-custom nil?     idx   = (flag) ? 3 : 5                          # Obtain index in array     mult  = (flag) ? 25 : 1000                      # Obtain time multiplier     delay = VVulfSplash::SPLASH[@index][idx] * mult # Calculate delay     Audio.bgm_fade(delay)                           # Fade out audio   end   #--------------------------------------------------------------------------   # * Frame Update : Reverse opacity direction   #--------------------------------------------------------------------------   def update_reverse     return        if @splash.opacity < 255          # Begin only after fade in     return        if @reversed == true              # Begin if not reversing     @reversed     = true                            # Set as reversing     speed_val     = VVulfSplash::SPLASH[@index][3]  # Obtain config speed     @speed        = -1 * (255.0 / speed_val).to_i   # Set actual speed   end   #--------------------------------------------------------------------------   # * Frame Update : Advance index to next image   #--------------------------------------------------------------------------   def update_advance     return          unless @splash.opacity <= 0     # Exit if still opaque     @loaded         = false                         # Set image as not loaded     @index          += 1                            # Advance to next index   end   #--------------------------------------------------------------------------   # * Frame Update : Exit to Title   #--------------------------------------------------------------------------   def update_exit     Graphics.freeze                                 # Prepare for transition     $scene = Scene_Title.new                        # Proceed to Title Screen   end   #--------------------------------------------------------------------------   # * Link system to start playback   #--------------------------------------------------------------------------   $scene = Scene_VVulfSplash.new                    # Set scene to Splash   $scene.main while $scene.is_a?(self)              # Set current scene end




    RESOURCES

    It's a freakin splash screen script! OF COURSE IT NEEDS RESOURCES!  DUH!

    Splash screens are kept within the new  'Graphics\Splash'  folder of your project.  And they are the classic 640x480 format.

    If any audio files are to be played, they are in the Audio\BGM folder.



    COMPATIBILITY
    Fairly compatible for RPGMaker XP systems. It doesn't rewrite any methods in the system.  But it does create a caching system for a Graphics\Splash folder which does compress with the rest of your game.



    TERMS OF USE
    Free for use, even in commercial games.  Only due credit is required.


    本贴来自国际rpgmaker官方论坛作者:DerVVulfman处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/vvulfsplash-the-splash-screen-script.113156/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 17:54 , Processed in 0.144214 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表