RpgMasterMaking
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

RpgMasterMaking

Forum Rpg pour les makers utilisant rpg maker xp. Communauté des makers!
 
AccueilPortailGalerieRechercherDernières imagesS'enregistrerConnexion
-39%
Le deal à ne pas rater :
Pack Home Cinéma Magnat Monitor : Ampli DENON AVR-X2800H, Enceinte ...
1190 € 1950 €
Voir le deal

 

 Pêcher

Aller en bas 
2 participants
AuteurMessage
Vincr
Organisateur
Organisateur
Vincr


Nombre de messages : 567
Age : 30
Date d'inscription : 12/11/2007

Les Points d'Aides ( PA ) du membre
Nombre de PA:
Pêcher Left_bar_bleue62/250Pêcher Empty_bar_bleue  (62/250)
PA donnés: 8

Pêcher Empty
MessageSujet: Pêcher   Pêcher Icon_minitimeMer 14 Nov - 19:34

Ce script permet de pêcher quand on est proche de l'eau.

Faites un nouveau script au-dessus de "Main" et nommez-le "Fishing"

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:

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

Créez encore une fois un script au-dessus de "Main" et nommez le "Window_Fish"

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
Revenir en haut Aller en bas
Vincr
Organisateur
Organisateur
Vincr


Nombre de messages : 567
Age : 30
Date d'inscription : 12/11/2007

Les Points d'Aides ( PA ) du membre
Nombre de PA:
Pêcher Left_bar_bleue62/250Pêcher Empty_bar_bleue  (62/250)
PA donnés: 8

Pêcher Empty
MessageSujet: Re: Pêcher   Pêcher Icon_minitimeMer 14 Nov - 19:36

Utilisation

Dans Gestion des chipsets dans la base de données, Mettez l'eau en terrain type 1.

Pour pêcher avec la touche (Z) de votre clavier,

Changer la ligne 118 Scene_Map

Code:
if Input.trigger?(Input::A)

Voila un screen:

Pêcher Pecher
Revenir en haut Aller en bas
HawK
Novice
Novice



Masculin
Nombre de messages : 28
Age : 32
Localisation : Ain (01) - FRANCE
Date d'inscription : 11/11/2007

Les Points d'Aides ( PA ) du membre
Nombre de PA:
Pêcher Left_bar_bleue6/250Pêcher Empty_bar_bleue  (6/250)
PA donnés: 0

Pêcher Empty
MessageSujet: Re: Pêcher   Pêcher Icon_minitimeVen 16 Nov - 19:37

Mouais ... On peut très bien fait ça en event et ça marche mieux !
Revenir en haut Aller en bas
Vincr
Organisateur
Organisateur
Vincr


Nombre de messages : 567
Age : 30
Date d'inscription : 12/11/2007

Les Points d'Aides ( PA ) du membre
Nombre de PA:
Pêcher Left_bar_bleue62/250Pêcher Empty_bar_bleue  (62/250)
PA donnés: 8

Pêcher Empty
MessageSujet: Re: Pêcher   Pêcher Icon_minitimeVen 16 Nov - 19:43

Oui tu as tout à fais raison clin d'oeil

Ce script est plus utile à des makers débutant qui préfère les script
Revenir en haut Aller en bas
Contenu sponsorisé





Pêcher Empty
MessageSujet: Re: Pêcher   Pêcher Icon_minitime

Revenir en haut Aller en bas
 
Pêcher
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
RpgMasterMaking :: Partages :: Scripts :: Autre scripts-
Sauter vers:  
Ne ratez plus aucun deal !
Abonnez-vous pour recevoir par notification une sélection des meilleurs deals chaque jour.
IgnorerAutoriser