|
| [SOLVED] Direct to Inventory Simple Script | |
| | Pengirim | Message |
---|
Galvin09 Novice
Posts : 241 Thanked : 8 Engine : Multi-Engine User Skill : Beginner Type : Developer
| Subyek: [SOLVED] Direct to Inventory Simple Script 2012-07-25, 20:52 | |
| Cocok buat game RMXP yang cuma butuh menu Inventory selama game ex Genre: Puzzle Script created by: aidilriski - Code:
-
class Scene_Map def update loop do $game_map.update $game_system.map_interpreter.update $game_player.update $game_system.update $game_screen.update unless $game_temp.player_transferring break end transfer_player if $game_temp.transition_processing break end end @spriteset.update @message_window.update if $game_temp.gameover $scene = Scene_Gameover.new return end if $game_temp.to_title $scene = Scene_Title.new return end if $game_temp.transition_processing $game_temp.transition_processing = false if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end if $game_temp.message_window_showing return end if $game_player.encounter_count == 0 and $game_map.encounter_list != [] unless $game_system.map_interpreter.running? or $game_system.encounter_disabled n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] if $data_troops[troop_id] != nil $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end if Input.trigger?(Input::B) unless $game_system.map_interpreter.running? or $game_system.menu_disabled $game_temp.menu_calling = true $game_temp.menu_beep = true end end if $DEBUG and Input.press?(Input::F9) $game_temp.debug_calling = true end unless $game_player.moving? if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end if Input.trigger?(Input::L) call_item end end end def call_item $game_player.straighten $game_system.se_play($data_system.buzzer_se) $scene = Scene_Item.new end class Scene_Item def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) @item = @item_window.item unless @item.is_a?(RPG::Item) $game_system.se_play($data_system.buzzer_se) return end unless $game_party.item_can_use?(@item.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) if @item.scope >= 3 @item_window.active = false @target_window.x = (@item_window.index + 1) % 2 * 304 @target_window.visible = true @target_window.active = true if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end else if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end $scene = Scene_Map.new return end end return end end end
Script created by: Lukas - Code:
-
class Scene_Map def call_menu $game_temp.menu_calling = false if $game_temp.menu_beep $game_system.se_play($data_system.decision_se) $game_temp.menu_beep = false end $game_player.straighten $scene = Scene_Item.new end end class Scene_Item alias lcgupdt update_item def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) return $scene = Scene_Map.new end lcgupdt end end
Terakhir diubah oleh Galvin09 tanggal 2012-07-27, 10:36, total 4 kali diubah | |
| | | aidilriski Senior
Posts : 643 Thanked : 2 Engine : Multi-Engine User Type : Mapper
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-25, 22:21 | |
| ni om galvin, baru saya buat, sry klo brantakan. Klo mau buka item, pencet Q (L di sistem) - Code:
-
#============================================================================== # ** Game_Temp #------------------------------------------------------------------------------ # This class handles temporary data that is not included with save data. # Refer to "$game_temp" for the instance of this class. #==============================================================================
class Game_Temp #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :map_bgm # map music (for battle memory) attr_accessor :message_text # message text attr_accessor :message_proc # message callback (Proc) attr_accessor :choice_start # show choices: opening line attr_accessor :choice_max # show choices: number of items attr_accessor :choice_cancel_type # show choices: cancel attr_accessor :choice_proc # show choices: callback (Proc) attr_accessor :num_input_start # input number: opening line attr_accessor :num_input_variable_id # input number: variable ID attr_accessor :num_input_digits_max # input number: digit amount attr_accessor :message_window_showing # message window showing attr_accessor :common_event_id # common event ID attr_accessor :in_battle # in-battle flag attr_accessor :battle_calling # battle calling flag attr_accessor :battle_troop_id # battle troop ID attr_accessor :battle_can_escape # battle flag: escape possible attr_accessor :battle_can_lose # battle flag: losing possible attr_accessor :battle_proc # battle callback (Proc) attr_accessor :battle_turn # number of battle turns attr_accessor :battle_event_flags # battle event flags: completed attr_accessor :battle_abort # battle flag: interrupt attr_accessor :battle_main_phase # battle flag: main phase attr_accessor :battleback_name # battleback file name attr_accessor :forcing_battler # battler being forced into action attr_accessor :shop_calling # shop calling flag attr_accessor :shop_goods # list of shop goods attr_accessor :name_calling # name input: calling flag attr_accessor :name_actor_id # name input: actor ID attr_accessor :name_max_char # name input: max character count attr_accessor :menu_calling # menu calling flag attr_accessor :menu_beep # menu: play sound effect flag attr_accessor :save_calling # save calling flag attr_accessor :debug_calling # debug calling flag attr_accessor :player_transferring # player place movement flag attr_accessor :player_new_map_id # player destination: map ID attr_accessor :player_new_x # player destination: x-coordinate attr_accessor :player_new_y # player destination: y-coordinate attr_accessor :player_new_direction # player destination: direction attr_accessor :transition_processing # transition processing flag attr_accessor :transition_name # transition file name attr_accessor :gameover # game over flag attr_accessor :to_title # return to title screen flag attr_accessor :last_file_index # last save file no. attr_accessor :debug_top_row # debug screen: for saving conditions attr_accessor :debug_index # debug screen: for saving conditions #-------------------------------------------------------------------------- attr_accessor :call_item_menu #Manggil menu item #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @map_bgm = nil @message_text = nil @message_proc = nil @choice_start = 99 @choice_max = 0 @choice_cancel_type = 0 @choice_proc = nil @num_input_start = 99 @num_input_variable_id = 0 @num_input_digits_max = 0 @message_window_showing = false @common_event_id = 0 @in_battle = false @battle_calling = false @battle_troop_id = 0 @battle_can_escape = false @battle_can_lose = false @battle_proc = nil @battle_turn = 0 @battle_event_flags = {} @battle_abort = false @battle_main_phase = false @battleback_name = '' @forcing_battler = nil @shop_calling = false @shop_id = 0 @name_calling = false @name_actor_id = 0 @name_max_char = 0 @menu_calling = false @menu_beep = false @save_calling = false @debug_calling = false @player_transferring = false @player_new_map_id = 0 @player_new_x = 0 @player_new_y = 0 @player_new_direction = 0 @transition_processing = false @transition_name = "" @gameover = false @to_title = false @last_file_index = 0 @debug_top_row = 0 @debug_index = 0 @call_item_menu = false end end
#============================================================================== # ** Scene_Map #------------------------------------------------------------------------------ # This class performs map screen processing. #==============================================================================
class Scene_Map #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make sprite set @spriteset = Spriteset_Map.new # Make message window @message_window = Window_Message.new # Transition run Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of sprite set @spriteset.dispose # Dispose of message window @message_window.dispose # If switching to title screen if $scene.is_a?(Scene_Title) # Fade out screen Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Loop loop do # Update map, interpreter, and player order # (this update order is important for when conditions are fulfilled # to run any event, and the player isn't provided the opportunity to # move in an instant) $game_map.update $game_system.map_interpreter.update $game_player.update # Update system (timer), screen $game_system.update $game_screen.update # Abort loop if player isn't place moving unless $game_temp.player_transferring break end # Run place move transfer_player # Abort loop if transition processing if $game_temp.transition_processing break end end # Update sprite set @spriteset.update # Update message window @message_window.update # If game over if $game_temp.gameover # Switch to game over screen $scene = Scene_Gameover.new return end # If returning to title screen if $game_temp.to_title # Change to title screen $scene = Scene_Title.new return end # If transition processing if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # If showing message window if $game_temp.message_window_showing return end # If encounter list isn't empty, and encounter count is 0 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # If event is running or encounter is not forbidden unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # Confirm troop n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # If troop is valid if $data_troops[troop_id] != nil # Set battle calling flag $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end # If B button was pressed if Input.trigger?(Input::B) # If event is running, or menu is not forbidden unless $game_system.map_interpreter.running? or $game_system.menu_disabled # Set menu calling flag or beep flag $game_temp.menu_calling = true $game_temp.menu_beep = true end end # If debug mode is ON and F9 key was pressed if $DEBUG and Input.press?(Input::F9) # Set debug calling flag $game_temp.debug_calling = true end # If player is not moving unless $game_player.moving? # Run calling of each screen if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug elsif $game_temp.call_item_menu call_item end end if Input.trigger?(Input::L) $game_temp.call_item_menu = true end end end #-------------------------------------------------------------------------- # * Battle Call #-------------------------------------------------------------------------- def call_battle # Clear battle calling flag $game_temp.battle_calling = false # Clear menu calling flag $game_temp.menu_calling = false $game_temp.menu_beep = false # Make encounter count $game_player.make_encounter_count # Memorize map BGM and stop BGM $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop # Play battle start SE $game_system.se_play($data_system.battle_start_se) # Play battle BGM $game_system.bgm_play($game_system.battle_bgm) # Straighten player position $game_player.straighten # Switch to battle screen $scene = Scene_Battle.new end #-------------------------------------------------------------------------- # * Shop Call #-------------------------------------------------------------------------- def call_shop # Clear shop call flag $game_temp.shop_calling = false # Straighten player position $game_player.straighten # Switch to shop screen $scene = Scene_Shop.new end #-------------------------------------------------------------------------- # * Name Input Call #-------------------------------------------------------------------------- def call_name # Clear name input call flag $game_temp.name_calling = false # Straighten player position $game_player.straighten # Switch to name input screen $scene = Scene_Name.new end #-------------------------------------------------------------------------- # * Menu Call #-------------------------------------------------------------------------- def call_menu # Clear menu call flag $game_temp.menu_calling = false # If menu beep flag is set if $game_temp.menu_beep # Play decision SE $game_system.se_play($data_system.decision_se) # Clear menu beep flag $game_temp.menu_beep = false end # Straighten player position $game_player.straighten # Switch to menu screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Save Call #-------------------------------------------------------------------------- def call_save # Straighten player position $game_player.straighten # Switch to save screen $scene = Scene_Save.new end #-------------------------------------------------------------------------- # * Debug Call #-------------------------------------------------------------------------- def call_debug # Clear debug call flag $game_temp.debug_calling = false # Play decision SE $game_system.se_play($data_system.decision_se) # Straighten player position $game_player.straighten # Switch to debug screen $scene = Scene_Debug.new end def call_item $game_temp.call_item_menu = false $game_player.straighten $scene = Scene_Item.new end #-------------------------------------------------------------------------- # * Player Place Move #-------------------------------------------------------------------------- def transfer_player # Clear player place move call flag $game_temp.player_transferring = false # If move destination is different than current map if $game_map.map_id != $game_temp.player_new_map_id # Set up a new map $game_map.setup($game_temp.player_new_map_id) end # Set up player position $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) # Set player direction case $game_temp.player_new_direction when 2 # down $game_player.turn_down when 4 # left $game_player.turn_left when 6 # right $game_player.turn_right when 8 # up $game_player.turn_up end # Straighten player position $game_player.straighten # Update map (run parallel process event) $game_map.update # Remake sprite set @spriteset.dispose @spriteset = Spriteset_Map.new # If processing transition if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition Graphics.transition(20) end # Run automatic change for BGM and BGS set on the map $game_map.autoplay # Frame reset Graphics.frame_reset # Update input information Input.update end
#============================================================================== # ** Scene_Item #------------------------------------------------------------------------------ # This class performs item screen processing. #==============================================================================
class Scene_Item #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make help window, item window @help_window = Window_Help.new @item_window = Window_Item.new # Associate help window @item_window.help_window = @help_window # Make target window (set to invisible / inactive) @target_window = Window_Target.new @target_window.visible = false @target_window.active = false # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @help_window.dispose @item_window.dispose @target_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @help_window.update @item_window.update @target_window.update # If item window is active: call update_item if @item_window.active update_item return end # If target window is active: call update_target if @target_window.active update_target return end end #-------------------------------------------------------------------------- # * Frame Update (when item window is active) #-------------------------------------------------------------------------- def update_item # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # Get currently selected data on the item window @item = @item_window.item # If not a use item unless @item.is_a?(RPG::Item) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If it can't be used unless $game_party.item_can_use?(@item.id) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # If effect scope is an ally if @item.scope >= 3 # Activate target window @item_window.active = false @target_window.x = (@item_window.index + 1) % 2 * 304 @target_window.visible = true @target_window.active = true # Set cursor position to effect scope (single / all) if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end # If effect scope is other than an ally else # If command event ID is valid if @item.common_event_id > 0 # Command event call reservation $game_temp.common_event_id = @item.common_event_id # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Draw item window item @item_window.draw_item(@item_window.index) end # Switch to map screen $scene = Scene_Map.new return end end return end end #-------------------------------------------------------------------------- # * Frame Update (when target window is active) #-------------------------------------------------------------------------- def update_target # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # If unable to use because items ran out unless $game_party.item_can_use?(@item.id) # Remake item window contents @item_window.refresh end # Erase target window @item_window.active = true @target_window.visible = false @target_window.active = false return end # If C button was pressed if Input.trigger?(Input::C) # If items are used up if $game_party.item_number(@item.id) == 0 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If target is all if @target_window.index == -1 # Apply item effects to entire party used = false for i in $game_party.actors used |= i.item_effect(@item) end end # If single target if @target_window.index >= 0 # Apply item use effects to target actor target = $game_party.actors[@target_window.index] used = target.item_effect(@item) end # If an item was used if used # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Redraw item window item @item_window.draw_item(@item_window.index) end # Remake target window contents @target_window.refresh # If all party members are dead if $game_party.all_dead? # Switch to game over screen $scene = Scene_Gameover.new return end # If common event ID is valid if @item.common_event_id > 0 # Common event call reservation $game_temp.common_event_id = @item.common_event_id # Switch to map screen $scene = Scene_Map.new return end end # If item wasn't used unless used # Play buzzer SE $game_system.se_play($data_system.buzzer_se) end return end end end
taruh tepat diatas main, taukan? sry klo brantakan, bru belajar. Silahkan bilang klo ada yang salah
Terakhir diubah oleh aidilriski tanggal 2012-07-25, 22:43, total 1 kali diubah | |
| | | Galvin09 Novice
Posts : 241 Thanked : 8 Engine : Multi-Engine User Skill : Beginner Type : Developer
| | | | aidilriski Senior
Posts : 643 Thanked : 2 Engine : Multi-Engine User Type : Mapper
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-25, 22:33 | |
| @galvin oh, klo itu, bikin aja event parallel proses di map entu, yang "Change Menu Access", di tab 1, bikin "disable" | |
| | | Galvin09 Novice
Posts : 241 Thanked : 8 Engine : Multi-Engine User Skill : Beginner Type : Developer
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-25, 22:37 | |
| - aidilriski wrote:
- @galvin oh, klo itu, bikin aja event parallel proses di map entu, yang "Change Menu Access", di tab 1, bikin "disable"
udah di disable, masalahnya pas mencet Esc ato X waktu buka inventory jadinya nongol tu main menu | |
| | | aidilriski Senior
Posts : 643 Thanked : 2 Engine : Multi-Engine User Type : Mapper
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-25, 22:42 | |
| owh, udah saya perbaikin, ini dia, tpi dari menu item, gak bakal bisa balik lgi ke menu : - Code:
-
#============================================================================== # ** Game_Temp #------------------------------------------------------------------------------ # This class handles temporary data that is not included with save data. # Refer to "$game_temp" for the instance of this class. #==============================================================================
class Game_Temp #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :map_bgm # map music (for battle memory) attr_accessor :message_text # message text attr_accessor :message_proc # message callback (Proc) attr_accessor :choice_start # show choices: opening line attr_accessor :choice_max # show choices: number of items attr_accessor :choice_cancel_type # show choices: cancel attr_accessor :choice_proc # show choices: callback (Proc) attr_accessor :num_input_start # input number: opening line attr_accessor :num_input_variable_id # input number: variable ID attr_accessor :num_input_digits_max # input number: digit amount attr_accessor :message_window_showing # message window showing attr_accessor :common_event_id # common event ID attr_accessor :in_battle # in-battle flag attr_accessor :battle_calling # battle calling flag attr_accessor :battle_troop_id # battle troop ID attr_accessor :battle_can_escape # battle flag: escape possible attr_accessor :battle_can_lose # battle flag: losing possible attr_accessor :battle_proc # battle callback (Proc) attr_accessor :battle_turn # number of battle turns attr_accessor :battle_event_flags # battle event flags: completed attr_accessor :battle_abort # battle flag: interrupt attr_accessor :battle_main_phase # battle flag: main phase attr_accessor :battleback_name # battleback file name attr_accessor :forcing_battler # battler being forced into action attr_accessor :shop_calling # shop calling flag attr_accessor :shop_goods # list of shop goods attr_accessor :name_calling # name input: calling flag attr_accessor :name_actor_id # name input: actor ID attr_accessor :name_max_char # name input: max character count attr_accessor :menu_calling # menu calling flag attr_accessor :menu_beep # menu: play sound effect flag attr_accessor :save_calling # save calling flag attr_accessor :debug_calling # debug calling flag attr_accessor :player_transferring # player place movement flag attr_accessor :player_new_map_id # player destination: map ID attr_accessor :player_new_x # player destination: x-coordinate attr_accessor :player_new_y # player destination: y-coordinate attr_accessor :player_new_direction # player destination: direction attr_accessor :transition_processing # transition processing flag attr_accessor :transition_name # transition file name attr_accessor :gameover # game over flag attr_accessor :to_title # return to title screen flag attr_accessor :last_file_index # last save file no. attr_accessor :debug_top_row # debug screen: for saving conditions attr_accessor :debug_index # debug screen: for saving conditions #-------------------------------------------------------------------------- attr_accessor :call_item_menu #Manggil menu item #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @map_bgm = nil @message_text = nil @message_proc = nil @choice_start = 99 @choice_max = 0 @choice_cancel_type = 0 @choice_proc = nil @num_input_start = 99 @num_input_variable_id = 0 @num_input_digits_max = 0 @message_window_showing = false @common_event_id = 0 @in_battle = false @battle_calling = false @battle_troop_id = 0 @battle_can_escape = false @battle_can_lose = false @battle_proc = nil @battle_turn = 0 @battle_event_flags = {} @battle_abort = false @battle_main_phase = false @battleback_name = '' @forcing_battler = nil @shop_calling = false @shop_id = 0 @name_calling = false @name_actor_id = 0 @name_max_char = 0 @menu_calling = false @menu_beep = false @save_calling = false @debug_calling = false @player_transferring = false @player_new_map_id = 0 @player_new_x = 0 @player_new_y = 0 @player_new_direction = 0 @transition_processing = false @transition_name = "" @gameover = false @to_title = false @last_file_index = 0 @debug_top_row = 0 @debug_index = 0 @call_item_menu = false end end
#============================================================================== # ** Scene_Map #------------------------------------------------------------------------------ # This class performs map screen processing. #==============================================================================
class Scene_Map #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make sprite set @spriteset = Spriteset_Map.new # Make message window @message_window = Window_Message.new # Transition run Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of sprite set @spriteset.dispose # Dispose of message window @message_window.dispose # If switching to title screen if $scene.is_a?(Scene_Title) # Fade out screen Graphics.transition Graphics.freeze end end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Loop loop do # Update map, interpreter, and player order # (this update order is important for when conditions are fulfilled # to run any event, and the player isn't provided the opportunity to # move in an instant) $game_map.update $game_system.map_interpreter.update $game_player.update # Update system (timer), screen $game_system.update $game_screen.update # Abort loop if player isn't place moving unless $game_temp.player_transferring break end # Run place move transfer_player # Abort loop if transition processing if $game_temp.transition_processing break end end # Update sprite set @spriteset.update # Update message window @message_window.update # If game over if $game_temp.gameover # Switch to game over screen $scene = Scene_Gameover.new return end # If returning to title screen if $game_temp.to_title # Change to title screen $scene = Scene_Title.new return end # If transition processing if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # If showing message window if $game_temp.message_window_showing return end # If encounter list isn't empty, and encounter count is 0 if $game_player.encounter_count == 0 and $game_map.encounter_list != [] # If event is running or encounter is not forbidden unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # Confirm troop n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # If troop is valid if $data_troops[troop_id] != nil # Set battle calling flag $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end # If B button was pressed if Input.trigger?(Input::B) # If event is running, or menu is not forbidden unless $game_system.map_interpreter.running? or $game_system.menu_disabled # Set menu calling flag or beep flag $game_temp.menu_calling = true $game_temp.menu_beep = true end end # If debug mode is ON and F9 key was pressed if $DEBUG and Input.press?(Input::F9) # Set debug calling flag $game_temp.debug_calling = true end # If player is not moving unless $game_player.moving? # Run calling of each screen if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug elsif $game_temp.call_item_menu call_item end end if Input.trigger?(Input::L) $game_temp.call_item_menu = true end end end #-------------------------------------------------------------------------- # * Battle Call #-------------------------------------------------------------------------- def call_battle # Clear battle calling flag $game_temp.battle_calling = false # Clear menu calling flag $game_temp.menu_calling = false $game_temp.menu_beep = false # Make encounter count $game_player.make_encounter_count # Memorize map BGM and stop BGM $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop # Play battle start SE $game_system.se_play($data_system.battle_start_se) # Play battle BGM $game_system.bgm_play($game_system.battle_bgm) # Straighten player position $game_player.straighten # Switch to battle screen $scene = Scene_Battle.new end #-------------------------------------------------------------------------- # * Shop Call #-------------------------------------------------------------------------- def call_shop # Clear shop call flag $game_temp.shop_calling = false # Straighten player position $game_player.straighten # Switch to shop screen $scene = Scene_Shop.new end #-------------------------------------------------------------------------- # * Name Input Call #-------------------------------------------------------------------------- def call_name # Clear name input call flag $game_temp.name_calling = false # Straighten player position $game_player.straighten # Switch to name input screen $scene = Scene_Name.new end #-------------------------------------------------------------------------- # * Menu Call #-------------------------------------------------------------------------- def call_menu # Clear menu call flag $game_temp.menu_calling = false # If menu beep flag is set if $game_temp.menu_beep # Play decision SE $game_system.se_play($data_system.decision_se) # Clear menu beep flag $game_temp.menu_beep = false end # Straighten player position $game_player.straighten # Switch to menu screen $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # * Save Call #-------------------------------------------------------------------------- def call_save # Straighten player position $game_player.straighten # Switch to save screen $scene = Scene_Save.new end #-------------------------------------------------------------------------- # * Debug Call #-------------------------------------------------------------------------- def call_debug # Clear debug call flag $game_temp.debug_calling = false # Play decision SE $game_system.se_play($data_system.decision_se) # Straighten player position $game_player.straighten # Switch to debug screen $scene = Scene_Debug.new end def call_item $game_temp.call_item_menu = false $game_player.straighten $scene = Scene_Item.new end #-------------------------------------------------------------------------- # * Player Place Move #-------------------------------------------------------------------------- def transfer_player # Clear player place move call flag $game_temp.player_transferring = false # If move destination is different than current map if $game_map.map_id != $game_temp.player_new_map_id # Set up a new map $game_map.setup($game_temp.player_new_map_id) end # Set up player position $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) # Set player direction case $game_temp.player_new_direction when 2 # down $game_player.turn_down when 4 # left $game_player.turn_left when 6 # right $game_player.turn_right when 8 # up $game_player.turn_up end # Straighten player position $game_player.straighten # Update map (run parallel process event) $game_map.update # Remake sprite set @spriteset.dispose @spriteset = Spriteset_Map.new # If processing transition if $game_temp.transition_processing # Clear transition processing flag $game_temp.transition_processing = false # Execute transition Graphics.transition(20) end # Run automatic change for BGM and BGS set on the map $game_map.autoplay # Frame reset Graphics.frame_reset # Update input information Input.update end
#============================================================================== # ** Scene_Item #------------------------------------------------------------------------------ # This class performs item screen processing. #==============================================================================
class Scene_Item #-------------------------------------------------------------------------- # * Main Processing #-------------------------------------------------------------------------- def main # Make help window, item window @help_window = Window_Help.new @item_window = Window_Item.new # Associate help window @item_window.help_window = @help_window # Make target window (set to invisible / inactive) @target_window = Window_Target.new @target_window.visible = false @target_window.active = false # Execute transition Graphics.transition # Main loop loop do # Update game screen Graphics.update # Update input information Input.update # Frame update update # Abort loop if screen is changed if $scene != self break end end # Prepare for transition Graphics.freeze # Dispose of windows @help_window.dispose @item_window.dispose @target_window.dispose end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Update windows @help_window.update @item_window.update @target_window.update # If item window is active: call update_item if @item_window.active update_item return end # If target window is active: call update_target if @target_window.active update_target return end end #-------------------------------------------------------------------------- # * Frame Update (when item window is active) #-------------------------------------------------------------------------- def update_item # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # Switch to menu screen $scene = Scene_Map.new return end # If C button was pressed if Input.trigger?(Input::C) # Get currently selected data on the item window @item = @item_window.item # If not a use item unless @item.is_a?(RPG::Item) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If it can't be used unless $game_party.item_can_use?(@item.id) # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # Play decision SE $game_system.se_play($data_system.decision_se) # If effect scope is an ally if @item.scope >= 3 # Activate target window @item_window.active = false @target_window.x = (@item_window.index + 1) % 2 * 304 @target_window.visible = true @target_window.active = true # Set cursor position to effect scope (single / all) if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end # If effect scope is other than an ally else # If command event ID is valid if @item.common_event_id > 0 # Command event call reservation $game_temp.common_event_id = @item.common_event_id # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Draw item window item @item_window.draw_item(@item_window.index) end # Switch to map screen $scene = Scene_Map.new return end end return end end #-------------------------------------------------------------------------- # * Frame Update (when target window is active) #-------------------------------------------------------------------------- def update_target # If B button was pressed if Input.trigger?(Input::B) # Play cancel SE $game_system.se_play($data_system.cancel_se) # If unable to use because items ran out unless $game_party.item_can_use?(@item.id) # Remake item window contents @item_window.refresh end # Erase target window @item_window.active = true @target_window.visible = false @target_window.active = false return end # If C button was pressed if Input.trigger?(Input::C) # If items are used up if $game_party.item_number(@item.id) == 0 # Play buzzer SE $game_system.se_play($data_system.buzzer_se) return end # If target is all if @target_window.index == -1 # Apply item effects to entire party used = false for i in $game_party.actors used |= i.item_effect(@item) end end # If single target if @target_window.index >= 0 # Apply item use effects to target actor target = $game_party.actors[@target_window.index] used = target.item_effect(@item) end # If an item was used if used # Play item use SE $game_system.se_play(@item.menu_se) # If consumable if @item.consumable # Decrease used items by 1 $game_party.lose_item(@item.id, 1) # Redraw item window item @item_window.draw_item(@item_window.index) end # Remake target window contents @target_window.refresh # If all party members are dead if $game_party.all_dead? # Switch to game over screen $scene = Scene_Gameover.new return end # If common event ID is valid if @item.common_event_id > 0 # Common event call reservation $game_temp.common_event_id = @item.common_event_id # Switch to map screen $scene = Scene_Map.new return end end # If item wasn't used unless used # Play buzzer SE $game_system.se_play($data_system.buzzer_se) end return end end end
| |
| | | Galvin09 Novice
Posts : 241 Thanked : 8 Engine : Multi-Engine User Skill : Beginner Type : Developer
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-25, 22:49 | |
| | |
| | | Lukas Senior
Posts : 618 Thanked : 22
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-26, 09:25 | |
| saya gak ngerti knapa harus sampe gak kompatible sama Flashlight System, dan scriptnya panjang. padahal cukup begini, dan jadilah coco crunch - Code:
-
class Scene_Map def call_menu $game_temp.menu_calling = false if $game_temp.menu_beep $game_system.se_play($data_system.decision_se) $game_temp.menu_beep = false end $game_player.straighten $scene = Scene_Item.new end end class Scene_Item alias lcgupdt update_item def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) return $scene = Scene_Map.new end lcgupdt end end edited: deleted
Terakhir diubah oleh Lukas tanggal 2012-07-26, 18:43, total 2 kali diubah | |
| | | aidilriski Senior
Posts : 643 Thanked : 2 Engine : Multi-Engine User Type : Mapper
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-26, 09:46 | |
| @lukas ooo, jadi bisa kayak gitu? saya kira bakal eror kalo gak ada yg lain maklum, baru belajar jdi klo kayak gitu, menu nya di ubah jadi menu item, pencet x langsung ke menu item kan? | |
| | | Lukas Senior
Posts : 618 Thanked : 22
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-26, 10:26 | |
| | |
| | | aidilriski Senior
Posts : 643 Thanked : 2 Engine : Multi-Engine User Type : Mapper
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script 2012-07-26, 11:55 | |
| @lukas thanks buat dukungannya @galvin ini ada yg udah dipendekkin, meskipun blum lebih pendek dri yg dibuat om Lukas taruhnya di atas skrip flashlight om Lukas, udah saya test, gak error, monggo di coba PM klo eror EDIT: Gak pake game_temp, udah compatible, terserah taruh di mana - Code:
-
class Scene_Map def update loop do $game_map.update $game_system.map_interpreter.update $game_player.update $game_system.update $game_screen.update unless $game_temp.player_transferring break end transfer_player if $game_temp.transition_processing break end end @spriteset.update @message_window.update if $game_temp.gameover $scene = Scene_Gameover.new return end if $game_temp.to_title $scene = Scene_Title.new return end if $game_temp.transition_processing $game_temp.transition_processing = false if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end if $game_temp.message_window_showing return end if $game_player.encounter_count == 0 and $game_map.encounter_list != [] unless $game_system.map_interpreter.running? or $game_system.encounter_disabled n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] if $data_troops[troop_id] != nil $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end if Input.trigger?(Input::B) unless $game_system.map_interpreter.running? or $game_system.menu_disabled $game_temp.menu_calling = true $game_temp.menu_beep = true end end if $DEBUG and Input.press?(Input::F9) $game_temp.debug_calling = true end unless $game_player.moving? if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end end if Input.trigger?(Input::L) call_item end end end def call_item $game_player.straighten $game_system.se_play($data_system.buzzer_se) $scene = Scene_Item.new end class Scene_Item def update_item if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new return end if Input.trigger?(Input::C) @item = @item_window.item unless @item.is_a?(RPG::Item) $game_system.se_play($data_system.buzzer_se) return end unless $game_party.item_can_use?(@item.id) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) if @item.scope >= 3 @item_window.active = false @target_window.x = (@item_window.index + 1) % 2 * 304 @target_window.visible = true @target_window.active = true if @item.scope == 4 || @item.scope == 6 @target_window.index = -1 else @target_window.index = 0 end else if @item.common_event_id > 0 $game_temp.common_event_id = @item.common_event_id $game_system.se_play(@item.menu_se) if @item.consumable $game_party.lose_item(@item.id, 1) @item_window.draw_item(@item_window.index) end $scene = Scene_Map.new return end end return end end end
| |
| | | Galvin09 Novice
Posts : 241 Thanked : 8 Engine : Multi-Engine User Skill : Beginner Type : Developer
| | | | Sponsored content
| Subyek: Re: [SOLVED] Direct to Inventory Simple Script | |
| |
| | | | [SOLVED] Direct to Inventory Simple Script | |
|
Similar topics | |
|
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
| Latest topics | » [Web Novel] Gloria Infidelis by LightNightKnight 2016-11-17, 21:27
» [Announcement] Forum baru untuk RMID by TheoAllen 2016-08-25, 16:39
» Where I'm Wrong ? by ReydVires 2016-07-24, 16:10
» flakeheartnet's Resources part III by flakeheartnet 2016-07-08, 14:30
» Keira's Art Warehouse by KeiraBlaze 2016-06-28, 19:27
» Theo Core Time System + Bingung by Lockin 2016-06-27, 16:24
» Error Script, Maybe ? by Lockin 2016-06-27, 16:20
» Nusaimoe @ RMID Lounge by Jihad Bagas 2016-06-21, 05:02
» Call Random Battle by Lockin 2016-06-15, 17:04
» Flakeheartnet Resources Part II [come back gift] by flakeheartnet 2016-06-07, 15:51
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|