狼之樂園
Wolves' Paradise
修正兩個BUG。 1.在開始畫面選擇讀取存檔,按X鍵會出現遊戲選單。(汗) 原因是我漏看了一些小細節……看來我要更加習慣RMVX的內建腳本寫法。 2.之前黑獅說無法移除後備隊伍的BUG已經解決了。 原來事件編輯器裏還有一項「某角色在隊伍」, 這一句原本只對參戰隊伍作用,現已修正對備戰隊伍也有效。 看黑獅在Script testing minigame的寫法,就是備戰隊員不會滿足「某角色在隊伍」的條件,所以才導致沒有成功移除隊員。 自從體會到腳本的強大後,我幾乎沒打開過事件編輯器……
如果有導入其他腳本的話,我應該要遊戲專案來研究。 不過我覺得遊戲存檔不算十分大,尤其是遊戲專案裏應該有不少原創圖片, 只壓縮存檔的話,效率應該不高。 Bitmap的部份,整個遊戲有大量圖像的處理,尤其是Cache、Scene_Base這些類別,在內建腳本裏到處都用到,單憑這些訊息實在很難找到問題所在。(汗)
[quote="好喝的茶"]第一個BUG,我測試了幾次都沒有發現,在備戰隊伍裏的人員還是能順利移除。 移除隊伍人員的指令,在Party_Menber_Change腳本裏第155行的位置︰ [code:1] def remove_actor(actor_id) @actors.delete(actor_id) @joinlist.delete(actor_id) $game_player.refresh end [/code:1] 不知道黑獅有沒有使用其他抓回來的腳本? 有時候腳本之間會發生衝突。 像我把內建移除隊員的指令更新了,其他腳本卻可能覆蓋了我更新的程式碼。 [/quote] 我是有加入其它抓回來的腳本,壓縮存檔文件的。 原始存檔大小比較大,所以壓縮成近1/5的大小 既然要加入遊戲製作的話,Script的管理就交給你好了,或許這種情況只是靠我說明並不太能解決根本問題。 [quote]至於那原因不明的錯誤,那訊息我看不懂。(汗) 程式語言自我檢查錯誤的能力十分薄弱,很多時出現錯誤的地方並不在它寫的訊息上。 我運行上也沒有問題,我使用的是RMXP1.02,英文版本。 我需要更詳細的資料,例如他進行過什麼操作,有否導入其他腳本等,才有可能找出問題所在。[/quote] 只從英文上看的話,是和bitmap有關聯。而這個bitmap在游戲裡指什麽我就不知道了。 根據報告的人給我看到的畫面,貌似是在Title畫面下出現的錯誤。 我會讓他重新安裝一下程序來測試看看
第一個BUG,我測試了幾次都沒有發現,在備戰隊伍裏的人員還是能順利移除。 移除隊伍人員的指令,在Party_Menber_Change腳本裏第155行的位置︰ [code:1] def remove_actor(actor_id) @actors.delete(actor_id) @joinlist.delete(actor_id) $game_player.refresh end [/code:1] 不知道黑獅有沒有使用其他抓回來的腳本? 有時候腳本之間會發生衝突。 像我把內建移除隊員的指令更新了,其他腳本卻可能覆蓋了我更新的程式碼。 第二個BUG則是我上次理解錯誤了,原來黑獅想讓資料庫裏所有角色都能共享經驗值? 在Party_Menber_Change腳本裏第528行︰ 點擊以顯示隱藏內容 [code:1] #recorrect Battle exp class Scene_Battle def display_level_up exp = $game_troop.exp_total for actor in ($game_party.existing_members + $game_party.existing_joiners) last_level = actor.level last_skills = actor.skills actor.gain_exp(exp, true) end wait_for_message end end [/code:1] 把這段更新成︰ 點擊以顯示隱藏內容 [code:1] #recorrect Battle exp class Scene_Battle def display_level_up exp = $game_troop.exp_total tmp = $game_party.existing_members + $game_party.existing_joiners for i in 1...$data_actors.size last_level = $game_actors[i].level last_skills = $game_actors[i].skills $game_actors[i].gain_exp(exp, tmp.include?($game_actors[i])) if $game_actors[i].exist? end wait_for_message end end [/code:1] 這樣會使資料庫裏所有「存活」的角色都會得到經驗值。 (始終覺得有角色陣亡,躺著不動卻能得到經驗值很奇怪) 至於那原因不明的錯誤,那訊息我看不懂。(汗) 程式語言自我檢查錯誤的能力十分薄弱,很多時出現錯誤的地方並不在它寫的訊息上。 我運行上也沒有問題,我使用的是RMXP1.02,英文版本。 我需要更詳細的資料,例如他進行過什麼操作,有否導入其他腳本等,才有可能找出問題所在。
以上獲得更改的Script測試報告 發現以下BUG: 1. 加入夥伴后,如果不在戰鬥隊伍里就不能通過事件指令讓角色離隊 2. 不存在於後備隊伍和戰鬥隊伍里的離隊任務無法共有EXP(我原本是寫希望都能共有的,所以報告上來。其實這樣我也無所謂就是了,我會想辦法設定其他角色入隊時的等級。) 原因不明: 有報告說這個加入了Script的遊戲程序無法啟動...... 從我之前導入的追查錯誤地點的Script導出的文件里獲得以下訊息 雖然不知道是不是真的因為這些Script。我自己是可以運行。 總之貼上來看看,就算和新Script無關我也想要知道錯誤原因是什麽。 所以要給會寫程序的看才行... [quote]-------------------------------- ◆ 2009-08-23T11:40:01 Error type : RGSSError Message : failed to create bitmap Backtrace : Cache : line 80 : initialize Cache : line 80 : new Cache : line 80 : load_bitmap Cache : line 60 : system Spriteset_Map : line 41 : create_tilemap Spriteset_Map : line 14 : initialize Scene_Map : line 14 : new Scene_Map : line 14 : start Scene_Base : line 12 : main Detail error mesage : line 107 : run Detail error mesage : line 207 --------------------------------[/quote]
[quote="好喝的茶"] 右下角的資料部份,黑獅還想加入什麼? 遊戲內建可以顯示角色臉圖、行走圖、名字、職業、等級、狀態、HP、MP、EXP、各項能力、各項裝備。 當然看黑獅需要,我可以另外寫。 我對遊戲製作和黑獅的遊戲也很有興趣,不過我應該只能負責寫程式之類, 美工什麼的我一碰就死了。(汗)[/quote] 美工的話,目前好像有一個人能勝任,我需要找他談談。 關於畫圖類的呢。 我會選擇主要找日本人或美國人的原因就是,日本那邊意見討論歸意見討論,已經決定了的事就會按照那個基本來做。 而美國更乾脆了,給一個目標,照著規定完成... 而中文界這邊.....麻煩太多了 所以,除了個別不會出現風格問題的部份以外,我是不希望太多中文界的人參加。 而寫程式就沒關繫了~況且之前加入了我們的某一位寫程序的美國人因為工作而忙了起來,決定退出了 現在我們這裡很缺人寫程式的說。 所以要加入的話我們是很歡迎的。 想要加入的話麻煩加我的製作組用MSN帳號吧。 bowblack1@yahoo.co.jp 右下角的資料部份,我用文字寫寫看... [code:1]—————————————右下角窗口—————————————— _______ | | 名字 等級 | 角色 | 職業 目前經驗值 | 臉圖 | HP條==================== 升級所需經驗值 |_______| MP條==================== ———————————————————————————————— Str 裝備: Dex 武器 等各項能力,豎排放在左邊 盾...etc,同樣豎排列表 ———————————————————————————————— 這個部份按照計算來說,很可能會空出點位置 如果真的有空出的話,或許我會想要加點什麼東西在這裡 可能是關於每一個角色在遊戲里可能牽扯的事件記錄 比如說,Saur桑曾經提議過的,讓戰鬥隊伍能和 後備隊伍,或者尚未加入同伴的角色切磋(用網絡遊戲的說法就是PvP記錄?) 看情況吧.....也不知道會不會空出,而且空出多大。 ————————————————————————————————[/code:1]
呃,遊戲內建經驗值和金錢的寫法有點不同。 想了想,還是這麼改吧。 把原腳本中Enemy_Level整篇刪去,再貼下面新的︰ 點擊以顯示隱藏內容 [code:1] class Game_Enemy < Game_Battler def initialize(index, enemy_id) super() @index = index @enemy_id = enemy_id enemy = $data_enemies[@enemy_id] #split name @original_name = enemy.name.split(/,/)[0] @letter = '' @plural = false @screen_x = 0 @screen_y = 0 @battler_name = enemy.battler_name @battler_hue = enemy.battler_hue #if not fixed status if self.lv != -1 #set multiplier @mul = [$game_party.avg_lv, self.lv].max #set amplitude amp = $data_enemies[@enemy_id].name.split(/,/)[2].to_i #multiply hp and mp self.maxhp = (self.maxhp * 1.1 ** @mul).round self.maxmp = (self.maxmp * 1.1 ** @mul).round #multiply other parameters self.atk += @mul * amp self.def += @mul * amp self.spi += @mul * amp self.agi += @mul * amp end @hp = maxhp @mp = maxmp end #multiply exp and gold def exp return (enemy.exp * 1.25 ** @mul).round end def gold return (enemy.gold * 1.25 ** @mul).round end #level def lv tmp = $data_enemies[@enemy_id].name.split(/,/)[1] tmp != nil ? tmp.to_i : -1 end end class Game_Party < Game_Unit #average level def avg_lv sum = 0 for i in @actors actor = $game_actors[i] sum += actor.level end return sum / @actors.size end end [/code:1] 其實改的地方不多,不過有點零碎,乾脆再貼一次比較不會出錯。 另外我也發現HP和MP會出現小數,這次就順便改成整數了。 至改倍數的話,在腳本裏改這兩行內的數字就行︰ return (enemy.exp * 1.25 ** @mul).round return (enemy.gold * 1.25 ** @mul).round 至於備戰角色也能共享戰鬥經驗值那邊。 在Party_Member_Change腳本裏130那裏,插入新函式(藍字)︰ 點擊以顯示隱藏內容 [code:1] def joiners result = [] for i in @joinlist result.push($game_actors[i]) end return result end def existing_joiners result = [] for battler in joiners next unless battler.exist? result.push(battler) end return result end #recorrect add and remove member def add_actor(actor_id) if not @actors.include?(actor_id) if @actors.size < MAX_MEMBERS @actors.push(actor_id) $game_player.refresh elsif not @joinlist.include?(actor_id) @joinlist.push(actor_id) end end end [/code:1] 然後在腳本最下方插入︰ 點擊以顯示隱藏內容 [code:1] #recorrect Battle exp class Scene_Battle def display_level_up exp = $game_troop.exp_total for actor in ($game_party.existing_members + $game_party.existing_joiners) last_level = actor.level last_skills = actor.skills actor.gain_exp(exp, true) end wait_for_message end end [/code:1] 嫌麻煩話可以把舊版整篇刪除,再貼下面新版的。反正都是複製貼上。 點擊以顯示隱藏內容 [code:1] #add new command class Scene_Menu def create_command_window #new s0 = "隊伍" s1 = Vocab::item s2 = Vocab::skill s3 = Vocab::equip s4 = Vocab::status s5 = Vocab::save s6 = Vocab::game_end @command_window = Window_Command.new(160, [s0, s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.members.size == 0 # If number of party members is 0 @command_window.draw_item(0, false) # Disable party @command_window.draw_item(1, false) # Disable item @command_window.draw_item(2, false) # Disable skill @command_window.draw_item(3, false) # Disable equipment @command_window.draw_item(4, false) # Disable status end if $game_system.save_disabled # If save is forbidden @command_window.draw_item(5, false) # Disable save end end def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index <= 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 5 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 #party $scene = Scene_Party.new when 1 # Item $scene = Scene_Item.new when 2,3,4 # Skill, equipment, status start_actor_selection when 5 # Save $scene = Scene_File.new(true, false, false) when 6 # End Game $scene = Scene_End.new end end end def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when 2 # skill $scene = Scene_Skill.new(@status_window.index) when 3 # equipment $scene = Scene_Equip.new(@status_window.index) when 4 # status $scene = Scene_Status.new(@status_window.index) end end end end #recorrect all the return_scene index class Scene_Item def return_scene $scene = Scene_Menu.new(1) end end class Scene_Skill def return_scene $scene = Scene_Menu.new(2) end end class Scene_Equip def return_scene $scene = Scene_Menu.new(3) end end class Scene_Status def return_scene $scene = Scene_Menu.new(4) end end class Scene_File def return_scene $scene = Scene_Menu.new(5) end end class Scene_End def return_scene $scene = Scene_Menu.new(6) end end #add joiner list, access @actors in Game_Party class class Game_Party attr_accessor :actors attr_accessor :joinlist def initialize super @gold = 0 @steps = 0 @last_item_id = 0 @last_actor_index = 0 @last_target_index = 0 @actors = [] # Party member (actor ID) @items = {} # Inventory item hash (item ID) @weapons = {} # Inventory item hash (weapon ID) @armors = {} # Inventory item hash (armor ID) #new @joinlist = [] #joiners list(actor ID) end def joiners result = [] for i in @joinlist result.push($game_actors[i]) end return result end def existing_joiners result = [] for battler in joiners next unless battler.exist? result.push(battler) end return result end #recorrect add and remove member def add_actor(actor_id) if not @actors.include?(actor_id) if @actors.size < MAX_MEMBERS @actors.push(actor_id) $game_player.refresh elsif not @joinlist.include?(actor_id) @joinlist.push(actor_id) end end end def remove_actor(actor_id) @actors.delete(actor_id) @joinlist.delete(actor_id) $game_player.refresh end #recorrect walk def on_player_walk tmp = members + joiners for actor in tmp if actor.slip_damage? actor.hp -= 1 if actor.hp > 1 # Poison damage $game_map.screen.start_flash(Color.new(255,0,0,64), 4) end if actor.auto_hp_recover and actor.hp > 0 actor.hp += 1 # HP auto recovery end end end end #recorrect interpreter class Game_Interpreter def iterate_actor_id(param) if param == 0 # All for actor in $game_party.members do yield actor end for actor in $game_party.joiners do yield actor end else # One actor = $game_actors[param] yield actor unless actor == nil end end end #recorrect Scene_Item and Scene_Skill class Scene_Item def determine_target used = false if @item.for_all? tmp = $game_party.members + $game_party.joiners for target in tmp target.item_effect(target, @item) used = true unless target.skipped end else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] target.item_effect(target, @item) used = true unless target.skipped end if used use_item_nontarget else Sound.play_buzzer end end end class Scene_Skill def determine_target used = false if @skill.for_all? tmp = $game_party.members + $game_party.joiners for target in tmp target.skill_effect(@actor, @skill) used = true unless target.skipped end elsif @skill.for_user? target = $game_party.members[@target_window.index - 100] target.skill_effect(@actor, @skill) used = true unless target.skipped else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] target.skill_effect(@actor, @skill) used = true unless target.skipped end if used use_skill_nontarget else Sound.play_buzzer end end end #create Scene_Party class class Scene_Party < Scene_Base def start super create_menu_background #make command window s = ["加入/替換","退出"] @command_window = Window_Command.new(128, s) #check disable join or swap @command_window.draw_item(0, false) if $game_party.joiners.empty? #make battler window @battler_window = Window_Battler.new #make joiner window @joiner_window = Window_Joiner.new #make status window @status_window = Window_Base.new(128, 128, 416, 288) #set last index @lastb = -1 @lastj = -1 #set control value #0選單 1加入.選擇隊員 2加入.選擇空格 3退出隊員 @control = 0 end def terminate super dispose_menu_background @command_window.dispose @battler_window.dispose @joiner_window.dispose @status_window.dispose end def update super @command_window.update if @command_window.active if @battler_window.active @battler_window.update if @lastb != @battler_window.index @lastb = @battler_window.index status_update end end if @joiner_window.active @joiner_window.update if @lastj != @joiner_window.index @lastj = @joiner_window.index status_update end end #B key if Input.trigger?(Input::B) Sound.play_cancel #quit party menu case @control when 0 $scene = Scene_Menu.new(0) when 1 @joiner_window.active = false @joiner_window.index = -1 @command_window.active = true @status_window.contents.clear @control = 0 when 2 @battler_window.active = false @battler_window.index = -1 @joiner_window.active = true @control = 1 status_update when 3 @battler_window.active = false @battler_window.index = -1 @command_window.active = true @status_window.contents.clear @control = 0 end end #C key if Input.trigger?(Input::C) case @control when 0 #determine active joiner or battler window if @command_window.index == 0 #check disable if $game_party.joiners.empty? Sound.play_buzzer return end @control = 1 @joiner_window.active = true if @lastj == -1 @joiner_window.index = 0 else @joiner_window.index = @lastj status_update end else @control = 3 @battler_window.active = true if @lastb == -1 @battler_window.index = 0 else @battler_window.index = @lastb status_update end end @command_window.active = false when 1 @control = 2 @joiner_window.active = false @battler_window.active = true if @lastb == -1 @battler_window.index = 0 else @battler_window.index = @lastb status_update end when 2 #add or swap member tmp = $game_party.joiners[@joiner_window.index].id if $game_party.members[@battler_window.index] == nil $game_party.actors.push(tmp) $game_party.joinlist.delete(tmp) else $game_party.joinlist[@joiner_window.index] = $game_party.actors[@battler_window.index] $game_party.actors[@battler_window.index] = tmp end #refresh joiner and battler window $game_player.refresh @joiner_window.refresh @battler_window.refresh @battler_window.active = false @battler_window.index = -1 #if no joiner, active command window, else active joiner window if $game_party.joiners.empty? @control = 0 @joiner_window.active = false @joiner_window.index = -1 @status_window.contents.clear @command_window.draw_item(0, false) @command_window.active = true else @control = 1 @joiner_window.active = true status_update end when 3 #check if there is a battler and there are at least two battler if ($game_party.members[@battler_window.index] == nil) or $game_party.members.size < 2 Sound.play_buzzer return end #remove member tmp = $game_party.members[@battler_window.index].id $game_party.joinlist.push(tmp) $game_party.actors.delete(tmp) #enable add or swap option @command_window.draw_item(0, true) #refresh joiner and battler window $game_player.refresh @joiner_window.refresh @battler_window.refresh status_update end Sound.play_decision end end #update status window def status_update @status_window.contents.clear #get joiner or battler object tmp = @control == 1 ? $game_party.joiners[@joiner_window.index] : $game_party.members[@battler_window.index] return if tmp == nil #show status @status_window.draw_actor_name(tmp, 0, 0) @status_window.draw_actor_class(tmp, 128, 0) @status_window.draw_actor_level(tmp, 0, 24) @status_window.draw_actor_state(tmp, 128, 24) @status_window.draw_actor_hp(tmp, 0, 48) @status_window.draw_actor_mp(tmp, 128, 48) @status_window.draw_actor_parameter(tmp, 0, 72, 0) @status_window.draw_actor_parameter(tmp, 0, 96, 1) @status_window.draw_actor_parameter(tmp, 0, 120, 2) @status_window.draw_actor_parameter(tmp, 0, 144, 3) end end #battler window for Scene_Party class Window_Battler < Window_Selectable def initialize super(128, 0, 416, 128) @item_max = 4 @column_max = 4 self.contents = Bitmap.new(384, 96) refresh self.active = false self.index = -1 end def refresh self.contents.clear for actor in $game_party.members self.draw_actor_face(actor, actor.index * 96 + 2, 2, 92) end end def update_cursor if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(@index*96, 0, 96, 96) end end end #joiner window for Scene_Party class Window_Joiner < Window_Selectable #resize WLH WLH = 48 def initialize super(0, 128, 128, 288) refresh self.active = false self.index = -1 end def refresh @item_max = $game_party.joiners.size #check correct index @index -= 1 if @item_max == @index create_contents for i in 0...$game_party.joiners.size draw_actor_graphic($game_party.joiners[i], 32, i*48+8) end end #add update status window def index=(index) super end #recorrect superclass defs with new WLH def create_contents self.contents.dispose self.contents = Bitmap.new(width - 32, [height - 32, row_max * WLH].max) end def top_row return self.oy / WLH end def top_row=(row) row = 0 if row < 0 row = row_max - 1 if row > row_max - 1 self.oy = row * WLH end def page_row_max return (self.height - 32) / WLH end def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = (contents.width + @spacing) / @column_max - @spacing rect.height = WLH rect.x = index % @column_max * (rect.width + @spacing) rect.y = index / @column_max * WLH return rect end def draw_character(character_name, character_index, x, y) return if character_name == nil bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) self.contents.blt(x, y, bitmap, src_rect) end end #recorrect Battle exp class Scene_Battle def display_level_up exp = $game_troop.exp_total for actor in ($game_party.existing_members + $game_party.existing_joiners) last_level = actor.level last_skills = actor.skills actor.gain_exp(exp, true) end wait_for_message end end [/code:1] 右下角的資料部份,黑獅還想加入什麼? 遊戲內建可以顯示角色臉圖、行走圖、名字、職業、等級、狀態、HP、MP、EXP、各項能力、各項裝備。 當然看黑獅需要,我可以另外寫。 我對遊戲製作和黑獅的遊戲也很有興趣,不過我應該只能負責寫程式之類, 美工什麼的我一碰就死了。(汗)
我會立刻用來看看 把選項文字也改出一個日文和英文的,讓所有能加入測試的幫忙Debug這個系統看看。 下次報告我寫新帖 謝謝了
終於寫好了。雖然有部份程式碼只是複製內建再改,不過500行程式碼還是很吃力……(汗) 點擊以顯示隱藏內容 [code:1] #add new command class Scene_Menu def create_command_window #new s0 = "隊伍" s1 = Vocab::item s2 = Vocab::skill s3 = Vocab::equip s4 = Vocab::status s5 = Vocab::save s6 = Vocab::game_end @command_window = Window_Command.new(160, [s0, s1, s2, s3, s4, s5, s6]) @command_window.index = @menu_index if $game_party.members.size == 0 # If number of party members is 0 @command_window.draw_item(0, false) # Disable party @command_window.draw_item(1, false) # Disable item @command_window.draw_item(2, false) # Disable skill @command_window.draw_item(3, false) # Disable equipment @command_window.draw_item(4, false) # Disable status end if $game_system.save_disabled # If save is forbidden @command_window.draw_item(5, false) # Disable save end end def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index <= 4 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 5 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 #party $scene = Scene_Party.new when 1 # Item $scene = Scene_Item.new when 2,3,4 # Skill, equipment, status start_actor_selection when 5 # Save $scene = Scene_File.new(true, false, false) when 6 # End Game $scene = Scene_End.new end end end def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when 2 # skill $scene = Scene_Skill.new(@status_window.index) when 3 # equipment $scene = Scene_Equip.new(@status_window.index) when 4 # status $scene = Scene_Status.new(@status_window.index) end end end end #recorrect all the return_scene index class Scene_Item def return_scene $scene = Scene_Menu.new(1) end end class Scene_Skill def return_scene $scene = Scene_Menu.new(2) end end class Scene_Equip def return_scene $scene = Scene_Menu.new(3) end end class Scene_Status def return_scene $scene = Scene_Menu.new(4) end end class Scene_File def return_scene $scene = Scene_Menu.new(5) end end class Scene_End def return_scene $scene = Scene_Menu.new(6) end end #add joiner list, access @actors in Game_Party class class Game_Party attr_accessor :actors attr_accessor :joinlist def initialize super @gold = 0 @steps = 0 @last_item_id = 0 @last_actor_index = 0 @last_target_index = 0 @actors = [] # Party member (actor ID) @items = {} # Inventory item hash (item ID) @weapons = {} # Inventory item hash (weapon ID) @armors = {} # Inventory item hash (armor ID) #new @joinlist = [] #joiners list(actor ID) end def joiners result = [] for i in @joinlist result.push($game_actors[i]) end return result end #recorrect add and remove member def add_actor(actor_id) if not @actors.include?(actor_id) if @actors.size < MAX_MEMBERS @actors.push(actor_id) $game_player.refresh elsif not @joinlist.include?(actor_id) @joinlist.push(actor_id) end end end def remove_actor(actor_id) @actors.delete(actor_id) @joinlist.delete(actor_id) $game_player.refresh end #recorrect walk def on_player_walk tmp = members + joiners for actor in tmp if actor.slip_damage? actor.hp -= 1 if actor.hp > 1 # Poison damage $game_map.screen.start_flash(Color.new(255,0,0,64), 4) end if actor.auto_hp_recover and actor.hp > 0 actor.hp += 1 # HP auto recovery end end end end #recorrect interpreter class Game_Interpreter def iterate_actor_id(param) if param == 0 # All for actor in $game_party.members do yield actor end for actor in $game_party.joiners do yield actor end else # One actor = $game_actors[param] yield actor unless actor == nil end end end #recorrect Scene_Item and Scene_Skill class Scene_Item def determine_target used = false if @item.for_all? tmp = $game_party.members + $game_party.joiners for target in tmp target.item_effect(target, @item) used = true unless target.skipped end else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] target.item_effect(target, @item) used = true unless target.skipped end if used use_item_nontarget else Sound.play_buzzer end end end class Scene_Skill def determine_target used = false if @skill.for_all? tmp = $game_party.members + $game_party.joiners for target in tmp target.skill_effect(@actor, @skill) used = true unless target.skipped end elsif @skill.for_user? target = $game_party.members[@target_window.index - 100] target.skill_effect(@actor, @skill) used = true unless target.skipped else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] target.skill_effect(@actor, @skill) used = true unless target.skipped end if used use_skill_nontarget else Sound.play_buzzer end end end #create Scene_Party class class Scene_Party < Scene_Base def start super create_menu_background #make command window s = ["加入/替換","退出"] @command_window = Window_Command.new(128, s) #check disable join or swap @command_window.draw_item(0, false) if $game_party.joiners.empty? #make battler window @battler_window = Window_Battler.new #make joiner window @joiner_window = Window_Joiner.new #make status window @status_window = Window_Base.new(128, 128, 416, 288) #set last index @lastb = -1 @lastj = -1 #set control value #0選單 1加入.選擇隊員 2加入.選擇空格 3退出隊員 @control = 0 end def terminate super dispose_menu_background @command_window.dispose @battler_window.dispose @joiner_window.dispose @status_window.dispose end def update super @command_window.update if @command_window.active if @battler_window.active @battler_window.update if @lastb != @battler_window.index @lastb = @battler_window.index status_update end end if @joiner_window.active @joiner_window.update if @lastj != @joiner_window.index @lastj = @joiner_window.index status_update end end #B key if Input.trigger?(Input::B) Sound.play_cancel #quit party menu case @control when 0 $scene = Scene_Menu.new(0) when 1 @joiner_window.active = false @joiner_window.index = -1 @command_window.active = true @status_window.contents.clear @control = 0 when 2 @battler_window.active = false @battler_window.index = -1 @joiner_window.active = true @control = 1 status_update when 3 @battler_window.active = false @battler_window.index = -1 @command_window.active = true @status_window.contents.clear @control = 0 end end #C key if Input.trigger?(Input::C) case @control when 0 #determine active joiner or battler window if @command_window.index == 0 #check disable if $game_party.joiners.empty? Sound.play_buzzer return end @control = 1 @joiner_window.active = true if @lastj == -1 @joiner_window.index = 0 else @joiner_window.index = @lastj status_update end else @control = 3 @battler_window.active = true if @lastb == -1 @battler_window.index = 0 else @battler_window.index = @lastb status_update end end @command_window.active = false when 1 @control = 2 @joiner_window.active = false @battler_window.active = true if @lastb == -1 @battler_window.index = 0 else @battler_window.index = @lastb status_update end when 2 #add or swap member tmp = $game_party.joiners[@joiner_window.index].id if $game_party.members[@battler_window.index] == nil $game_party.actors.push(tmp) $game_party.joinlist.delete(tmp) else $game_party.joinlist[@joiner_window.index] = $game_party.actors[@battler_window.index] $game_party.actors[@battler_window.index] = tmp end #refresh joiner and battler window $game_player.refresh @joiner_window.refresh @battler_window.refresh @battler_window.active = false @battler_window.index = -1 #if no joiner, active command window, else active joiner window if $game_party.joiners.empty? @control = 0 @joiner_window.active = false @joiner_window.index = -1 @status_window.contents.clear @command_window.draw_item(0, false) @command_window.active = true else @control = 1 @joiner_window.active = true status_update end when 3 #check if there is a battler and there are at least two battler if ($game_party.members[@battler_window.index] == nil) or $game_party.members.size < 2 Sound.play_buzzer return end #remove member tmp = $game_party.members[@battler_window.index].id $game_party.joinlist.push(tmp) $game_party.actors.delete(tmp) #enable add or swap option @command_window.draw_item(0, true) #refresh joiner and battler window $game_player.refresh @joiner_window.refresh @battler_window.refresh status_update end Sound.play_decision end end #update status window def status_update @status_window.contents.clear #get joiner or battler object tmp = @control == 1 ? $game_party.joiners[@joiner_window.index] : $game_party.members[@battler_window.index] return if tmp == nil #show status @status_window.draw_actor_name(tmp, 0, 0) @status_window.draw_actor_class(tmp, 128, 0) @status_window.draw_actor_level(tmp, 0, 24) @status_window.draw_actor_state(tmp, 128, 24) @status_window.draw_actor_hp(tmp, 0, 48) @status_window.draw_actor_mp(tmp, 128, 48) @status_window.draw_actor_parameter(tmp, 0, 72, 0) @status_window.draw_actor_parameter(tmp, 0, 96, 1) @status_window.draw_actor_parameter(tmp, 0, 120, 2) @status_window.draw_actor_parameter(tmp, 0, 144, 3) end end #battler window for Scene_Party class Window_Battler < Window_Selectable def initialize super(128, 0, 416, 128) @item_max = 4 @column_max = 4 self.contents = Bitmap.new(384, 96) refresh self.active = false self.index = -1 end def refresh self.contents.clear for actor in $game_party.members self.draw_actor_face(actor, actor.index * 96 + 2, 2, 92) end end def update_cursor if @index < 0 self.cursor_rect.empty else self.cursor_rect.set(@index*96, 0, 96, 96) end end end #joiner window for Scene_Party class Window_Joiner < Window_Selectable #resize WLH WLH = 48 def initialize super(0, 128, 128, 288) refresh self.active = false self.index = -1 end def refresh @item_max = $game_party.joiners.size #check correct index @index -= 1 if @item_max == @index create_contents for i in 0...$game_party.joiners.size draw_actor_graphic($game_party.joiners[i], 32, i*48+8) end end #add update status window def index=(index) super end #recorrect superclass defs with new WLH def create_contents self.contents.dispose self.contents = Bitmap.new(width - 32, [height - 32, row_max * WLH].max) end def top_row return self.oy / WLH end def top_row=(row) row = 0 if row < 0 row = row_max - 1 if row > row_max - 1 self.oy = row * WLH end def page_row_max return (self.height - 32) / WLH end def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = (contents.width + @spacing) / @column_max - @spacing rect.height = WLH rect.x = index % @column_max * (rect.width + @spacing) rect.y = index / @column_max * WLH return rect end def draw_character(character_name, character_index, x, y) return if character_name == nil bitmap = Cache.character(character_name) sign = character_name[/^[\!\$]./] if sign != nil and sign.include?('$') cw = bitmap.width / 3 ch = bitmap.height / 4 else cw = bitmap.width / 12 ch = bitmap.height / 8 end n = character_index src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch) self.contents.blt(x, y, bitmap, src_rect) end end [/code:1] 貼的地方跟上次一樣。 點擊以顯示隱藏內容 解說︰ 1.選單第一行會多出「隊伍」選項。如果參戰人數為0,此選項會被禁止。 2.「隊伍」選項裏有「加入/替換」指令及「退出」指令。如果備戰人數為0,加入指令會被禁止。 3.如果參戰人數僅剩1人,將無法退出該人員。 4.事件編輯器的改動︰ a.增加隊員︰如果參戰隊伍有空缺,會加在參戰隊伍裏;如果滿人,就加在備戰隊伍裏。 b.移除隊員︰不論角色參戰還是備戰與否都會被移除。 c.增減HP、MP、狀態、經驗值、等級,以及角色全回復︰只要範圍是全隊伍,連備戰角色也會受影響。 d.在非戰鬥情況下使用道具、技能︰只要範圍是全隊伍,連備戰角色也會受影響。 e.在戰鬥情況下使用道具、技能︰如果範圍是全隊伍,則只有參戰角色會受影響。 大致是這樣。有BUG或者需要修改的就告訴我吧。
[quote="好喝的茶"]系統差不多寫好了。剛寫好加入參戰角色,剩下的退出角色和其他一堆小細節,留待明天。 說起來我又學到了新東西。 不過有些設定需要問黑獅。 遊戲是否允許沒有參戰人員?是不是最少得有一人參戰呢? 遊戲裏應該有旅館吧。 旅館的休息效果,是只限於參戰角色,還是連備戰角色也會HP、MP全回復?[/quote] 嗯,麻煩了~ 我比較好奇我該怎麼設定加入角色進入那個無限制的後備隊伍 因為這涉及到遊戲製作程序本體... 這個遊戲不能沒有參戰人員,退出編輯隊伍選項是必須要有一個人在參戰隊伍 遊戲裏面當然有旅館,特定情況下我是準備看看能不能製作一個帳篷的道具,戰鬥外專門回覆全HP,MP和狀態的 而當然最好是讓所有參戰和非參戰隊員都能得到恢復。 只不過單體的道具恢復還是保持限定,只能用在戰鬥隊伍中的人身上好了。 按照遊戲的製作方法,旅館是要使用全恢復的命令執行,而道具恐怕也會用... 所以,全恢復的命令涉及到全員的該法應該會變得很重要?
系統差不多寫好了。剛寫好加入參戰角色,剩下的退出角色和其他一堆小細節,留待明天。 說起來我又學到了新東西。 不過有些設定需要問黑獅。 遊戲是否允許沒有參戰人員?是不是最少得有一人參戰呢? 遊戲裏應該有旅館吧。 旅館的休息效果,是只限於參戰角色,還是連備戰角色也會HP、MP全回復?
[quote="好喝的茶"]呃,在香港,分辨率是叫「解析度」,難怪我看不懂。 我之前也在煩惱要怎麼改這個……今早終於知道了,真的很簡單。 Graphics.resize_screen(width, height) 打這個就可以了,width和height分別輸入寛度和高度, 最高是640x480,跟RMXP一樣。[/quote] 這樣的寫法我是有聽說過,不過我查看了一下解析度的Script 整個遊戲的Script裏面有不少都寫這著解析度的數字...所以我也很不確定了 窗口的大小可以讓CG變得好看得多 但是問題問題是如果我不大範圍的提高RPG的地圖和角色圖水平的話,人物太小了也不行...
嗯,遊戲中的動作都不是一個動畫圖片,而是讓遊戲讀取多個圖片在播放...寫起來或許真的很麻煩 但是選中的角色圖如果沒有動作的話真的感覺很奇怪... 我是打算用內建的選單。 選中的話,角色圖外會有方框顯示,也是很明顯啦…… 呃,在香港,分辨率是叫「解析度」,難怪我看不懂。 我之前也在煩惱要怎麼改這個……今早終於知道了,真的很簡單。 Graphics.resize_screen(width, height) 打這個就可以了,width和height分別輸入寛度和高度, 最高是640x480,跟RMXP一樣。
[quote]我大概明白。 不過我覺得自動表現走路動作是超——麻煩的,應該會繞上一個大圈。 打算用透明與不透明之類的簡單效果表示。 [/quote] 嗯,遊戲中的動作都不是一個動畫圖片,而是讓遊戲讀取多個圖片在播放...寫起來或許真的很麻煩 但是選中的角色圖如果沒有動作的話真的感覺很奇怪... [quote]這一段看不懂。(汗) 需要程序師與否,應該是看內建係統能否滿足作者需要吧。 不過RMXP和RMVX的內建係統連RM2003都不如……(汗) [/quote] 就是更換前後,戰鬥隊伍的顯示是直接更換,而在備選的角色窗口中會怎麼樣的問題 嘛,這個無論是哪一種都不太重要了 而且當然不可能滿足了~遊戲主旨不一樣,想要做的事之類的就不同了 可能的話加點創新也是讓遊戲變得有趣的手段 [quote]窗口分辨率是?我是用英文版RMVX,看不太懂。[/quote] VX的窗口分辨率是544×416,目前我也以這個爲標準在做。 然後我忽然發現我忘了好幾個很基本想要的程序更改...... 我應該找時間去把別人寫好公開的某些Script拿來用用 比如獲得道具時自動顯示道具名字和消息,以及道具說明的 人物角色的對話裏面加上一個專門顯示名字的窗口 在菜單裏顯示地圖名字或者屏幕上.... 以前貌似看到過不錯的,所以一直想要用用看,結果因為以前說過但是沒空去弄 結果都忘記了....汗
像截圖那樣,以有四個戰鬥角色的組隊中 是否能成功把固定角色從固定劇情中加到可編輯的隊伍里 RPGVX的基本設定中隊伍人數最大為4,程式碼到底要怎麼把這個限制取消掉 怎麼樣把新加入隊伍的角色放到可更換的角色列表里........ RMVX內建隊伍最多四人,這個要改的話牽涉很多東西。 所以我打算另外開一個無人數上限的隊伍,用來放備戰角色。 我本來就打算交換「內建參戰隊伍」和「備戰隊伍」的角色。 這個隨時隨地都可以更換戰鬥角色的系統能不能加入限制 讓固定角色按照劇情而無法從戰鬥隊伍中替換掉 (雖然我可以很乾脆的無視這部份,反正都在隊伍里,戰鬥中的劇情的話也照樣寫沒關係 所以這部份其實可以忽略,主要問題是更上面的。) 如果上面和下面兩個問題能解決,這個只是小事一樁。 關於右下角的空視窗... 我在想, 不如把選擇隊員的窗口放到左下豎著,然後右邊(右下角)就做成顯示角色資料的窗口(這個大小比例我比較難說...) 左邊的窗口里,直接把可替換的角色的圖標變成點出來的角色圖,而不是頭像 不用名字也不用職業等任何說明,就只是一個人型 (按照普通RPG的想法,選中的角色的角色會自動表現走路的動作?) 然後選中了的角色的資料就在右下角里,變成這種感覺 我大概明白。 不過我覺得自動表現走路動作是超——麻煩的,應該會繞上一個大圈。 打算用透明與不透明之類的簡單效果表示。 不過,要寫成這樣的話肯定很麻煩了.... 而且我估計,根據圖片大小和人數來看,左下角一次表現的人數不是6個就是8個。 那麼很可能超越8個角色的情況中,或許需要寫自動滾軸。 自動滾軸……應該有內建的吧。如果玩家擁有大量道具,道具選單也會變成可滾動。 我試試看能不能借用內建系統。 以及,我不知道哪一種比較簡單了,以進入戰鬥隊伍的角色停留在那裡不消失,反而只是做上標記(當然是字母了,簡樸點寫個B在旁邊....Battle Member的意思?) 做個大遊戲沒有程序師還真是不行啊... 這一段看不懂。(汗) 需要程序師與否,應該是看內建系統能否滿足作者需要吧。 不過RMXP和RMVX的內建系統連RM2003都不如……(汗) 我記得遊戲裏面寫介面的編碼好像都上千....?我因為看不懂所以沒仔細看 曾經想要看看這個窗口分辨率是怎麼寫的,研究過怎麼改的問題,不過最後放棄了 因為我不止需要把所有地方的分辨率更改,還需要把窗口拉長到適合那個分辨率的大小...... 窗口分辨率是?我是用英文版RMVX,看不太懂。
寫程式碼根本不可能輕鬆了......... 這個系統是在任何情況下都能更換隊員的吧 只是目前看上去的話的確很不錯 只不過我更在意一點 像截圖那樣,以有四個戰鬥角色的組隊中 是否能成功把固定角色從固定劇情中加到可編輯的隊伍里 RPGVX的基本設定中隊伍人數最大為4,程式碼到底要怎麼把這個限制取消掉 怎麼樣把新加入隊伍的角色放到可更換的角色列表里........ 這個隨時隨地都可以更換戰鬥角色的系統能不能加入限制 讓固定角色按照劇情而無法從戰鬥隊伍中替換掉 (雖然我可以很乾脆的無視這部份,反正都在隊伍里,戰鬥中的劇情的話也照樣寫沒關係 所以這部份其實可以忽略,主要問題是更上面的。) 關於右下角的空視窗... 我在想, 不如把選擇隊員的窗口放到左下豎著,然後右邊(右下角)就做成顯示角色資料的窗口(這個大小比例我比較難說...) 左邊的窗口里,直接把可替換的角色的圖標變成點出來的角色圖,而不是頭像 不用名字也不用職業等任何說明,就只是一個人型 (按照普通RPG的想法,選中的角色的角色會自動表現走路的動作?) 然後選中了的角色的資料就在右下角里,變成這種感覺 名字 頭像 等級 經驗條/稱號(這個.......我不知道,稱號也可以,因為這個游戲裡沒有“職業”,所以拿稱號好玩?) ———————————————————————————————————————— 這邊空格就顯示詳細資料和裝備,這部份或許可以直接從菜單的Status裏面的畫面取? 不過,要寫成這樣的話肯定很麻煩了.... 而且我估計,根據圖片大小和人數來看,左下角一次表現的人數不是6個就是8個。 那麼很可能超越8個角色的情況中,或許需要寫自動滾軸。 以及,我不知道哪一種比較簡單了,以進入戰鬥隊伍的角色停留在那裡不消失,反而只是做上標記(當然是字母了,簡樸點寫個B在旁邊....Battle Member的意思?) 做個大遊戲沒有程序師還真是不行啊... [quote="好喝的茶"] 說起來,寫用戶介面真的很麻煩。 這個半製成品只有空殼,也有200行程式碼……[/quote] 我記得遊戲裏面寫介面的編碼好像都上千....?我因為看不懂所以沒仔細看 曾經想要看看這個窗口分辨率是怎麼寫的,研究過怎麼改的問題,不過最後放棄了 因為我不止需要把所有地方的分辨率更改,還需要把窗口拉長到適合那個分辨率的大小......
我目前弄了個半製成品,看看是不是黑獅想要的效果。 是的話我才繼續寫下去。 內建選單多出「隊伍」一項。 點進去是這樣子。左上角選擇指令,右上角顯示參戰角色的臉圖。 右下角的空視窗是備戰角色的名字清單。 不過我覺得這視窗太大,想把它縮小一點,在下面再放一個視窗,用來顯示角色的基本狀態,方便挑選。黑獅怎麼認為? 說起來,寫用戶介面真的很麻煩。 這個半製成品只有空殼,也有200行程式碼……
差不多就是這樣吧 戰鬥中替換戰鬥員...我是不太想 而至於加入后非不加入戰鬥的,因為製作上可能會變得很困難,難說我會從劇情下手 讓可以這樣加入隊伍而不參戰的角色和任何劇情扯不上關係 至於角色的數量 RPG製作大師的原始設定是,隊伍最大人數為4人,參戰最大人數為4人 可加入隊伍的角色最大應該是999或者無限制 至於我的故事里嘛.....暫時不打算給可以加入隊伍的角色做出上限 因為難說我會加入一些多餘的角色只幫助戰鬥或者其他非主線劇情?
黑獅所說的是不是這樣︰ 角色有三種程況︰沒有加入、加入但不參戰、加入而且參戰。 我腦內大概有個概念,要怎麼在非戰鬥的時候,替換參戰角色。 至於在戰鬥中替換……因為一直都在做非正統RPG的小遊戲,戰鬥系統的腳本我沒研究過。(汗) 不過我需要知道全遊戲約有多少個可加入角色, 隊伍可加入的最大人數。(無上限?)
可能的話我是不想要怪獸變成固定能力值的 如果要導入這個系統的話,還是全部都導入比較好 HP的增長不能刪除,刪除了的話攻擊和防禦上漲了,但是HP量太少還是很弱 而技能方面,除了BOSS以外大概沒有什麽會很特別的技能了 固定能力值和不固定能力值的敵人差太明顯 因為不固定能力值的敵人升級應該比普通的RPG要順暢很多,所以固定能力值的敵人 就算只是BOSS,也代表了BOSS會因為玩家的等級而變弱
百度狼吧百度动物漫画吧