Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # [RGSS/2] Map Shortcut
- # Version : 1.1
- # Author : LowlingLife
- # Original Script Author : Nefusa 7
- #==============================================================================
- # Re-make dari Nufus Simple Shortcut Key. Memanggil suatu scene atau common
- # event jika condition terpenuhi.
- #==============================================================================
- # Note :
- # Script ini adalah hasil remake script buatan Nefusa 7 yang bernama Nufus
- # Simple Shortcut Key. Jika ingin memakai, credit ke Nefusa 7 dan LowlingLife.
- #==============================================================================
- # CHANGELOG
- # V.1.0 | Original Release
- # V.1.1 | Add SWITCH_EVENT_SHORTCUT, KEY_EVENT_SHORTCUT, & VAR_EVENT_SHORTCUT.
- #==============================================================================
- module MapShortcut
- #----------------------------------------------------------------------------
- # * Switch
- #----------------------------------------------------------------------------
- # Switch ID => [Condition, Scene]
- # Switch ID : ID dari Switch.
- # Conditon : true = Memanggil scene jika Switch ON.
- # false = Memanggil scene jika Switch OFF.
- # Scene : Nama scene yang akan dipanggil.
- #----------------------------------------------------------------------------
- SWITCH_SHORTCUT = {
- 1 => [true, Scene_Title.new],
- 2 => [true, Scene_Title.new]
- } # Jangan di delete.
- #----------------------------------------------------------------------------
- # * Variable
- #----------------------------------------------------------------------------
- # Variable ID => [Value, Scene]
- # Variable ID : ID dari Variable.
- # Value : Nilai variable yang jika tercapai memanggil scene.
- # Scene : Nama scene yang akan dipanggil.
- #----------------------------------------------------------------------------
- VAR_SHORTCUT = {
- 1 => [5, Scene_Gameover.new],
- 2 => [6, Scene_Menu.new]
- } # Jangan di delete.
- #---------------------------------------------------------------------------
- # * Key
- #---------------------------------------------------------------------------
- # [Input Mode, Button, Scene]
- # Input Mode : 1 = Input.press?
- # : 2 = Input.trigger? (Standard)
- # : 3 = Input.repeat?
- # Button : Tombol di keyboard. Pencet F1 di game jika ingin mengetahui lebih
- # lanjut.
- # Scene : Nama scene yang akan dipanggil.
- #---------------------------------------------------------------------------
- KEY_SHORTCUT = [
- [2, Input::Y, Scene_Title.new],
- [2, Input::X, Scene_Item.new]
- ] # Jangan di delete.
- #----------------------------------------------------------------------------
- # * Switch Common Event
- #----------------------------------------------------------------------------
- # Switch ID => [Condition, Common Event ID]
- # Switch ID : ID dari Switch.
- # Conditon : true = Memanggil scene jika Switch ON.
- # false = Memanggil scene jika Switch OFF.
- # Common Event ID : ID dari Common Event yang akan dipanggil.
- #----------------------------------------------------------------------------
- SWITCH_EVENT_SHORTCUT = {
- 3 => [true, 11],
- 4 => [true, 21]
- } # Jangan di delete.
- #----------------------------------------------------------------------------
- # * Variable Common Event
- #----------------------------------------------------------------------------
- # Variable ID => [Value, Common Event ID]
- # Variable ID : ID dari Variable.
- # Value : Nilai variable yang jika tercapai memanggil scene.
- # Common Event ID : ID dari Common Event yang akan dipanggil.
- #----------------------------------------------------------------------------
- VAR_EVENT_SHORTCUT = {
- 4 => [1, 31],
- 5 => [2, 41]
- } # Jangan di delete.
- #---------------------------------------------------------------------------
- # * Key Common Event
- #---------------------------------------------------------------------------
- # [Input Mode, Button, Scene]
- # Input Mode : 1 = Input.press?
- # : 2 = Input.trigger? (Standard)
- # : 3 = Input.repeat?
- # Button : Tombol di keyboard. Pencet F1 di game jika ingin mengetahui lebih
- # lanjut.
- # Common Event ID : ID dari Common Event yang akan dipanggil.
- #---------------------------------------------------------------------------
- KEY_EVENT_SHORTCUT = [
- [1, Input::L, 11]
- ] # Jangan di delete.
- end
- #==============================================================================
- # EDITING BEYOND THIS LINE CAN CAUSE DAMAGE TO YOUR GAME, THEREFORE EDIT
- # WITH YOUR OWN RISK.
- #==============================================================================
- VX = defined?(Window_ActorCommand)
- mog1 = VX ? "Scene_Map < Scene_Base" : "Scene_Map"
- eval"
- class #{mog1}
- include MapShortcut
- alias map_shortcut_update update unless $@
- def update
- # Call Check Shortcut method.
- check_shortcut
- # Call the old method.
- map_shortcut_update
- end
- #----------------------------------------------------------------------------
- # * Check Shortcut
- #----------------------------------------------------------------------------
- def check_shortcut
- SWITCH_SHORTCUT.each{|switch, process|
- if $game_switches[switch] == process[0]
- $scene = process[1]
- end
- }
- KEY_SHORTCUT.each{|process|
- if process[0] == 1
- if Input.press?(process[1])
- $scene = process[2]
- end
- elsif process[0] == 2
- if Input.trigger?(process[1])
- $scene = process[2]
- end
- elsif process[0] == 3
- if Input.repeat?(process[1])
- $scene = process[2]
- end
- end
- }
- VAR_SHORTCUT.each{|variable, process|
- if $game_variables[variable] == process[0]
- $scene = process[1]
- end
- }
- SWITCH_EVENT_SHORTCUT.each{|switch, common|
- if $game_switches[switch] == common[0]
- $game_temp.common_event_id = common[1]
- end
- }
- VAR_EVENT_SHORTCUT.each{|variable, common|
- if $game_variables[variable] == common[0]
- $game_temp.common_event_id = common[1]
- end
- }
- KEY_EVENT_SHORTCUT.each{|common|
- if common[0] == 1
- if Input.press?(common[1])
- $game_temp.common_event_id = common[2]
- end
- elsif common[0] == 2
- if Input.trigger?(common[1])
- $game_temp.common_event_id = common[2]
- end
- elsif common[0] == 3
- if Input.repeat?(common[1])
- $game_temp.common_event_id = common[2]
- end
- end
- }
- end
- #----------------------------------------------------------------------------
- # END OF SCRIPT
- #----------------------------------------------------------------------------
- end#"
Advertisement
Add Comment
Please, Sign In to add comment