deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Possibilité de pêcher Mar 10 Juil 2007, 10:36 | |
| Auteur: Inconnu Fonctions: Se script vous permet de pêcher quand on est proche de l'eau et quand on appuie sur une touche. Screen: Faite un nouveau script au-dessus de Main et nommé le " Fishing" et collez se code: - Code:
-
#============================================================================== # ■ fishing #------------------------------------------------------------------------------ # デバッグ画面の処理を行うクラスです。 #==============================================================================
class Fishing #---------------------------------------------------------------------------- # Start #---------------------------------------------------------------------------- def initialize @fw = Window_Fish.new $fm = "Vous êtes entrain de pêcher..." @fw.refresh delay(50) fish end #---------------------------------------------------------------------------- # Fishing! #---------------------------------------------------------------------------- def fish delay(40) @fr = rand(7)#this number inside the brackets indicate how many things there are. and remeber it starts from 0 so if you have 5 things you have to have 4 case @fr when 0 $game_player.animation_id = 98 $fm = "Hey! un poisson de 10 livres!" @fw.refresh $game_party.gain_item(33, 1)#the item number of the fish is here delay(10) when 1 $fm = "Pas de poisson!" @fw.refresh delay(10) when 2 $fm = "Trouvé une chaussure" @fw.refresh delay(30) when 3 $game_player.animation_id = 98 $fm = "Hey! un poisson de 10 livres!" @fw.refresh $game_party.gain_item(34, 1) delay(20) when 4 $fm = " Yark! des algues!" @fw.refresh delay(30) when 5 $game_player.animation_id = 98 $fm = "Hey! un poisson de 20 livres!" @fw.refresh $game_party.gain_item(34, 1) delay(20) when 6 $fm = "Zut! pas de poisson!" @fw.refresh delay(10) when 7 $fm = "Hey! un poisson de 30 livres!" @fw.refresh delay(60) end @fw.dispose end #---------------------------------------------------------------------------- # Delay #---------------------------------------------------------------------------- def delay(wait) count = Graphics.frame_count while wait + count >= Graphics.frame_count Graphics.update end end end Remplacer le script " Scene_Map" par celui ci : - Code:
-
class Scene_Map # --------------------------- SHOW_PARTY_HELP_SPRITE = false # --------------------------- def main @spriteset = Spriteset_Map.new @change_sprite = Sprite.new @change_sprite.bitmap = Bitmap.new(100, 32) @change_sprite.x = 540 @change_sprite.y = 450 @change_sprite.bitmap.clear @message_window = Window_Message.new Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @spriteset.dispose @message_window.dispose @change_sprite.dispose if $scene.is_a?(Scene_Title) Graphics.transition Graphics.freeze end end # --------------------------- 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 # エンカウント カウントã�Œ 0 ã�§ã€�エンカウントリストã�Œç©ºã�§ã�¯ã�ªã�„å ´å�ˆ 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 # B ボタンã�ŒæŠ¼ã�•ã‚Œã�Ÿå ´å�ˆ if Input.trigger?(Input::B) # イベント実行ä¸ã�‹ãƒ¡ãƒ‹ãƒ¥ãƒ¼ç¦�æ¢ä¸ã�§ã�ªã�‘ã‚Œã�° unless $game_system.map_interpreter.running? or $game_system.menu_disabled # メニュー呼ã�³å‡ºã�—フラグã�¨ SE æ¼”å¥�フラグをセット $game_temp.menu_calling = true $game_temp.menu_beep = true end end # FISHING # if z pushed call fishing if Input.trigger?(Input::A) fishing end # FISHING # デãƒ�ッグモードã�Œ ON ã�‹ã�¤ F9 ã‚ーã�ŒæŠ¼ã�•ã‚Œã�¦ã�„ã‚‹å ´å�ˆ 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 end #-------------------------------------------------------------------------- # â—� ãƒ�トルã�®å‘¼ã�³å‡ºã�— #-------------------------------------------------------------------------- def call_battle # ãƒ�トル呼ã�³å‡ºã�—フラグをクリア $game_temp.battle_calling = false # メニュー呼ã�³å‡ºã�—フラグをクリア $game_temp.menu_calling = false $game_temp.menu_beep = false # エンカウント カウントを作æˆ� $game_player.make_encounter_count # マップ BGM を記憶ã�—ã€�BGM ã‚’å�œæ¢ $game_temp.map_bgm = $game_system.playing_bgm $game_system.bgm_stop # ãƒ�トル開始 SE ã‚’æ¼”å¥� $game_system.se_play($data_system.battle_start_se) # ãƒ�トル BGM ã‚’æ¼”å¥� $game_system.bgm_play($game_system.battle_bgm) # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # ãƒ�トル画é�¢ã�«åˆ‡ã‚Šæ›¿ã�ˆ $scene = Scene_Battle.new end #-------------------------------------------------------------------------- # â—� ショップã�®å‘¼ã�³å‡ºã�— #-------------------------------------------------------------------------- def call_shop # ショップ呼ã�³å‡ºã�—フラグをクリア $game_temp.shop_calling = false # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # ショップ画é�¢ã�«åˆ‡ã‚Šæ›¿ã�ˆ $scene = Scene_Shop.new end #-------------------------------------------------------------------------- # â—� å��å‰�入力ã�®å‘¼ã�³å‡ºã�— #-------------------------------------------------------------------------- def call_name # å��å‰�入力呼ã�³å‡ºã�—フラグをクリア $game_temp.name_calling = false # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # å��å‰�入力画é�¢ã�«åˆ‡ã‚Šæ›¿ã�ˆ $scene = Scene_Name.new end #-------------------------------------------------------------------------- # â—� メニューã�®å‘¼ã�³å‡ºã�— #-------------------------------------------------------------------------- def call_menu # メニュー呼ã�³å‡ºã�—フラグをクリア $game_temp.menu_calling = false # メニュー SE æ¼”å¥�フラグã�Œã‚»ãƒƒãƒˆã�•ã‚Œã�¦ã�„ã‚‹å ´å�ˆ if $game_temp.menu_beep # 決定 SE ã‚’æ¼”å¥� $game_system.se_play($data_system.decision_se) # メニュー SE æ¼”å¥�フラグをクリア $game_temp.menu_beep = false end # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # メニュー画é�¢ã�«åˆ‡ã‚Šæ›¿ã�ˆ $scene = Scene_Menu.new end #-------------------------------------------------------------------------- # â—� セーブã�®å‘¼ã�³å‡ºã�— #-------------------------------------------------------------------------- def call_save # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # セーブ画é�¢ã�«åˆ‡ã‚Šæ›¿ã�ˆ $scene = Scene_Save.new end #-------------------------------------------------------------------------- # â—� デãƒ�ッグã�®å‘¼ã�³å‡ºã�— #-------------------------------------------------------------------------- def call_debug # デãƒ�ッグ呼ã�³å‡ºã�—フラグをクリア $game_temp.debug_calling = false # 決定 SE ã‚’æ¼”å¥� $game_system.se_play($data_system.decision_se) # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # デãƒ�ッグ画é�¢ã�«åˆ‡ã‚Šæ›¿ã�ˆ $scene = Scene_Debug.new end #-------------------------------------------------------------------------- # â—� Fishing #-------------------------------------------------------------------------- def fishing character = $game_player case character.direction when 2 lx = character.x ly = character.y + 1 when 4 lx = character.x - 1 ly = character.y when 6 lx = character.x + 1 ly = character.y when 8 lx = character.x ly = character.y - 1 end if $game_map.terrain_tag(lx,ly) == 1 Fishing.new else Audio.se_play("Audio/SE/057-Wrong01") end end #-------------------------------------------------------------------------- # â—� プレイヤーã�®å ´æ‰€ç§»å‹• #-------------------------------------------------------------------------- def transfer_player # ãƒ—ãƒ¬ã‚¤ãƒ¤ãƒ¼å ´æ‰€ç§»å‹•ãƒ•ãƒ©ã‚°ã‚’ã‚¯ãƒªã‚¢ $game_temp.player_transferring = false # 移動先ã�Œç�¾åœ¨ã�®ãƒžãƒƒãƒ—ã�¨ç•°ã�ªã‚‹å ´å�ˆ if $game_map.map_id != $game_temp.player_new_map_id # æ–°ã�—ã�„マップをセットアップ $game_map.setup($game_temp.player_new_map_id) end # プレイヤーã�®ä½�置をè¨å®š $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y) # プレイヤーã�®å�‘ã��ã‚’è¨å®š case $game_temp.player_new_direction when 2 # 下 $game_player.turn_down when 4 # å·¦ $game_player.turn_left when 6 # å�³ $game_player.turn_right when 8 # 上 $game_player.turn_up end # プレイヤーã�®å§¿å‹¢ã‚’çŸ¯æ£ $game_player.straighten # マップを更新 (並列イベント実行) $game_map.update # スプライトセットをå†�作æˆ� @spriteset = Spriteset_Map.new # トランジション処ç�†ä¸ã�®å ´å�ˆ if $game_temp.transition_processing # トランジション処ç�†ä¸ãƒ•ãƒ©ã‚°ã‚’クリア $game_temp.transition_processing = false # トランジション実行 Graphics.transition(20) end # マップã�«è¨å®šã�•ã‚Œã�¦ã�„ã‚‹ BGM ã�¨ BGS ã�®è‡ªå‹•åˆ‡ã‚Šæ›¿ã�ˆã‚’実行 $game_map.autoplay # フレームリセット Graphics.frame_reset # å…¥åŠ›æƒ…å ±ã‚’æ›´æ–° Input.update end end | |
|
deadcell Trouvère Follet
Nombre de messages : 625 Age : 35 Niveau Rpg Maker : Excellent Niveau Jeux Préférés : Final Fantasy, Resident evil... Date d'inscription : 21/03/2007
| Sujet: Re: Possibilité de pêcher Mar 10 Juil 2007, 10:41 | |
| Créez un script au dessus de " Main" nommé " Window_Fish" au mettez ceci : - Code:
-
#============================================================================== # ■ Window_Fish #------------------------------------------------------------------------------ # Fishy! #==============================================================================
class Window_Fish < Window_Base #-------------------------------------------------------------------------- # ● Start #-------------------------------------------------------------------------- def initialize super(0, 406, 640, 64) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $defaultfonttype self.contents.font.size = $defaultfontsize self.opacity = 0 $fm = " " refresh end #-------------------------------------------------------------------------- # ● Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = normal_color self.contents.draw_text(4, 0, 640, 32, $fm) end end Dans Gestion des chipsets dans la base de données, Mettez l'eau en terrain type 1. En cas de problème avec la gestion des chipsets, il existe un tutoriaux complet sur la base de donnée, allez y jeter un coup d’œil. Ppour pêcher avec la touche (Z) de votre clavier, changer la ligne 118 Scene_Mapif Input.trigger?(Input::A)En cas de difficulté avec les touches, allez voir le tutoriaux sur les touches dans Script / RGSS. | |
|