Nombre de messages : 147 Age : 34 Niveau RPG Maker : Excellentes modif en script , bon en tutos , maping assez correct mais naze en ressources Date d'inscription : 11/08/2006
Sujet: Upgrade d''arme comme dans suikoden Sam 6 Jan 2007 - 22:51
le script en lui même est assez simple il vous faudra crée :
les armes selon un certain crtitere :
votre arme primaire suivi de 15 améliorations ( une arme lvl 16 au final comme dans suikoden =) ) et la 17 ieme rien.
maintenant il faudra donc attribuer une arme à chaque heros ^^
# トランジション実行 Graphics.transition # メインループ loop do # ゲーム画面を更新 Graphics.update # 入力情報を更新 Input.update # フレーム更新 update # 画面が切り替わったらループを中断 if $scene != self break end end # トランジション準備 Graphics.freeze # ウィンドウを解放 @face_window.dispose @facebis_window.dispose @gold_window.dispose @status_window.dispose @armebis_window.dispose @arme_window.dispose
end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update @face_window.update @facebis_window.update @gold_window.update @status_window.update @armebis_window.update @arme_window.update # B ボタンが押された場合 cout = @actor.pet cout *= @actor.pet cout *= 500 if [color=red]$game_variables[6][/color] > @actor.pet and cout <= $game_party.gold grr = @actor.weapon_id grr += 1 $game_party.gain_weapon(grr, 1) @actor.equip(0, grr) grr -= 1 $game_party.lose_weapon(grr, 1) $game_party.lose_gold(cout) end # メニュー画面に切り替え $scene = Scene_arme.new(0) end end
voila les scenes maintenant les window sur le post suivant :p
Lord Ephraim
Artisan (Nv 3)
Nombre de messages : 147 Age : 34 Niveau RPG Maker : Excellentes modif en script , bon en tutos , maping assez correct mais naze en ressources Date d'inscription : 11/08/2006
Sujet: Re: Upgrade d'arme comme dans suikoden Sam 6 Jan 2007 - 22:51
Nombre de messages : 147 Age : 34 Niveau RPG Maker : Excellentes modif en script , bon en tutos , maping assez correct mais naze en ressources Date d'inscription : 11/08/2006
Sujet: Re: Upgrade d'arme comme dans suikoden Sam 6 Jan 2007 - 22:52
class Window_Selectablearme < Window_Base #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :index # カーソル位置 attr_reader :help_window # ヘルプウィンドウ #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 # width : ウィンドウの幅 # height : ウィンドウの高さ #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) @item_max = 1 @column_max = 1 @index = -1 end #-------------------------------------------------------------------------- # ● カーソル位置の設定 # index : 新しいカーソル位置 #-------------------------------------------------------------------------- def index=(index) @index = index # ヘルプテキストを更新 (update_help は継承先で定義される) if self.active and @help_window != nil update_help end # カーソルの矩形を更新 update_cursor_rect end #-------------------------------------------------------------------------- # ● 行数の取得 #-------------------------------------------------------------------------- def row_max # 項目数と列数から行数を算出 return (@item_max + @column_max - 1) / @column_max end #-------------------------------------------------------------------------- # ● 先頭の行の取得 #-------------------------------------------------------------------------- def top_row # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る return self.oy / 16 end #-------------------------------------------------------------------------- # ● 先頭の行の設定 # row : 先頭に表示する行 #-------------------------------------------------------------------------- def top_row=(row) # row が 0 未満の場合は 0 に修正 if row < 0 row = 0 end # row が row_max - 1 超の場合は row_max - 1 に修正 if row > row_max - 1 row = row_max - 1 end # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする self.oy = row * 16 end #-------------------------------------------------------------------------- # ● 1 ページに表示できる行数の取得 #-------------------------------------------------------------------------- def page_row_max # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る return (self.height - 32) / 16 end #-------------------------------------------------------------------------- # ● 1 ページに表示できる項目数の取得 #-------------------------------------------------------------------------- def page_item_max # 行数 page_row_max に 列数 @column_max を掛ける return page_row_max * @column_max end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの設定 # help_window : 新しいヘルプウィンドウ #-------------------------------------------------------------------------- def help_window=(help_window) @help_window = help_window # ヘルプテキストを更新 (update_help は継承先で定義される) if self.active and @help_window != nil update_help end end #-------------------------------------------------------------------------- # ● カーソルの矩形更新 #-------------------------------------------------------------------------- def update_cursor_rect # カーソル位置が 0 未満の場合 if @index < 0 self.cursor_rect.empty return end # 現在の行を取得 row = @index / @column_max # 現在の行が、表示されている先頭の行より前の場合 if row < self.top_row # 現在の行が先頭になるようにスクロール self.top_row = row end # 現在の行が、表示されている最後尾の行より後ろの場合 if row > self.top_row + (self.page_row_max - 1) # 現在の行が最後尾になるようにスクロール self.top_row = row - (self.page_row_max - 1) end # カーソルの幅を計算 cursor_width = self.width / @column_max - 20 # カーソルの座標を計算 x = @index % @column_max * (cursor_width + 16) y = @index / @column_max * 16 - self.oy
x+= -4 # カーソルの矩形を更新 self.cursor_rect.set(x, y, cursor_width, 16)
end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super # カーソルの移動が可能な状態の場合 if self.active and @item_max > 0 and @index >= 0 # 方向ボタンの下が押された場合 if Input.repeat?(Input::DOWN) # 列数が 1 かつ 方向ボタンの下の押下状態がリピートでない場合か、 # またはカーソル位置が(項目数 - 列数)より前の場合 if (@column_max == 1 and Input.trigger?(Input::DOWN)) or @index < @item_max - @column_max # カーソルを下に移動 $game_system.se_play($data_system.cursor_se) @index = (@index + @column_max) % @item_max end end # 方向ボタンの上が押された場合 if Input.repeat?(Input::UP) # 列数が 1 かつ 方向ボタンの上の押下状態がリピートでない場合か、 # またはカーソル位置が列数より後ろの場合 if (@column_max == 1 and Input.trigger?(Input::UP)) or @index >= @column_max # カーソルを上に移動 $game_system.se_play($data_system.cursor_se) @index = (@index - @column_max + @item_max) % @item_max end end # 方向ボタンの右が押された場合 if Input.repeat?(Input::RIGHT) # 列数が 2 以上で、カーソル位置が(項目数 - 1)より前の場合 if @column_max >= 2 and @index < @item_max - 1 # カーソルを右に移動 $game_system.se_play($data_system.cursor_se) @index += 1 end end # 方向ボタンの左が押された場合 if Input.repeat?(Input::LEFT) # 列数が 2 以上で、カーソル位置が 0 より後ろの場合 if @column_max >= 2 and @index > 0 # カーソルを左に移動 $game_system.se_play($data_system.cursor_se) @index -= 1 end end # R ボタンが押された場合 if Input.repeat?(Input::R) # 表示されている最後尾の行が、データ上の最後の行よりも前の場合 if self.top_row + (self.page_row_max - 1) < (self.row_max - 1) # カーソルを 1 ページ後ろに移動 $game_system.se_play($data_system.cursor_se) @index = [@index + self.page_item_max, @item_max - 1].min self.top_row += self.page_row_max end end # L ボタンが押された場合 if Input.repeat?(Input::L) # 表示されている先頭の行が 0 より後ろの場合 if self.top_row > 0 # カーソルを 1 ページ前に移動 $game_system.se_play($data_system.cursor_se) @index = [@index - self.page_item_max, 0].max self.top_row -= self.page_row_max end end end # ヘルプテキストを更新 (update_help は継承先で定義される) if self.active and @help_window != nil update_help end # カーソルの矩形を更新 update_cursor_rect end end
Lord Ephraim
Artisan (Nv 3)
Nombre de messages : 147 Age : 34 Niveau RPG Maker : Excellentes modif en script , bon en tutos , maping assez correct mais naze en ressources Date d'inscription : 11/08/2006
Sujet: Re: Upgrade d'arme comme dans suikoden Sam 6 Jan 2007 - 22:52
def pet n = [[base_pet + @pet_plus, 1].max, 999].min n = [[Integer(n), 1].max, 999].min return n end
Lord Ephraim
Artisan (Nv 3)
Nombre de messages : 147 Age : 34 Niveau RPG Maker : Excellentes modif en script , bon en tutos , maping assez correct mais naze en ressources Date d'inscription : 11/08/2006
Sujet: Re: Upgrade d'arme comme dans suikoden Sam 6 Jan 2007 - 22:53
ca en fini plus lol XD
dans game_battler1 remplacer:
Code:
def atk n = base_atk for i in @states n *= $data_states[i].atk_rate / 100.0 end return Integer(n) end
par:
Code:
def atk n = [[base_str + @str_plus, 1].max, 999].min + base_atk for i in @states n *= $data_states[i].atk_rate / 100.0 end return Integer(n) end #-------------------------------------------------------------------------- def fatk n = base_fatk for i in @states n *= $data_states[i].fatk_rate / 100.0 end return Integer(n) end
$game_variables[6] ici correspond a la variable numéro 6 si vous avez deja quelque chose remplacer le 6 par une de vos variables vides :p
Pour lancer le menu d'upgrade crée un event comme celui. ( vous pouvez voir que j'ai sauté sur le script de mini map XD) la varibale 6 correspond en fait au niveau max de l'upgrade que le foregeron peu faire ( si vous voulez qu'il n'excede pas le niveau 5 mettez alors en valeur pour la variable le chiffre 5 ^^ )
derniere etape comment afficher ca dans le menu de statut XD