| 赞 | 0  | 
 
| VIP | 1 | 
 
| 好人卡 | 11 | 
 
| 积分 | 1 | 
 
| 经验 | 17928 | 
 
| 最后登录 | 2018-9-22 | 
 
| 在线时间 | 461 小时 | 
 
 
 
 
 
Lv1.梦旅人 
	- 梦石
 - 0 
 
        - 星屑
 - 55 
 
        - 在线时间
 - 461 小时
 
        - 注册时间
 - 2008-11-19
 
        - 帖子
 - 607
 
 
 
 | 
	
 本帖最后由 sai90306 于 2012-3-19 17:26 编辑  
 
概念是這樣的 
假設在第 i 個地圖上第 j 個事件 (簡稱第ij事件)是一個可以讓角色k進入隊伍的事件 
若希望能夠將這第ij個事件對應到角色k 
使得在用離隊選項使角色k離隊的同時 將第ij事件移動(moveto)到當下的主角位置 譬如第i+1個地圖上的座標(x,y)=(123,123) 
這樣就能夠實現角色離隊時原本能夠使角色入隊的事件出現在當下的主角位置上 
請問要如何修改呢?謝謝大神們不吝賜教!! 
 
 
這是我借用的離隊腳本 
#============================================================================== 
# ■ Scene_Menu 
#------------------------------------------------------------------------------ 
#  處理功能表畫面的類。 
#============================================================================== 
 
class Scene_Menu 
#-------------------------------------------------------------------------- 
# ● 初始化對像 
#     menu_index : 命令游標的初期位置 
#-------------------------------------------------------------------------- 
def initialize(menu_index = 0) 
   @menu_index = menu_index 
end 
#-------------------------------------------------------------------------- 
# ● 主處理 
#-------------------------------------------------------------------------- 
def main 
   # 生成命令窗口 
   s1 = $data_system.words.item 
   s2 = $data_system.words.skill 
   s3 = $data_system.words.equip 
   s4 = "狀態" 
   s5 = "存檔" 
   s6 = "結束遊戲" 
   s7 = "離隊" 
   @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) 
   @command_window.index = @menu_index 
   # 同伴人數為 0 的情況下 
   if $game_party.actors.size == 0 
     # 物品、特技、裝備、狀態無效化 
     @command_window.disable_item(0) 
     @command_window.disable_item(1) 
     @command_window.disable_item(2) 
     @command_window.disable_item(3) 
   end 
   if $game_switches[1] 
     @command_window.disable_item(6) 
     end 
   # 禁止存檔的情況下 
   if $game_system.save_disabled 
     # 存檔無效 
     @command_window.disable_item(4) 
   end 
   # 生成遊戲時間窗口 
   @playtime_window = Window_PlayTime.new 
   @playtime_window.x = 0 
   @playtime_window.y = 320 
   # 生成步數窗口 
   #@steps_window = Window_Steps.new 
   #@steps_window.x = 0 
   #@steps_window.y = 320 
   # 生成金錢窗口 
   @gold_window = Window_Gold.new 
   @gold_window.x = 0 
   @gold_window.y = 416 
   # 生成狀態窗口 
   @status_window = Window_MenuStatus.new 
   @status_window.x = 160 
   @status_window.y = 0 
   # 執行過渡 
   Graphics.transition 
   # 主循環 
   loop do 
     # 刷新遊戲畫面 
     Graphics.update 
     # 刷新輸入資訊 
     Input.update 
     # 刷新畫面 
     update 
     # 如果切換畫面就中斷循環 
     if $scene != self 
       break 
     end 
   end 
   # 準備過渡 
   Graphics.freeze 
   # 釋放窗口 
   @command_window.dispose 
   @playtime_window.dispose 
   #@steps_window.dispose 
   @gold_window.dispose 
   @status_window.dispose 
end 
#-------------------------------------------------------------------------- 
# ● 刷新畫面 
#-------------------------------------------------------------------------- 
def update 
   # 刷新窗口 
   @command_window.update 
   @playtime_window.update 
   #@steps_window.update 
   @gold_window.update 
   @status_window.update 
   # 命令窗口被激活的情況下: 調用 update_command 
   if @command_window.active 
     update_command 
     return 
   end 
   # 狀態窗口被激活的情況下: 調用 update_status 
   if @status_window.active 
     update_status 
     return 
   end 
end 
#-------------------------------------------------------------------------- 
# ● 刷新畫面 (命令窗口被激活的情況下) 
#-------------------------------------------------------------------------- 
def update_command 
   # 按下 B 鍵的情況下 
   if Input.trigger?(Input::B) 
     # 演奏取消 SE 
     $game_system.se_play($data_system.cancel_se) 
     # 切換的地圖畫面 
     $scene = Scene_Map.new 
     return 
   end 
   # 按下 C 鍵的情況下 
   if Input.trigger?(Input::C) 
     # 同伴人數為 0、存檔、遊戲結束以外的場合 
     if $game_party.actors.size == 0 and @command_window.index < 4 
       # 演奏凍結 SE 
       $game_system.se_play($data_system.buzzer_se) 
       return 
     end 
     # 命令窗口的游標位置分支 
     case @command_window.index 
     when 0  # 物品 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 切換到物品畫面 
       $scene = Scene_Item.new 
     when 1  # 特技 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 激活狀態窗口 
       @command_window.active = false 
       @status_window.active = true 
       @status_window.index = 0 
     when 2  # 裝備 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 激活狀態窗口 
       @command_window.active = false 
       @status_window.active = true 
       @status_window.index = 0 
     when 3  # 狀態 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 激活狀態窗口 
       @command_window.active = false 
       @status_window.active = true 
       @status_window.index = 0 
     when 4  # 存檔 
       # 禁止存檔的情況下 
       if $game_system.save_disabled 
         # 演奏凍結 SE 
         $game_system.se_play($data_system.buzzer_se) 
         return 
       end 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 切換到存檔畫面 
       $scene = Scene_Save.new 
     when 5  # 遊戲結束 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 切換到遊戲結束畫面 
       $scene = Scene_End.new 
     when 6 
       if $game_switches[1] 
         $game_system.se_play($data_system.buzzer_se) 
       else 
       $game_system.se_play($data_system.decision_se) 
       @command_window.active = false 
       @status_window.active = true 
       @status_window.index = 0 
       end 
     end 
     return 
   end 
end 
#-------------------------------------------------------------------------- 
# ● 刷新畫面 (狀態窗口被激活的情況下) 
#-------------------------------------------------------------------------- 
def update_status 
   # 按下 B 鍵的情況下 
   if Input.trigger?(Input::B) 
     # 演奏取消 SE 
     $game_system.se_play($data_system.cancel_se) 
     # 激活命令窗口 
     @command_window.active = true 
     @status_window.active = false 
     @status_window.index = -1 
     return 
   end 
   # 按下 C 鍵的情況下 
   if Input.trigger?(Input::C) 
     # 命令窗口的游標位置分支 
     case @command_window.index 
     when 1  # 特技 
       # 本角色的行動限制在 2 以上的情況下 
       if $game_party.actors[@status_window.index].restriction >= 2 
         # 演奏凍結 SE 
         $game_system.se_play($data_system.buzzer_se) 
         return 
       end 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 切換到特技畫面 
       $scene = Scene_Skill.new(@status_window.index) 
     when 2  # 裝備 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 切換的裝備畫面 
       $scene = Scene_Equip.new(@status_window.index) 
     when 3  # 狀態 
       # 演奏確定 SE 
       $game_system.se_play($data_system.decision_se) 
       # 切換到狀態畫面 
       $scene = Scene_Status.new(@status_window.index) 
     when 6 
      if @status_window.index == 0 
       $game_system.se_play($data_system.buzzer_se) 
     else 
       @actor = $game_party.actors[@status_window.index] 
       if  @actor.id == 7 
         $game_system.se_play($data_system.buzzer_se) 
       else 
          $game_system.se_play($data_system.decision_se) 
       $game_party.actors.delete(@actor) 
       $game_player.refresh 
       $scene = Scene_Menu.new(6) 
       end 
       end 
     end 
     return 
   end 
end 
end  
 
 
猜是要修改這個部分... 
     when 6 
      if @status_window.index == 0 
       $game_system.se_play($data_system.buzzer_se) 
     else 
       @actor = $game_party.actors[@status_window.index] 
       if  @actor.id == 7 
         $game_system.se_play($data_system.buzzer_se) 
       else 
          $game_system.se_play($data_system.decision_se) 
       $game_party.actors.delete(@actor) 
       $game_player.refresh 
       $scene = Scene_Menu.new(6) 
       end 
       end 
     end  
 
在 
$scene = Scene_Menu.new(6) 
下一行加入...(假設用$game_variables[1000+j]的0,1,2位置分別對應第0~50個角色的map_id,x,y) 
 for j in 0..50 
$game_variables[1000+j][0] = $game_map.map_id 
$game_variables[1000+j][1] = $game_player.x 
$game_variables[1000+j][2] = $game_player.y 
$game_map.events[map].moveto($game_variables[1000+j][1],$game_variables[1000+j][2]) 
$game_map.events[map].refresh 
   if $game_variables[1000 + j][0] == @map_id 
     @events[1000+ j].moveto($game_variables[1000 + j][1], $game_variables[1000 + j][2]) 
     @events[1000+ j].refresh 
   end 
以上是我研究某遊戲(R.J.0.7.9.7.6.6)的魔方陣腳本所猜測的改法 
另外還有一個command_window.draw_item指令不知道需要用上... 
畢竟我對於腳本我只略知一二...可能改出了什麼不知所云的怪物也不一定@@ 
所以麻煩大神們幫忙了! |   
 
 
 
 |