Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.
|
|
| 2012-04-03, 23:07 | [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| aq pernah liat ada game yang windowskinnya bisa digonta ganti di menu option.. nah yang jadi pertanyaanku, gimana nambah menu option yang isinya 1. ngatur volume bgm + mute n unmute 2. ngatur volume SFX/SE + mute n unmute 3. Ganti windowskin untuk sementara itu isi dari menu option oh itya untuk bikin sprite yang beranimasi buaat di spoiler/judul game gmana? sekalian bikin full char buat di title menu... Trims |
| | | 2012-04-04, 05:10 | Re: [Solved] Naaf nanya lagi |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| Untuk yang system option gitu mungkin pake' script ini: - Spoiler:
- Code:
-
#=============================================================================== # # Yanfly Engine RD - Menu System Options # Last Date Updated: 2009.05.07 # Level: Easy, Normal # # The "End Game" option is quite possibly the most useless function in RPG Maker # VX games. Not only does it have little functionality but its functions can # be reproduced by Alt+F4 and F12. This script replaces "End Game" with a new # menu altogether and giving the player some familiar options seen in many of # today's commercial RPG's such as changing window skins, adjust sound volume, # turning off animations during battle, and the like. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.05.07 - Started script and finished. #=============================================================================== # Instructions #=============================================================================== # # Input this script anywhere above Main. It's plug and play outside of changing # a few variables and switches, which will be listed below: # # - If you have variables bound to variables 91, 92, 93, and 94, scroll down and # bind them to unused variables. # - If you have switches bound to switches 91, 92, 93, 94, 95, or 96, scroll # down and bind them to unused switches. # # Then, download the windows pack, and create a "Windows" folder inside your # Graphics folder. Input the windows pack there. You're all set to go. # #=============================================================================== # # Compatibility # - Alias: Game_Player: dash? # - Alias: Window_Base: initialize # - Alias: Scene_Battle: display_normal_animation # - Overwrites: Scene_End: All of it # - Overwrites: Vocab: game_end # #===============================================================================
$imported = {} if $imported == nil $imported["MenuSystemOptions"] = true
module YE module SYSTEM # This changes the "End Game" string to a new string. This completely # overrides the default term from the database for a reason and that's # because this is adjustable from the title menu as well. TITLE = " System" #--------------------- # Window Configuration #--------------------- # This will affect what string data will appear for the window selection # portion of the system menu. WINDOW_HELP = "Choose a windowskin." WINDOW_SKIN = "Windowskin" # This sets the default window used when nothing is selected. This also # determines the window skin used at the title screen. Reference it to # the list below to determine which window skin. Don't make this 0. DEFAULT_WINDOW = 1 # This determines the variable used to store the player's windowskin choice. WINDOW_VARIABLE = 91 # This below determines what the variable refers to when it's used as # reference. Put your windows inside the Graphics/Windows folder. ID 0 will # automatically push back to the default window's ID. WINDOW_HASH ={ # Window ID => Window Name 1 => "Royal Brown", 2 => "Classic Brown", } # Do not remove this. #--------------------- # Volume Configuration #--------------------- # This will affect what string data will appear for the volume adjustment # portion of the system menu. BGM_HELP = "BGM Volume Configuration. Press L/R to Enable/Disable Mute." SFX_HELP = "SFX Volume Configuration. Press L/R to Enable/Disable Mute." BGS_HELP = "BGS Volume Configuration. Press L/R to Enable/Disable Mute." BGM_TITLE = "BGM Volume" SFX_TITLE = "SFX Volume" BGS_TITLE = "BGS Volume" VOL_MUTE = "Mute" # These are the variables and switches that govern the sound effect volumes. # Note that for the variables, the higher they are, the lower the volume. BGM_VOLUME_VAR = 92 # Variable SFX_VOLUME_VAR = 93 # Variable BGS_VOLUME_VAR = 94 # Variable BGM_MUTE_SWITCH = 92 # Switch SFX_MUTE_SWITCH = 93 # Switch BGS_MUTE_SWITCH = 94 # Switch # This adjusts the gradient colours for each of the volume controls. BGM_COLOUR1 = 30 BGM_COLOUR2 = 31 SFX_COLOUR1 = 28 SFX_COLOUR2 = 29 BGS_COLOUR1 = 20 BGS_COLOUR2 = 21 =begin #--------------------- # Battle Animations #--------------------- # This will affect what string data will appear for the toggling of # battle animations portion of the system menu. ANI_TITLE = "Battle Animations" ANI_HELP = "Enable/Disable Animations in Battles." ANI_ON = "On" ANI_OFF = "Off" # This is the switch used to adjust battle animations. If it is off, # animations are enabled. If it is on, animations are disabled. ANI_SWITCH = 91 =end
#--------------------- # Automatic Dashing #--------------------- # This will affect what string data will appear for the toggling of # automatic dashing portion of the system menu. AUTO_DASH_TITLE = "Auto-Dashing" AUTO_DASH_HELP = "Enable/Disable Auto-Dashing." AUTO_DASH_ON = "On" AUTO_DASH_OFF = "Off" # This is the switch used to determine whether or not autodashing is on. AUTO_DASH_SWITCH = 95 #--------------------- # Instant Text #--------------------- # This will affect what string data will appear for the instant text # portion of the system menu. INSTANT_TEXT_TITLE = "Skip Text" INSTANT_TEXT_HELP = "Enable/Disable Auto Text-Skipping." INSTANT_TEXT_ON = "On" INSTANT_TEXT_OFF = "Off" # This is the switch used to determine whether or not instant text is on. INSTANT_TEXT_SWITCH = 96 #--------------------- # Remaining Text #--------------------- # This will affect what remaining string data is left for the system menu. RETURN_TO_TITLE = "Back to Title" RETURN_TITLE_HELP = "Go back to Title Screen." RETURN_TO_MENU = "Back to Menu" RETURN_MENU_HELP = "Go back to in-game Menu." end # SYSTEM end # YE
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
module Vocab def self.game_end return YE::SYSTEM::TITLE end end
module Cache def self.windows(filename) load_bitmap("Graphics/Windows/", filename) end end
module RPG class BGM < AudioFile def play if @name.empty? Audio.bgm_stop @@last = BGM.new else vol = @volume if $game_variables != nil vol *= 100 - $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] vol /= 100 vol = [[vol, 0].max, 100].min vol = 0 if $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] end Audio.bgm_play("Audio/BGM/" + @name, vol, @pitch) @@last = self end end #Play end # BGM class ME < AudioFile def play if @name.empty? Audio.me_stop else vol = @volume if $game_variables != nil vol *= 100 - $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] vol /= 100 vol = [[vol, 0].max, 100].min vol = 0 if $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] end Audio.me_play("Audio/ME/" + @name, vol, @pitch) end end end # ME class SE < AudioFile def play unless @name.empty? vol = @volume if $game_variables != nil vol *= 100 - $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] vol /= 100 vol = [[vol, 0].max, 100].min vol = 0 if $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] end Audio.se_play("Audio/SE/" + @name, vol, @pitch) end end def self.stop Audio.se_stop end end # SE class BGS < AudioFile def play if @name.empty? Audio.bgs_stop @@last = BGS.new else vol = @volume if $game_variables != nil vol *= 100 - $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] vol /= 100 vol = [[vol, 0].max, 100].min vol = 0 if $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] end Audio.bgs_play("Audio/BGS/" + @name, vol, @pitch) @@last = self end end end # BGS end # RPG
#=============================================================================== # Game Player #===============================================================================
class Game_Player < Game_Character #-------------------------------------------------------------------------- # alias dash? #-------------------------------------------------------------------------- alias dash_mso dash? def dash? if $game_switches[YE::SYSTEM::AUTO_DASH_SWITCH] return false if @move_route_forcing return false if $game_map.disable_dash? return false if in_vehicle? return false if Input.press?(Input::A) return true else dash_mso end end end
#=============================================================================== # Window #===============================================================================
class Window #-------------------------------------------------------------------------- # update windowskin #-------------------------------------------------------------------------- def update_windowskin if $game_variables != nil winvar = YE::SYSTEM::WINDOW_VARIABLE if $game_variables[winvar] == 0 $game_variables[winvar] = YE::SYSTEM::DEFAULT_WINDOW elsif !YE::SYSTEM::WINDOW_HASH.include?($game_variables[winvar]) $game_variables[winvar] = YE::SYSTEM::DEFAULT_WINDOW end mso_windowskin = YE::SYSTEM::WINDOW_HASH[$game_variables[winvar]] else mso_windowskin = YE::SYSTEM::WINDOW_HASH[YE::SYSTEM::DEFAULT_WINDOW] end self.windowskin = Cache.windows(mso_windowskin) end end
#=============================================================================== # Window Base #===============================================================================
class Window_Base < Window #-------------------------------------------------------------------------- # alias initialize #-------------------------------------------------------------------------- alias initialize_window_mso initialize def initialize(x, y, width, height) initialize_window_mso(x, y, width, height) self.update_windowskin end end
#=============================================================================== # Window Message #===============================================================================
class Window_Message < Window_Selectable #-------------------------------------------------------------------------- # alias update show fast #-------------------------------------------------------------------------- alias update_show_fast_mso update_show_fast def update_show_fast if $game_switches[YE::SYSTEM::INSTANT_TEXT_SWITCH] if self.pause or self.openness < 255 @show_fast = false else @show_fast = true end if @show_fast and @wait_count > 0 @wait_count -= 1 end else update_show_fast_mso end end
$worale = {} if $worale == nil if $worale["NMS"] #-------------------------------------------------------------------------- # alias draw_name #-------------------------------------------------------------------------- alias draw_name_mso draw_name def draw_name(name, x, y) draw_name_mso(name, x, y) @namebox.update_windowskin end end end
#=============================================================================== # Window System #===============================================================================
class Window_System < Window_Selectable #-------------------------------------------------------------------------- # Initialize #-------------------------------------------------------------------------- def initialize super(0, 56, 544, 360) @column_max = 1 self.index = 0 self.active = true refresh end #-------------------------------------------------------------------------- # Refresh #-------------------------------------------------------------------------- def refresh @data = [] @data.push(0) # Window Skins @data.push(1) # Sound Volume/Sound Mute @data.push(2) # BGM Volume/BGM Mute @data.push(3) # Ambience Volume/Ambience Mute @data.push(4) # Battle Animations @data.push(5) # Auto-Dash @data.push(6) # Instant Text @data.push(7) # Return to Title @data.push(8) # Return to Menu @item_max = @data.size self.contents.clear for i in 0..@item_max self.contents.font.color.alpha = 255 draw_item(i) end #--- end #-------------------------------------------------------------------------- # Draw Item #-------------------------------------------------------------------------- def draw_item(index) sw = self.width - 32 dw = sw #--- case index when 0 dx = 0 dy = 0 text = YE::SYSTEM::WINDOW_SKIN self.contents.draw_text(dx, dy, dw, WLH, text, 1) winvar = $game_variables[YE::SYSTEM::WINDOW_VARIABLE] text = YE::SYSTEM::WINDOW_HASH[winvar - 2] self.contents.draw_text(dx + dw * 0/5, dy + WLH, dw/5, WLH, text, 1) text = YE::SYSTEM::WINDOW_HASH[winvar - 1] self.contents.draw_text(dx + dw * 1/5, dy + WLH, dw/5, WLH, text, 1) text = YE::SYSTEM::WINDOW_HASH[winvar] self.contents.draw_text(dx + dw * 2/5, dy + WLH, dw/5, WLH, text, 1) text = YE::SYSTEM::WINDOW_HASH[winvar + 1] self.contents.draw_text(dx + dw * 3/5, dy + WLH, dw/5, WLH, text, 1) text = YE::SYSTEM::WINDOW_HASH[winvar + 2] self.contents.draw_text(dx + dw * 4/5, dy + WLH, dw/5, WLH, text, 1) when 1 dx = 0 dy = WLH * 2 text = YE::SYSTEM::BGM_TITLE self.contents.draw_text(dx + 20, dy, dw/3 - 20, WLH*2, text, 0) when 2 dx = 0 dy = WLH * 4 text = YE::SYSTEM::SFX_TITLE self.contents.draw_text(dx + 20, dy, dw/3 - 20, WLH*2, text, 0) when 3 dx = 0 dy = WLH * 6 text = YE::SYSTEM::BGS_TITLE self.contents.draw_text(dx + 20, dy, dw/3 - 20, WLH*2, text, 0)
when 4 text = "" #---
when 5 dx = 0 dy = WLH * 9 text = YE::SYSTEM::AUTO_DASH_TITLE self.contents.draw_text(dx + 20, dy, dw/2 - 20, WLH, text, 0) if $game_switches[YE::SYSTEM::AUTO_DASH_SWITCH] en1 = true en2 = false else en1 = false en2 = true end text1 = YE::SYSTEM::AUTO_DASH_ON text2 = YE::SYSTEM::AUTO_DASH_OFF self.contents.font.color.alpha = en1 ? 255 : 128 self.contents.draw_text(sw*1/2, dy, dw/4, WLH, text1, 1) self.contents.font.color.alpha = en2 ? 255 : 128 self.contents.draw_text(sw*3/4, dy, dw/4, WLH, text2, 1) #--- when 6 dx = 0 dy = WLH * 10 text = YE::SYSTEM::INSTANT_TEXT_TITLE self.contents.draw_text(dx + 20, dy, dw/2 - 20, WLH, text, 0) if $game_switches[YE::SYSTEM::INSTANT_TEXT_SWITCH] en1 = true en2 = false else en1 = false en2 = true end text1 = YE::SYSTEM::INSTANT_TEXT_ON text2 = YE::SYSTEM::INSTANT_TEXT_OFF self.contents.font.color.alpha = en1 ? 255 : 128 self.contents.draw_text(sw*1/2, dy, dw/4, WLH, text1, 1) self.contents.font.color.alpha = en2 ? 255 : 128 self.contents.draw_text(sw*3/4, dy, dw/4, WLH, text2, 1) #--- when 7 dx = 0 dy = WLH * 11 text = YE::SYSTEM::RETURN_TO_TITLE self.contents.draw_text(dx + 20, dy, dw - 20, WLH, text, 0) #--- when 8 dx = 0 dy = WLH * 12 text = YE::SYSTEM::RETURN_TO_MENU self.contents.draw_text(dx + 20, dy, dw - 20, WLH, text, 0) end end #-------------------------------------------------------------------------- # Update Cursor #-------------------------------------------------------------------------- def update_cursor if @index < 0 self.cursor_rect.empty elsif @index < 4 self.cursor_rect.set(0, @index * 48, self.width - 32, 48) else self.cursor_rect.set(0, @index * 24 + 96, self.width - 32, 24) end end end
#=============================================================================== # Window Volume #===============================================================================
class Window_Volume < Window_Base #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(wx, wy, ww, wh, var) super(wx, wy, ww, wh) @var = var if @var == YE::SYSTEM::BGM_VOLUME_VAR @gc1 = text_color(YE::SYSTEM::BGM_COLOUR1) @gc2 = text_color(YE::SYSTEM::BGM_COLOUR2) @mute = YE::SYSTEM::BGM_MUTE_SWITCH elsif @var == YE::SYSTEM::SFX_VOLUME_VAR @gc1 = text_color(YE::SYSTEM::SFX_COLOUR1) @gc2 = text_color(YE::SYSTEM::SFX_COLOUR2) @mute = YE::SYSTEM::SFX_MUTE_SWITCH else @gc1 = text_color(YE::SYSTEM::BGS_COLOUR1) @gc2 = text_color(YE::SYSTEM::BGS_COLOUR2) @mute = YE::SYSTEM::BGS_MUTE_SWITCH end self.opacity = 0 refresh end #-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh self.contents.clear sw = self.width - 32 self.contents.fill_rect(0, 14, sw-80, 20, gauge_back_color) gw = sw-84 gw *= 100 - $game_variables[@var] gw /= 100 gw = [[gw, 0].max, sw-84].min self.contents.gradient_fill_rect(2, 16, gw, 16, @gc1, @gc2) if $game_switches[@mute] text = YE::SYSTEM::VOL_MUTE else text = sprintf("%d%%", 100 - $game_variables[@var]) end self.contents.draw_text(sw-76, 0, 76, WLH*2, text, 0) end end
#=============================================================================== # Modern Algebra ATS Compatibility #===============================================================================
class Window_FaceBox < Window_Base unless method_defined?(:initialize) #-------------------------------------------------------------------------- # alias initialize #-------------------------------------------------------------------------- alias initialize_fb_mso initialize def initialize initialize_fb_mso self.update_windowskin end end end
class Window_NameBox < Window_Base unless method_defined?(:initialize) #-------------------------------------------------------------------------- # alias initialize #-------------------------------------------------------------------------- alias initialize_nb_mso initialize def initialize(string = '') initialize_nb_mso(string) self.update_windowskin end end end
class Window_ChoiceBox < Window_Command unless method_defined?(:initialize) #-------------------------------------------------------------------------- # alias initialize #-------------------------------------------------------------------------- alias initialize_cb_mso initialize def initialize initialize_cb_mso self.update_windowskin end end end
class Window_Message < Window_Selectable unless method_defined?(:initialize) #-------------------------------------------------------------------------- # alias initialize #-------------------------------------------------------------------------- alias initialize_wm_mso initialize def initialize initialize_wm_mso self.update_windowskin end end end
=begin #=============================================================================== # Scene_Battle #===============================================================================
class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # alias display_normal_animation #-------------------------------------------------------------------------- alias display_normal_animation_mso display_normal_animation def display_normal_animation(targets, animation_id, mirror = false) return if $game_switches[YE::SYSTEM::ANI_SWITCH] display_normal_animation_mso(targets, animation_id, mirror) end end =end #=============================================================================== # Scene_End #===============================================================================
class Scene_End < Scene_Base
#-------------------------------------------------------------------------- # Start processing #-------------------------------------------------------------------------- def start super create_menu_background @help_window = Window_Base.new(0, 0, 544, 56) @help_window.contents.clear #--- text = YE::SYSTEM::WINDOW_HELP @help_window.contents.draw_text(4, 0, 504, 24, text, 0) @system_window = Window_System.new var = YE::SYSTEM::BGM_VOLUME_VAR @bgm_vol_window = Window_Volume.new(160, 104, 384, 80, var) var = YE::SYSTEM::SFX_VOLUME_VAR @sfx_vol_window = Window_Volume.new(160, 152, 384, 80, var) var = YE::SYSTEM::BGS_VOLUME_VAR @bgs_vol_window = Window_Volume.new(160, 200, 384, 80, var) #--- @last_index = 100 end #-------------------------------------------------------------------------- # Post-Start Processing #-------------------------------------------------------------------------- def post_start super end #-------------------------------------------------------------------------- # Pre-termination Processing #-------------------------------------------------------------------------- def pre_terminate super end #-------------------------------------------------------------------------- # Termination Processing #-------------------------------------------------------------------------- def terminate super @help_window.dispose @system_window.dispose @bgm_vol_window.dispose @sfx_vol_window.dispose @bgs_vol_window.dispose dispose_menu_background end #-------------------------------------------------------------------------- # Update Help #-------------------------------------------------------------------------- def update_help @help_window.contents.clear case @system_window.index when 0; text = YE::SYSTEM::WINDOW_HELP when 1; text = YE::SYSTEM::BGM_HELP when 2; text = YE::SYSTEM::SFX_HELP when 3; text = YE::SYSTEM::BGS_HELP when 4; text = "" when 5; text = YE::SYSTEM::AUTO_DASH_HELP when 6; text = YE::SYSTEM::INSTANT_TEXT_HELP when 7; text = YE::SYSTEM::RETURN_TITLE_HELP when 8; text = YE::SYSTEM::RETURN_MENU_HELP end @help_window.contents.draw_text(4, 0, 504, 24, text, 0) end #-------------------------------------------------------------------------- # Frame Update #-------------------------------------------------------------------------- def update super update_menu_background @system_window.update if @last_index != @system_window.index @last_index = @system_window.index update_help end if Input.trigger?(Input::B) Sound.play_cancel return_scene else #--- if Input.repeat?(Input::LEFT) and @system_window.index == 0 $game_variables[YE::SYSTEM::WINDOW_VARIABLE] -= 1 if $game_variables[YE::SYSTEM::WINDOW_VARIABLE] == 0 $game_variables[YE::SYSTEM::WINDOW_VARIABLE] = 1 else Sound.play_cursor end @system_window.refresh @system_window.update_windowskin @help_window.update_windowskin elsif Input.repeat?(Input::RIGHT) and @system_window.index == 0 $game_variables[YE::SYSTEM::WINDOW_VARIABLE] += 1 if $game_variables[YE::SYSTEM::WINDOW_VARIABLE] > YE::SYSTEM::WINDOW_HASH.size $game_variables[YE::SYSTEM::WINDOW_VARIABLE] = YE::SYSTEM::WINDOW_HASH.size else Sound.play_cursor end @system_window.refresh @system_window.update_windowskin @help_window.update_windowskin #--- elsif Input.repeat?(Input::LEFT) and @system_window.index == 1 if Input.press?(Input::A) $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] += 10 else $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] += 1 end if $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] >= 100 $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] = 100 end Sound.play_cursor @bgm_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.repeat?(Input::RIGHT) and @system_window.index == 1 if Input.press?(Input::A) $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] -= 10 else $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] -= 1 end if $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] <= 0 $game_variables[YE::SYSTEM::BGM_VOLUME_VAR] = 0 end Sound.play_cursor @bgm_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.trigger?(Input::L) and @system_window.index == 1 if $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] = false else $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] = true end Sound.play_decision @bgm_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.trigger?(Input::R) and @system_window.index == 1 if $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] = false else $game_switches[YE::SYSTEM::BGM_MUTE_SWITCH] = true end Sound.play_decision @bgm_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.repeat?(Input::LEFT) and @system_window.index == 2 if Input.press?(Input::A) $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] += 10 else $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] += 1 end if $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] >= 100 $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] = 100 end Sound.play_cursor @sfx_vol_window.refresh elsif Input.repeat?(Input::RIGHT) and @system_window.index == 2 if Input.press?(Input::A) $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] -= 10 else $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] -= 1 end if $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] <= 0 $game_variables[YE::SYSTEM::SFX_VOLUME_VAR] = 0 end Sound.play_cursor @sfx_vol_window.refresh elsif Input.trigger?(Input::L) and @system_window.index == 2 if $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] = false else $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] = true end Sound.play_decision @sfx_vol_window.refresh elsif Input.trigger?(Input::R) and @system_window.index == 2 if $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] = false else $game_switches[YE::SYSTEM::SFX_MUTE_SWITCH] = true end Sound.play_decision @sfx_vol_window.refresh elsif Input.repeat?(Input::LEFT) and @system_window.index == 3 if Input.press?(Input::A) $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] += 10 else $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] += 1 end if $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] >= 100 $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] = 100 end Sound.play_cursor @bgs_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.repeat?(Input::RIGHT) and @system_window.index == 3 if Input.press?(Input::A) $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] -= 10 else $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] -= 1 end if $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] <= 0 $game_variables[YE::SYSTEM::BGS_VOLUME_VAR] = 0 end Sound.play_cursor @bgs_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.trigger?(Input::L) and @system_window.index == 3 if $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] = false else $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] = true end Sound.play_decision @bgs_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play elsif Input.trigger?(Input::R) and @system_window.index == 3 if $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] = false else $game_switches[YE::SYSTEM::BGS_MUTE_SWITCH] = true end Sound.play_decision @bgs_vol_window.refresh RPG::BGM.last.play RPG::BGS.last.play =begin elsif Input.trigger?(Input::LEFT) and @system_window.index == 4 $game_switches[YE::SYSTEM::ANI_SWITCH] = false Sound.play_decision @system_window.refresh elsif Input.trigger?(Input::RIGHT) and @system_window.index == 4 $game_switches[YE::SYSTEM::ANI_SWITCH] = true Sound.play_decision @system_window.refresh =end elsif Input.trigger?(Input::LEFT) and @system_window.index == 5 $game_switches[YE::SYSTEM::AUTO_DASH_SWITCH] = true Sound.play_decision @system_window.refresh elsif Input.trigger?(Input::RIGHT) and @system_window.index == 5 $game_switches[YE::SYSTEM::AUTO_DASH_SWITCH] = false Sound.play_decision @system_window.refresh elsif Input.trigger?(Input::LEFT) and @system_window.index == 6 $game_switches[YE::SYSTEM::INSTANT_TEXT_SWITCH] = true Sound.play_decision @system_window.refresh elsif Input.trigger?(Input::RIGHT) and @system_window.index == 6 $game_switches[YE::SYSTEM::INSTANT_TEXT_SWITCH] = false Sound.play_decision @system_window.refresh elsif Input.trigger?(Input::C) and @system_window.index == 7 Sound.play_decision RPG::BGM.fade(800) RPG::BGS.fade(800) RPG::ME.fade(800) $scene = Scene_Title.new Graphics.fadeout(60) elsif Input.trigger?(Input::C) and @system_window.index == 8 Sound.play_cancel return_scene end #--- end end end
#=============================================================================== # # END OF FILE # #===============================================================================
Untuk yang sprite animasi itu maksudnya gmn ya? Tidak paham saya |
| | | 2012-04-04, 07:29 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| makasi kk, ntar aku coba cariin contohnya... bingung juga mau ngasi tahunya... ini kan menunya ada di pas main biar adanya di title..... gmana???? |
| | | 2012-04-04, 09:38 | Re: [Solved] Naaf nanya lagi |
---|
McPherson Senior
Posts : 777 Thanked : 7 Engine : Multi-Engine User Skill : Intermediate Type : Mapper
Awards:
| Saya masih kurang paham.. coba d perjelas tntang animasi sprite d spoiler/ judul..
Terakhir diubah oleh McPherson tanggal 2012-04-04, 12:42, total 2 kali diubah (Reason for editing : udah sopan itu, swt.. lol) |
| | | 2012-04-04, 12:03 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| skrip yang di kasi kk marjoni kan itu option untuk yang di game aku nyarinya skrip yang "OPTION"nya ada di menu awal jadi isiniya menu awal itu new game continue -option- quit gitu nah isinya itu yang aku sebutin di atas |
| | | 2012-04-04, 12:30 | Re: [Solved] Naaf nanya lagi |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| Oh paham2... Jadi muncul optionnya di Titlenya gitu?? Kalau kayak gitu harus pake' script Simple Title: - Spoiler:
- Code:
-
#============================================================================== # Simple Title # Author: Nicke # Created: 23/12/2011 # Edited: 23/12/2011 # Version: 1.0 #============================================================================== # Instructions # ----------------------------------------------------------------------------- # To install this script, open up your script editor and copy/paste this script # to an open slot below ? Materials but above ? Main. Remember to save. # # No need for explaining, just a simple title scene with a few settings. #============================================================================== ($imported ||= {})["NICKE-SIMPLE-TITLE"] = true
module NICKE module TITLE #--------------------------------------------------------------------------# # * Settings #--------------------------------------------------------------------------# # When adding a new menu item make sure you edit in title_choice method as well. # Right now the menu supports 5 items with the appropriated methods to it. # MENU_LIST ['ITEM 1', 'ITEM 2'] etc. MENU_LIST = ['New Tale', 'Load', 'Credits', 'Options', 'Quit'] # If you use MENU_LIST.size the menu items will be pushed horizontal and # when using that option make sure you don't add too much items or else a # few of them will go off the screen eventually. # Menu Window [ Columns, x, y, z, opacity ] WINDOW = [MENU_LIST.size, 0, 360, 200, 255] # TRANSITION [ SPEED, TRANSITION, OPACITY ] TRANSITION = nil # Title background. BACK = "Title" # (Default name) # Title window to fade in/out. # Set to nil to disable. ANIM_WINDOW_TIMER = 60 # Player transparent on startup. PLAYER_TRANSPARENT = true # Switches enabled from start. # Set to nil to disable. # SWITCHES = [SWITCH_ID] SWITCHES = nil # Start placement for the player as in map_id, x and y coordinates. # Set to nil to disable. # START_POS = [MAP_ID, X, Y] START_POS = nil # Run a common event on startup? # COMMON_EVENT = { ID => COMMON_EVENT_ID } COMMON_EVENT = { 0 => 1, 1 => 3, } # Do Not Remove # Skip title. SKIP = false end end # *** Don't edit below unless you know what you are doing. *** #==============================================================================# # ** Game_Interpreter #------------------------------------------------------------------------------ # Method for running a commont event. #==============================================================================# class Game_Interpreter def run_event(event_list, event_id=0) @child_interpreter = Game_Interpreter.new(@depth + 1) @child_interpreter.setup(event_list, event_id) end end #==============================================================================# # ** Scene_Title #------------------------------------------------------------------------------ # New Scene :: Scene_Title #==============================================================================# class Scene_Title < Scene_Base alias nicke_title_main main unless $@ def main(*args, &block) title_skip if NICKE::TITLE::SKIP && $TEST && !$BTEST return if NICKE::TITLE::SKIP && $TEST && !$BTEST nicke_title_main(*args, &block) end alias nicke_title_start start unless $@ def start(*args, &block) nicke_title_start(*args, &block) super create_title create_command_window end def create_command_window @command_title = NICKE::TITLE::MENU_LIST @command_title = Window_Command.new(Graphics.width, @command_title, NICKE::TITLE::WINDOW[0]) if @continue_enabled @command_title.index = 1 # // Load index item. else @command_title.draw_item(1, false) end @command_title.x = NICKE::TITLE::WINDOW[1] @command_title.y = NICKE::TITLE::WINDOW[2] @command_title.z = NICKE::TITLE::WINDOW[3] @command_title.opacity = NICKE::TITLE::WINDOW[4] pre_animate_in unless NICKE::TITLE::ANIM_WINDOW_TIMER.nil? end
def perform_transition if NICKE::TITLE::TRANSITION.nil? Graphics.transition(30) else Graphics.transition(NICKE::TITLE::TRANSITION[0],NICKE::TITLE::TRANSITION[1],NICKE::TITLE::TRANSITION[2]) end end
def pre_animate_in @command_title.opacity -= 255 @command_title.contents_opacity -= 255 end def post_start super animate_in unless NICKE::TITLE::ANIM_WINDOW_TIMER.nil? end def animate_in # // Method for animating the title window in. timer = NICKE::TITLE::ANIM_WINDOW_TIMER while timer > 0 Graphics.update @command_title.opacity += 255 / NICKE::TITLE::ANIM_WINDOW_TIMER @command_title.contents_opacity += 255 / NICKE::TITLE::ANIM_WINDOW_TIMER @command_title.update timer -= 1 end end
def pre_terminate super animate_out end def animate_out # // Method for animating the title window out. timer = NICKE::TITLE::ANIM_WINDOW_TIMER while timer > 0 Graphics.update @command_title.opacity -= 255 / NICKE::TITLE::ANIM_WINDOW_TIMER @command_title.contents_opacity -= 255 / NICKE::TITLE::ANIM_WINDOW_TIMER @command_title.update timer -= 1 end end def open_command_window @command_title.open begin @command_title.update Graphics.update end until @command_title.openness == 255 end def close_command_window @command_title.close begin @command_title.update Graphics.update end until @command_title.openness == 0 end def update super @command_title.update if Input.trigger?(Input::C) case @command_title.index when 0...NICKE::TITLE::MENU_LIST.size Sound.play_decision unless @command_title.index == 1 # If load disabled. item. title_choice(@command_title.index) end end end def title_choice(index) # // Method for selecting the appropriated items in MENU_LIST. case index when 0 # New Game command_new_game when 1 # Load command_continue when 2 # Credits command_credits when 3 # Options command_options when 4 # Quit command_shutdown end end def title_skip # // Method for skipping the title. load_database create_game_objects confirm_player_location $game_party.setup_starting_members setup_start_pos $game_player.refresh $game_player.transparent = NICKE::TITLE::PLAYER_TRANSPARENT if !NICKE::TITLE::SWITCHES.nil? for i in NICKE::TITLE::SWITCHES $game_switches[i] = true end end if !NICKE::TITLE::COMMON_EVENT.nil? for i in NICKE::TITLE::COMMON_EVENT.values next unless NICKE::TITLE::COMMON_EVENT.include?(i) $game_map.interpreter.run_event($data_common_events[i].list) end end $scene = Scene_Map.new Graphics.frame_count = 0 RPG::BGM.stop $game_map.autoplay end def command_new_game # // Override new game method. confirm_player_location Sound.play_decision $game_party.setup_starting_members setup_start_pos $game_player.refresh $game_player.transparent = NICKE::TITLE::PLAYER_TRANSPARENT if !NICKE::TITLE::SWITCHES.nil? for i in NICKE::TITLE::SWITCHES $game_switches[i] = true end end if !NICKE::TITLE::COMMON_EVENT.nil? for i in NICKE::TITLE::COMMON_EVENT.values next unless NICKE::TITLE::COMMON_EVENT.include?(i) $game_map.interpreter.run_event($data_common_events[i].list) end end $scene = Scene_Map.new RPG::BGM.fade(1500) close_command_window Graphics.fadeout(60) Graphics.wait(40) Graphics.frame_count = 0 RPG::BGM.stop $game_map.autoplay end def setup_start_pos # // Method to determine the player startup positions. if NICKE::TITLE::START_POS.nil? $game_map.setup($data_system.start_map_id) $game_player.moveto($data_system.start_x, $data_system.start_y) else $game_map.setup(NICKE::TITLE::START_POS[0]) $game_player.moveto(NICKE::TITLE::START_POS[1], NICKE::TITLE::START_POS[2]) end end #----------------------------------------------------------------------------# # // Feel free to comment this section out if you don't use it. # It's doesn't do anything from start as you need to customize it. def command_credits # // Method for credits. # Call the scene you want as credit in here. end def command_options # // Method for options. # Call the scene you want as option in here. end #----------------------------------------------------------------------------# def command_shutdown # // Method for quit. Graphics.fadeout(60) Graphics.wait(20) RPG::BGM.fade(800) RPG::BGS.fade(800) RPG::ME.fade(800) $scene = nil end def create_title @sprite_title_bg = Sprite.new @sprite_title_bg.bitmap = Cache.system(NICKE::TITLE::BACK) end def dispose_command_window @sprite_title_bg.dispose unless @sprite_title_bg.nil? @sprite_title_bg = nil @command_title.dispose unless @command_title.nil? @command_title = nil end
alias nicke_title_terminate terminate unless $@ def terminate(*args,&block) nicke_title_terminate(*args,&block) super end end # END OF FILE
#=*==========================================================================*=# # ** END OF FILE #=*==========================================================================*=#
Well, mungkin sih...Coba aja dulu |
| | | 2012-04-04, 16:02 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| ntar ku coba... trims ya kk marjoni.. kalau untuk bikin video pas sebelum title bisa enggak???? |
| | | 2012-04-04, 16:30 | Re: [Solved] Naaf nanya lagi |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| @Radis Kalau untuk video buat title gk pernah liat deh scriptnya... Hmm...Tapi pernah denger juga.. jadi masih blm jelaslah EDIT: ketemu buat video di title screen... Tapi blm ditest jadi silahkan dicoba sendiri - Spoiler:
- Code:
-
#============================================================================== # by ShinGamix # Orginals: Superoverlord, Dëvic, Isaacsol #==============================================================================
#============================================================================== # Instructions: #------------------------------------------------------------------------------ # # o Playing Videos when on the map. # # - See script calls below. # # o Playing videos in battle. # # - As when on the map the script event command can be used in battle also. # # - As well as this you can setup skills as video skills which display # a video before damaging the enemy. # # To do this the following tags can be used in the skills notebox: # 1) <video_name = "filename"> # ~ name is the name of the video file. If the filename extension is # missing the first file matching that name is used. # (Quotes are necessary around the filename) # # As well as the first tag 2 others are available. These tags will only # take effect if placed on a line below the first tag. # If these don't exist they are assumed true. # # 2) <video_exitable = n> ~ Can the video be exited by the exit input? # 3) <video_pausable = n> ~ Can the video be paused? # ~ n is replaced with either t or f (t : true, f : false) # # For other Video properties (x,y,width,height,fullscreen) the default # settings are used. (See script calls below) #============================================================================== # Script Calls: #------------------------------------------------------------------------------ # Commands (From the script call command on page three of event commands) #------------------------------------------------------------------------------ # o To change default values for video properties. # # 1) Video.default_x = n # 2) Video.default_y = n # 3) Video.default_width = n # 4) Video.default_height = n # 5) Video.fullscreen = bool # # In all 5 commands above: # ~ n is an integer value # ~ bool is either true or false # # o To play videos # # play_video(filename,exitable,pausable) # ~ filename : name of video file (Must be in quotes) # ~ exitable : Can the video be exited? (When left out = true) # ~ pausable : Can the video be paused? (When left out = true) # # For all other values the default's are used. #==============================================================================
#============================================================================== # Shows a splash screen on startup. Compatible only with RGSS2! # Questions, acknowledgments and requests may be taken on the script's # threads, but you can send me an e-mail at: phabio_almeida@hotmail.com #------------------------------------------------------------------------------ # Splash Screen English thread: # http://www.rpgmakervx.net/index.php?showtopic=974 #==============================================================================
#-------------------------------------------------------------------------- # Configuration #--------------------------------------------------------------------------
module SOV module Video
# Name of folder for videos to be held in. DIR_NAME = "Videos" # Exit video input EXIT_INPUT = Input::B # Pause video input PAUSE_INPUT = Input::R end end
module Q VIDEO_ON_START = true VIDEO_ON_NEWGAME = false VIDEO_NAME = "BulletBill" EXITABLE = true PAUSABLE = true end
class Scene_Splash DisableInDebug = false BreakSplash = true OneTimeSplash = true SplashFolder = 'Scene_Splash'
def initialize @logo = [ [ [ 50, 5, 120 ], 'frame', 'ME', 'enterbrain', 100, 100 ], #[ 120, 'Mörkestärm' ] ] @fade_delay = 20 @break = 'Input.press?(Input::B) || Input.press?(Input::C)' main end
end
module Splash_Video # 0; no splash # 1; before intro video # 2; after intro video # 3; On newgame, before newgame video # 4; On newgame, after newgame video # 7: Before video on opening and newgame # 8: After video on opening and newgame # Note: 3 and 4 are the same if there's no intro video on newgame. Setting = 2 end
#-------------------------------------------------------------------------- # End Configuration #--------------------------------------------------------------------------
#============================================================================== # Import #------------------------------------------------------------------------------ $imported = {} if $imported == nil $imported['Videos'] = true #==============================================================================
class Scene_Splash
def main @logo.each { |a| unless a.length < 3 case a[2] when 'BGM' Audio.bgm_play("Audio/BGM/#{a[3]}", a[4], a[5]) when 'BGS' Audio.bgs_play("Audio/BGS/#{a[3]}", a[4], a[5]) when 'ME' Audio.me_play("Audio/ME/#{a[3]}", a[4], a[5]) when 'SE' Audio.se_play("Audio/SE/#{a[3]}", a[4], a[5]) end end if a[0].kind_of?(Array) sprite = Sprite.new sprite.bitmap = Cache.splash("#{a[1]}1") Graphics.transition Graphics.fadein(@fade_delay) for j in 2..(a[0][0] - 1) sprite = Sprite.new sprite.bitmap = Cache.splash(a[1] + j.to_s) a[0][1].times { Graphics.update Input.update (break if eval(@break)) if BreakSplash } (break if eval(@break)) if BreakSplash sprite.dispose end unless eval(@break) sprite = Sprite.new sprite.bitmap = Cache.splash(a[1] + a[0][0].to_s) Graphics.wait(a[0][2]) end audio_stop(a) Graphics.fadeout(@fade_delay) sprite.dispose else sprite = Sprite.new sprite.bitmap = Cache.splash(a[1]) Graphics.transition Graphics.fadein(@fade_delay) a[0].times { Graphics.update Input.update (break if eval(@break)) if BreakSplash } audio_stop(a) Graphics.fadeout(@fade_delay) sprite.dispose end Graphics.freeze } end
def audio_stop(a) unless a.length < 3 case a[2] when 'BGM' Audio.bgm_fade(@fade_delay) when 'BGS' Audio.bgs_fade(@fade_delay) when 'ME' Audio.me_fade(@fade_delay) when 'SE' Audio.se_stop end end end end
module Cache def self.splash(filename) load_bitmap("Graphics/#{Scene_Splash::SplashFolder}/", filename) end end
#============================================================================== # ** SOV::Video::Commands #==============================================================================
module SOV::Video::Commands #-------------------------------------------------------------------------- # * Play a video # filename : video's filename (with or without extension) # exitable : Can the video be exited # pausable : Can the video be paused #-------------------------------------------------------------------------- def play_video(filename,exitable=true,pausable=true) video = Cache.video(filename) video.exitable = exitable video.pausable = pausable if $pre_video == true $scene.play_video_title(video) else if $game_temp.in_battle # In battle $scene.play_video(video) else # On map $game_map.video = video end end end #--------------------------------------------------------------------------- # Define as module function #--------------------------------------------------------------------------- module_function :play_video end #============================================================================== # ** SOV::Video::Regexp #==============================================================================
module SOV::Video::Regexp #-------------------------------------------------------------------------- # * Skill #-------------------------------------------------------------------------- module Skill FILENAME = /<video[_ ]?(?:file)?name = "(.+)">/i PAUSABLE = /<video[_ ]?paus(?:e|able) = (t|f)>/i EXITABLE = /<video[_ ]?exit(?:able)? = (t|f)>/i end end
#============================================================================== # ** SOV::Game #==============================================================================
module SOV::Game #-------------------------------------------------------------------------- # Constants #-------------------------------------------------------------------------- INI = 'Game' #-------------------------------------------------------------------------- # * Get the game windows handle #-------------------------------------------------------------------------- def self.hwnd unless defined?(@@hwnd) find_window = Win32API.new('user32','FindWindow','pp','i') @@hwnd = find_window.call('RGSS Player',title) end return @@hwnd end #-------------------------------------------------------------------------- # * Get game title #-------------------------------------------------------------------------- def self.title unless defined?(@@title) @@title = read_ini('title') end return @@title end #-------------------------------------------------------------------------- # * Read ini (Returns nil or match) #-------------------------------------------------------------------------- def self.read_ini(variable,filename=INI) reg = /^#{variable}=(.*)$/ File.foreach(filename+'.ini') { |line| break($1) if line =~ reg } end end
#============================================================================== # ** Cache #==============================================================================
module Cache #-------------------------------------------------------------------------- # Class Variables #-------------------------------------------------------------------------- @@vcache = {} #-------------------------------------------------------------------------- # Define as class methods #-------------------------------------------------------------------------- class << self #------------------------------------------------------------------------ # Alias List #------------------------------------------------------------------------ alias sov_video_clear clear unless $@ #------------------------------------------------------------------------ # * Get a video object # filename : basename of file #------------------------------------------------------------------------ def video(filename) # Get full filename if extension is missing if File.extname(filename) == '' files = Dir["#{SOV::Video::DIR_NAME}/#{filename}.*"] filename = File.basename(files[0]) # Set as first matching file end # Create or get the video object. if @@vcache.has_key?(filename) @@vcache[filename] else @@vcache[filename] = Video.new(filename) end end #------------------------------------------------------------------------ # * Clear #------------------------------------------------------------------------ def clear @@vcache.clear sov_video_clear end end end
#============================================================================== # ** RPG::Skill #==============================================================================
class RPG::Skill < RPG::UsableItem #-------------------------------------------------------------------------- # * Determine if skill has a video skill #-------------------------------------------------------------------------- def video if @video == nil @note.each_line { |line| if @video == nil @video = Cache.video($1) if line =~ SOV::Video::Regexp::Skill::FILENAME else @video.pausable = ($1 == 't') if line =~ SOV::Video::Regexp::Skill::PAUSABLE @video.exitable = ($1 == 't') if line =~ SOV::Video::Regexp::Skill::EXITABLE end } @video = :invalid if @video == nil end return @video end end
#============================================================================== # ** Video #------------------------------------------------------------------------------ # Class handling playing videos. #==============================================================================
class Video #-------------------------------------------------------------------------- # Constants #-------------------------------------------------------------------------- TYPE_AVI = 'avivideo' TYPE_MPEG = 'mpegvideo' #-------------------------------------------------------------------------- # Class Variables #-------------------------------------------------------------------------- @@default_x = 0 @@default_y = 0 @@default_width = Graphics.width @@default_height = Graphics.height @@fullscreen = false #-------------------------------------------------------------------------- # * Get and Set default_x/y/width/height #-------------------------------------------------------------------------- for d in %w(x y width height) # Define setter method module_eval(%Q(def self.default_#{d}=(i); @@default_#{d} = i; end)) # Define getter method module_eval(%Q(def self.default_#{d}; @@default_#{d}; end)) end #-------------------------------------------------------------------------- # * Get fullscreen #-------------------------------------------------------------------------- def self.fullscreen @@fullscreen end #-------------------------------------------------------------------------- # * Set fullscreen #-------------------------------------------------------------------------- def self.fullscreen=(val) @@fullscreen = val end #-------------------------------------------------------------------------- # * Win32API #-------------------------------------------------------------------------- @@mciSendStringA = Win32API.new('winmm','mciSendStringA','pplp','i') #-------------------------------------------------------------------------- # * Video Command # command_string : string following mci_command_string format # buffer : string to retrieve return data # buffer_size : number of characters in buffer # callback_handle : handle of window to callback to. Used if notify is used # in the command string. (Not supported by game window) #-------------------------------------------------------------------------- def self.send_command(cmnd_string,buffer='',buffer_size=0,callback_handle=0) # Returns error code. No error if NULL err = @@mciSendStringA.call(cmnd_string,buffer,buffer_size,callback_handle) if err != 0 buffer = ' ' * 255 Win32API.new('winmm','mciGetErrorString','LPL','V').call(err,buffer,255) raise(buffer.squeeze(' ').chomp('\000')) end end #-------------------------------------------------------------------------- # * Play a video #-------------------------------------------------------------------------- def self.play(video) # Make path and buffer path = "#{SOV::Video::DIR_NAME}/#{video.filename}" buffer = ' ' * 255 # Initialize device and dock window with game window as parent. type = " type #{video.type}" if video.type != '' send_command("open #{path}#{type} alias VIDEO style child parent #{SOV::Game.hwnd}") # Display video in client rect at x,y with width and height. x = video.x y = video.y width = video.width height = video.height send_command("put VIDEO window at #{x} #{y} #{width} #{height}") # Begin playing video screen = @@fullscreen ? 'fullscreen' : 'window' send_command("play VIDEO #{screen}") # Start Input and status processing loop while buffer !~ /^stopped/ # Idle processing for a frame sleep(1.0/Graphics.frame_rate) # Get mode string send_command('status VIDEO mode',buffer,255) Input.update if Input.trigger?(SOV::Video::PAUSE_INPUT) and video.pausable? Sound.play_cursor if buffer =~ /^paused/ # If already paused send_command("resume VIDEO") # Resume video else # Otherwise send_command("pause VIDEO") # Pause video end elsif Input.trigger?(SOV::Video::EXIT_INPUT) and video.exitable? Sound.play_cancel # Terminate loop on exit input break end end # Terminate the device send_command('close VIDEO') end #-------------------------------------------------------------------------- # Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :x attr_accessor :y attr_accessor :width attr_accessor :height attr_writer :exitable attr_writer :pausable attr_reader :filename #-------------------------------------------------------------------------- # * Initialize #-------------------------------------------------------------------------- def initialize(filename) unless FileTest.file?("#{SOV::Video::DIR_NAME}/#{filename}") raise(Errno::ENOENT,filename) end @filename = filename @x = @@default_x @y = @@default_y @width = @@default_width @height = @@default_height @exitable = true @pausable = true end #-------------------------------------------------------------------------- # * Get Type #-------------------------------------------------------------------------- def type if @type == nil case File.extname(@filename) when '.avi'; @type = TYPE_AVI when '.mpeg'||'.mpg'; @type = TYPE_MPEG else @type = '' end end @type end #-------------------------------------------------------------------------- # * Is the video exitable? #-------------------------------------------------------------------------- def exitable? @exitable end #-------------------------------------------------------------------------- # * Is the video pausable? #-------------------------------------------------------------------------- def pausable? @pausable end #-------------------------------------------------------------------------- # Access #-------------------------------------------------------------------------- private_class_method :send_command end
#============================================================================== # ** Game_Interpreter #==============================================================================
class Game_Interpreter #-------------------------------------------------------------------------- # Import #-------------------------------------------------------------------------- include(SOV::Video::Commands) end
#============================================================================== # ** Game_Map #==============================================================================
class Game_Map #-------------------------------------------------------------------------- # Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :video end
#============================================================================== # ** Scene_Map #==============================================================================
class Scene_Map #-------------------------------------------------------------------------- # Alias List #-------------------------------------------------------------------------- alias sov_video_update update unless $@ #-------------------------------------------------------------------------- # * Play Video #-------------------------------------------------------------------------- def play_video(video) # Memorize and stop current bgm and bgs bgm = RPG::BGM.last bgs = RPG::BGS.last RPG::BGM.stop RPG::BGS.stop # Play video Video.play(video) # Restart bgm and bgs bgm.play bgs.play end #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- def update if $game_map.video != nil play_video($game_map.video) $game_map.video = nil Input.update else sov_video_update end end end
#============================================================================== # ** Scene_Battle #==============================================================================
class Scene_Battle #-------------------------------------------------------------------------- # * Alias list #-------------------------------------------------------------------------- alias sov_video_execute_action_skill execute_action_skill unless $@ #-------------------------------------------------------------------------- # * Play Video #-------------------------------------------------------------------------- def play_video(video) # Memorize and stop current bgm bgm = RPG::BGM.last RPG::BGM.stop # Play video Video.play(video) # Restart bgm bgm.play end #-------------------------------------------------------------------------- # * Execute Action Skill #-------------------------------------------------------------------------- def execute_action_skill skill = @active_battler.action.skill if skill.video.is_a?(Video) execute_action_video(skill) else sov_video_execute_action_skill end end #-------------------------------------------------------------------------- # * Execute Action Video #-------------------------------------------------------------------------- def execute_action_video(skill) text = @active_battler.name + skill.message1 @message_window.add_instant_text(text) unless skill.message2.empty? wait(10) @message_window.add_instant_text(skill.message2) end wait(20) @message_window.clear # Fadout to black screen br = Graphics.brightness 120.times { |i| Graphics.brightness = 255 - 255/60 * i; Graphics.update } # Play video play_video(skill.video) # Reset brightness Graphics.brightness = br targets = @active_battler.action.make_targets display_animation(targets, skill.animation_id) @active_battler.mp -= @active_battler.calc_mp_cost(skill) $game_temp.common_event_id = skill.common_event_id for target in targets target.skill_effect(@active_battler, skill) display_action_effects(target, skill) end end end
#============================================================================== # Pre-Main Processing #============================================================================== unless FileTest.directory?(SOV::Video::DIR_NAME) # If directory doesn't exist. Dir.mkdir(SOV::Video::DIR_NAME) # Make the directory
end
class Scene_Title < Scene_Base
include(SOV::Video::Commands)
def play_video_title(video) load_database # Memorize and stop current bgm bgm = RPG::BGM.last RPG::BGM.stop # Play video Video.play(video) # Restart bgm bgm.play end
alias :vidmain :main unless $@ def main if $BTEST # If battle test vidmain # Start battle test else # If normal play $pre_video = true play_video(Q::VIDEO_NAME,Q::EXITABLE, Q::PAUSABLE) if Q::VIDEO_ON_START $pre_video = false vidmain end end
alias :newgamevid :command_new_game unless $@ def command_new_game play_video(Q::VIDEO_NAME,Q::EXITABLE, Q::PAUSABLE) if Q::VIDEO_ON_NEWGAME newgamevid end
def main if $BTEST # If battle test vidmain # Start battle test else # If normal play call_splash if Splash_Video::Setting == 1 call_splash if Splash_Video::Setting == 7 $pre_video = true play_video(Q::VIDEO_NAME,Q::EXITABLE, Q::PAUSABLE) if Q::VIDEO_ON_START $pre_video = false call_splash if Splash_Video::Setting == 2 call_splash if Splash_Video::Setting == 8 vidmain end end
def command_new_game call_splash_two if Splash_Video::Setting == 3 call_splash_two if Splash_Video::Setting == 7 play_video(Q::VIDEO_NAME,Q::EXITABLE, Q::PAUSABLE) if Q::VIDEO_ON_NEWGAME call_splash_two if Splash_Video::Setting == 4 call_splash_two if Splash_Video::Setting == 8 newgamevid end
def call_splash unless $splash $splash = true if Scene_Splash::OneTimeSplash if Scene_Splash::DisableInDebug Scene_Splash.new unless $TEST else Scene_Splash.new end end end
def call_splash_two if Scene_Splash::DisableInDebug Scene_Splash.new unless $TEST else Scene_Splash.new end end end
|
| | | 2012-04-04, 16:42 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| ada yang tahu enggak????? |
| | | 2012-04-04, 16:43 | Re: [Solved] Naaf nanya lagi |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| lihat postku sebelumnya... Pasti anda akan tahu... |
| | | 2012-04-04, 17:26 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| playing video on the map??? pake yg itu??? |
| | | 2012-04-04, 17:39 | Re: [Solved] Naaf nanya lagi |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| Otomatis itu langsung play video ke title... Tapi gk tahu lagi sih blm kutest... Tidak ada salahnya jika anda mencobanya.. |
| | | 2012-04-05, 06:37 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| untuk option di title udah bisa yang jadi masalah nambahkan menu2 ke option yang bingung pusing dah... |
| | | 2012-04-05, 13:01 | Re: [Solved] Naaf nanya lagi |
---|
marjoni01 Senior
Posts : 971 Thanked : 5 Engine : RMVX Ace Skill : Intermediate Type : Developer
| Kalau untuk nambah yang itu harus putar2 sedikit scriptnya... Dan sayapun juga agak bingung untuk itu... Good luck aja deh buatmu |
| | | 2012-04-05, 13:25 | Re: [Solved] Naaf nanya lagi |
---|
Radis3D Sang Iblis
Posts : 755 Thanked : 3 Engine : RMVX Ace Skill : Very Beginner Type : Writer
Awards:
| kagak ketemu, muncul eror... butuh masukan... siapa scripter disini???? |
| | | 2012-04-27, 22:17 | Re: [Solved] Naaf nanya lagi |
---|
LowlingLife Administrator
Posts : 2000 Thanked : 25 Engine : Multi-Engine User
Awards:
| Berhubung udah solved dan saya lihat sepertinya tidak ada yang ingin ditambahkan lagi, maka saya akan me-lock thread ini. Kalau TS atau member lain ingin menambahkan, harap hubungi admin atau moderator setempat. Terima kasih. ~Locked Since Solved~ |
| | | | Re: [Solved] Naaf nanya lagi |
---|
Sponsored content
| | | | Similar topics | |
|
Similar topics | |
| |
Halaman 1 dari 1 | |
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
Latest 10 Topics | [Web Novel] Gloria Infidelis 2016-11-17, 21:27 by LightNightKnight
[Announcement] Forum baru untuk RMID 2016-08-25, 16:39 by TheoAllen
Where I'm Wrong ? 2016-07-24, 16:10 by ReydVires
flakeheartnet's Resources part III 2016-07-08, 14:30 by flakeheartnet
Keira's Art Warehouse 2016-06-28, 19:27 by KeiraBlaze
Theo Core Time System + Bingung 2016-06-27, 16:24 by Lockin
Error Script, Maybe ? 2016-06-27, 16:20 by Lockin
Nusaimoe @ RMID Lounge 2016-06-21, 05:02 by Jihad Bagas
Call Random Battle 2016-06-15, 17:04 by Lockin
Flakeheartnet Resources Part II [come back gift] 2016-06-07, 15:51 by flakeheartnet
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|
|
|