设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2381|回复: 2
打印 上一主题 下一主题

[综合信息] 关于RMVX的SRPG2的扩张

[复制链接]

Lv1.梦旅人

梦石
0
星屑
195
在线时间
1194 小时
注册时间
2010-7-18
帖子
65
跳转到指定楼层
1
发表于 2012-6-9 10:48:31 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
各位前辈好,小弟日前发现了一个日站,
他做了不少关于hikimoki的SRPG2的相关ADD ON。

在此先分享网址给大家:http://ccwinter.blog.fc2.com/blog-category-5.html

但是关于"ユニット画像拡张1.02"这个脚本,
小弟却不知道该如何使用,
实际运作游戏会导致错误,
不晓得有没有前辈能成功使用这个脚本呢?
也请教教小弟吧!

Lv1.梦旅人

派大星

梦石
0
星屑
195
在线时间
2133 小时
注册时间
2011-9-18
帖子
2652
2
发表于 2012-6-11 00:22:06 | 只看该作者
进入这个网址需要挂代理,以下就是脚本内容了,会脚本的同学们能研究一下就好了。
RUBY 代码复制
  1. #==============================================================================
  2. # RGSS2_SRPG2拡張 ユニット画像拡張 ver1.02
  3. # 2012/03/26「歩行画像変化ステート」公開
  4. # 2012/04/29「ユニット画像拡張」公開 ver1.00
  5. #            敵メモ欄からのユニット画像指定機能を追加
  6. #            行動時のユニット画像変更機能を追加
  7. #            描画時の不具合を修正
  8. # 2012/05/07 通常マップでタイル画像のイベントがあるとエラーが出る不具合を修正
  9. # 2012/05/11 パターン数拡張機能を追加
  10. #            パターンのループ設定機能を追加
  11. # C Winter ([url]http://ccwinter.blog.fc2.com/[/url])
  12. #
  13. # ・「行動回数拡張 統合版」より上に入れてください
  14. #==============================================================================
  15.  
  16. #==============================================================================
  17. # ■ 設定項目
  18. #==============================================================================
  19. module TSRPG
  20.   #↓変更しないでください
  21.   ACTORS_ATTACK_GRAPHIC = []
  22.   ACTORS_GUARD_GRAPHIC = []
  23.   ACTORS_ITEM_GRAPHIC = []
  24.   for i in 1...1000 do ACTORS_ITEM_GRAPHIC[i] = [] end
  25.   #↑変更しないでください
  26.  
  27.   #「援軍用ユニット増殖」を併用するかどうか
  28.   USE_DUMMY_UNIT = false
  29.  
  30.   #アクター通常攻撃時の画像
  31.   ACTORS_ATTACK_GRAPHIC[1] = [nil]          #変更しない
  32.   ACTORS_ATTACK_GRAPHIC[999] = ["", 0]      #画像無し(透明)にする
  33.  
  34.   #アクター防御時の画像
  35.   ACTORS_GUARD_GRAPHIC[1] = [nil]           #変更しない
  36.   ACTORS_GUARD_GRAPHIC[999] = ["Actor1", 2] #画像変更
  37.  
  38.   #アクターアイテム使用時の画像
  39.   ACTORS_ITEM_GRAPHIC[1][1] = [nil]         #変更しない
  40.   ACTORS_ITEM_GRAPHIC[1][2] = ["", 0]       #画像無し(透明)にする
  41.   ACTORS_ITEM_GRAPHIC[1][3] = ["Actor1", 2] #画像変更
  42.   #997番のアクターがどのアイテムを使っても["Actor1", 2]
  43.   ACTORS_ITEM_GRAPHIC[997] = ["Actor1", 2]
  44.   #998番のアクターが1番のアイテムを使った時に["Actor1", 2]
  45.   ACTORS_ITEM_GRAPHIC[998][1] = ["Actor1", 2]
  46.   #999番のアクターが3番のアイテムを使った時は["Actor1", 2] それ以外なら["", 0]
  47.   for item_id in 1...1000 do ACTORS_ITEM_GRAPHIC[999][item_id] = ["", 0] end
  48.   ACTORS_ITEM_GRAPHIC[999][3] = ["Actor1", 2]   
  49. end
  50.  
  51. #==============================================================================
  52. # ■ Game_SrpgEvent
  53. #==============================================================================
  54. class Game_SrpgEvent < Game_Character
  55.   #--------------------------------------------------------------------------
  56.   # ● 公開インスタンス変数
  57.   #--------------------------------------------------------------------------
  58.   attr_reader   :state_character_name
  59.   attr_reader   :state_character_index
  60.   attr_reader   :skill_character_name
  61.   attr_reader   :skill_character_index
  62.   #--------------------------------------------------------------------------
  63.   # ● オブジェクト初期化
  64.   #--------------------------------------------------------------------------
  65.   alias change_graphic_initialize initialize
  66.   def initialize(map_id, event)
  67.     change_graphic_initialize(map_id, event)
  68.     @state_character_name  = ""
  69.     @state_character_index = -1
  70.     @skill_character_name  = nil
  71.     @skill_character_index = -1
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● ステート画像、自動エネミー画像の適用
  75.   #--------------------------------------------------------------------------
  76.   def state_change_graphic?
  77.     for state in unit.states
  78.       if state.note =~ /<ユニット画像=(\S+?),(\d+)>/i
  79.         @state_character_name  = $1
  80.         @state_character_index = $2.to_i
  81.         return true
  82.       end
  83.     end
  84.     if unit.is_a?(Game_Enemy) and $data_enemies[unit.enemy_id].note =~ /<ユニット画像=(\S+?),(\d+)>/i
  85.       @state_character_name  = $1
  86.       @state_character_index = $2.to_i
  87.       return true
  88.     end
  89.     @state_character_name  = ""
  90.     @state_character_index = -1
  91.     return false
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● スキル画像の適用
  95.   #--------------------------------------------------------------------------
  96.   def set_skill_graphic
  97.     #通常攻撃
  98.     if unit.action.attack?
  99.       if unit.is_a?(Game_Actor)
  100.         if TSRPG::ACTORS_ATTACK_GRAPHIC[unit.id] != nil
  101.           @skill_character_name = TSRPG::ACTORS_ATTACK_GRAPHIC[unit.id][0]
  102.           @skill_character_index = TSRPG::ACTORS_ATTACK_GRAPHIC[unit.id][1]
  103.         end
  104.       elsif unit.is_a?(Game_Enemy)
  105.         if $data_enemies[unit.enemy_id].note =~ /<攻撃画像=(\S+?),(\d+)>/i
  106.           @skill_character_name = $1 == "\"\"" ? "" : $1
  107.           @skill_character_index = $2.to_i
  108.         end
  109.       end
  110.     #防御かスキル
  111.     elsif unit.action.skill?
  112.       #防御
  113.       if unit.action.skill_id == 3
  114.         if unit.is_a?(Game_Actor)
  115.           if TSRPG::ACTORS_GUARD_GRAPHIC[unit.id] != nil
  116.             @skill_character_name = TSRPG::ACTORS_GUARD_GRAPHIC[unit.id][0]
  117.             @skill_character_index = TSRPG::ACTORS_GUARD_GRAPHIC[unit.id][1]
  118.           end
  119.         elsif unit.is_a?(Game_Enemy)
  120.           if $data_enemies[unit.enemy_id].note =~ /<防御画像=(\S+?),(\d+)>/i
  121.             @skill_character_name = $1 == "\"\"" ? "" : $1
  122.             @skill_character_index = $2.to_i
  123.           end
  124.         end
  125.       #スキル
  126.       elsif unit.action.obj.note =~ /<スキル画像=(\S+?),(\d+)>/i
  127.         @skill_character_name = $1 == "\"\"" ? "" : $1
  128.         @skill_character_index = $2.to_i
  129.       end
  130.     #味方のみ アイテム
  131.     elsif unit.action.item?
  132.       list = TSRPG::ACTORS_ITEM_GRAPHIC[unit.id]
  133.       if list[0].is_a?(String)              #サンプル アクター998
  134.         @skill_character_name = list[0]
  135.         @skill_character_index = list[1]
  136.       elsif list[unit.action.obj.id] != nil #サンプル アクター999
  137.         @skill_character_name = list[unit.action.obj.id][0]
  138.         @skill_character_index = list[unit.action.obj.id][1]
  139.       end
  140.     end
  141.     @pattern = 0 if @skill_character_name != nil #コマ数をリセット
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● スキル画像の終了
  145.   #--------------------------------------------------------------------------
  146.   def reset_skill_graphic
  147.     @skill_character_name = nil
  148.     @skill_character_index = -1
  149.   end
  150.   #--------------------------------------------------------------------------
  151.   # ● 歩行画像の変更
  152.   #--------------------------------------------------------------------------
  153.   def graphic_mode
  154.     return 0 if unit == nil #ユニットではない場合
  155.     if TSRPG::USE_DUMMY_UNIT and @dummy           #ダミーユニット
  156.       return 3 if @dummy_dead                     #死亡後の場合
  157.       return 2 if @skill_character_name != nil    #生存中・スキル画像の場合
  158.       return 1 if state_change_graphic?           #生存中・変更ステートの場合
  159.       return 0  #生存中・非スキル画像・非変更ステートの場合
  160.     else                                          #真ユニット
  161.       return 0 if $game_self_switches[[@map_id, @id, "D"]] == true #死亡後の場合
  162.       return 2 if @skill_character_name != nil    #生存中・スキル画像の場合
  163.       return 1 if state_change_graphic?           #生存中・変更ステートの場合
  164.       return 0  #生存中・非スキル画像・非変更ステートの場合
  165.     end
  166.   end
  167. end
  168. #==============================================================================
  169. # ■ Scene_Srpg
  170. #==============================================================================
  171. class Scene_Srpg < Scene_Base
  172.   #--------------------------------------------------------------------------
  173.   # ● 行動の実行
  174.   #update1.003
  175.   #update1.012
  176.   #update1.0121
  177.   #--------------------------------------------------------------------------
  178.   def execute_action(x, y)
  179.     # 攻撃可能セルが選択されていなければ終了
  180.     unless @attack_cell.include?([x, y])
  181.       Sound.play_buzzer
  182.       return
  183.     end
  184.     # 現在の効果範囲上に生きている誰かがいれば実行
  185.     @action_result_exp = 0
  186.     @action_result_item.clear
  187.     @action_result_gold = 0
  188.     targets = []                        # ターゲットの配列を作成
  189.     @coop_unit_list = []
  190.     for pos in @effect_cell
  191.       event = $game_srpg.target_xy(x + pos[0], y + pos[1])[0]
  192.       targets.push(event) if event != nil
  193.     end
  194.     obj = @event.unit.action.obj
  195.     if obj.is_a?(RPG::BaseItem) and obj.dual? # 連続攻撃なら同じターゲットを追加
  196.       targets += targets
  197.     end
  198.     if targets.empty?   # ターゲットがいない
  199.       Sound.play_buzzer
  200.       @message_mini_window.refresh("ターゲットが見つかりません", 60)
  201.       return
  202.     end
  203.     @event.turn_cell(x, y)              # 攻撃する方向を向く
  204.  
  205.     @event.set_skill_graphic
  206.     if @event.unit.action.attack?       # 通常攻撃
  207.       level = execute_action_attack(targets)
  208.     elsif @event.unit.action.skill?     # スキル
  209.       if @event.unit.action.skill_id == 3 # 防御
  210.         wait(30)  #画像変更を見やすくするためウェイト
  211.         $game_srpg.add_popup(@event.real_x, @event.real_y, sprintf("防御"), Color.new(255, 255, 255), 1)
  212.       end
  213.       level = execute_action_obj(targets)
  214.     elsif @event.unit.action.item?      # アイテム
  215.       level = execute_action_obj(targets)
  216.     end
  217.     @event.reset_skill_graphic
  218.  
  219.     @event.action_end = true              # 行動済みフラグを立てる
  220.     unless $game_srpg.enemy_turn?         # 味方ターン限定の処理
  221.       $game_srpg.scene_state = 0            # ニュートラルへ移行する
  222.       @status_window.refresh($game_srpg.alive_unit_xy(x, y))  # ステータスウィンドウの再描画
  223.     end
  224.     unless @event.enemy_flag              # 味方行動時限定の処理
  225.       for event in @coop_unit_list          # 協力攻撃者も経験値取得
  226.         next if event.enemy_flag
  227.         exp = @action_result_exp + event.unit.action_exp
  228.         exp = [exp + exp * (level - event.unit.level) * 10 / 100, 1].max
  229.         event.unit.gain_exp(exp / 2 + 1, true)
  230.         event.unit.gain_job_exp(exp, true) if $include_tjex
  231.         text = sprintf("EXP+%d", exp / 2 + 1)
  232.         $game_srpg.add_popup(event.real_x, event.real_y, text, Color.new(255, 255, 255), 1)
  233.       end
  234.       exp = @action_result_exp + @event.unit.action_exp
  235.       exp = [exp + exp * (level - @event.unit.level) * 10 / 100, 1].max
  236.       @event.unit.gain_exp(exp, true)
  237.       @event.unit.gain_job_exp(exp, true) if $include_tjex
  238.       text = sprintf("EXP+%d", exp)
  239.       $game_srpg.add_popup(@event.real_x, @event.real_y, text, Color.new(255, 255, 255), 1)
  240.     end
  241.     if @action_result_gold > 0        # お金の取得
  242.       $game_party.gain_gold(@action_result_gold)
  243.       text = sprintf(Vocab::ObtainGold, @action_result_gold, Vocab::gold)
  244.       $game_message.texts.push(text)
  245.     end
  246.     if @action_result_item.size > 0   # アイテムの取得
  247.       for item in @action_result_item
  248.         $game_party.gain_item(item, 1)
  249.         text = sprintf(Vocab::ObtainItem, item.name)
  250.         $game_message.texts.push(text)
  251.       end
  252.     end
  253.     wait_for_message
  254.   end
  255. end
  256. #==============================================================================
  257. # ■ Sprite_Character
  258. #==============================================================================
  259. class Sprite_Character < Sprite_Base
  260.   #--------------------------------------------------------------------------
  261.   # ● 転送元ビットマップの更新
  262.   #--------------------------------------------------------------------------
  263.   def update_bitmap
  264.     if @character.is_a?(Game_SrpgEvent)
  265.       if @character.graphic_mode > 0
  266.         case @character.graphic_mode
  267.         when 3  #ダミーユニット死亡後の場合
  268.           if @character_name != ""
  269.             @character_name = ""
  270.             self.bitmap = Cache.character("")
  271.           end
  272.           return
  273.         when 2  #スキル画像変更中の場合
  274.           name = @character.skill_character_name
  275.           index = @character.skill_character_index
  276.         when 1  #ステート画像変更中の場合
  277.           name = @character.state_character_name
  278.           index = @character.state_character_index
  279.         end
  280.         if @character_name != name or @character_index != index
  281.           @character_name = name
  282.           @character_index = index
  283.           self.bitmap = Cache.character(@character_name)
  284.           sign = @character_name[/^[\!\$]./]
  285.           max_pattern = @character_name =~ /{p=(\d+)}/i ? $1.to_i : 3
  286.           if sign != nil and sign.include?('$')
  287.             @cw = bitmap.width / max_pattern
  288.             @ch = bitmap.height / 4
  289.           else
  290.             @cw = bitmap.width / (max_pattern * 4)
  291.             @ch = bitmap.height / 8
  292.           end
  293.           self.ox = @cw / 2
  294.           self.oy = @ch
  295.         end
  296.         return
  297.       end
  298.     end
  299.  
  300.     if @tile_id != @character.tile_id or
  301.        @character_name != @character.character_name or
  302.        @character_index != @character.character_index
  303.       @tile_id = @character.tile_id
  304.       @character_name = @character.character_name
  305.       @character_index = @character.character_index
  306.       if @tile_id > 0
  307.         sx = (@tile_id / 128 % 2 * 8 + @tile_id % 8) * 32;
  308.         sy = @tile_id % 256 / 8 % 16 * 32;
  309.         self.bitmap = tileset_bitmap(@tile_id)
  310.         self.src_rect.set(sx, sy, 32, 32)
  311.         self.ox = 16
  312.         self.oy = 32
  313.       else
  314.         self.bitmap = Cache.character(@character_name)
  315.         sign = @character_name[/^[\!\$]./]
  316.         max_pattern = @character_name =~ /{p=(\d+)}/i ? $1.to_i : 3
  317.         if sign != nil and sign.include?('$')
  318.           @cw = bitmap.width / max_pattern
  319.           @ch = bitmap.height / 4
  320.         else
  321.           @cw = bitmap.width / (max_pattern * 4)
  322.           @ch = bitmap.height / 8
  323.         end
  324.         self.ox = @cw / 2
  325.         self.oy = @ch
  326.       end
  327.     end
  328.   end
  329.   #--------------------------------------------------------------------------
  330.   # ● 転送元矩形の更新
  331.   #--------------------------------------------------------------------------
  332.   def update_src_rect
  333.     return if @tile_id != 0 and
  334.               (@character.is_a?(Game_Event) or @character.graphic_mode == 0)
  335.     index = @character_index
  336.     if @character.set_graphic_option?
  337.       pattern = @character.pattern
  338.     else
  339.       pattern = @character.pattern < 3 ? @character.pattern : 1
  340.     end
  341.     sx = (index % 4 * 3 + pattern) * @cw
  342.     sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch
  343.     self.src_rect.set(sx, sy, @cw, @ch)
  344.   end
  345. end
  346. #==============================================================================
  347. # ■ Scene_Map
  348. #==============================================================================
  349. class Scene_Map < Scene_Base
  350.   #--------------------------------------------------------------------------
  351.   # ● 開始処理
  352.   #--------------------------------------------------------------------------
  353.   alias graphic_option_start start
  354.   def start
  355.     graphic_option_start
  356.     $game_player.refresh
  357.     $game_player.straighten
  358.   end
  359. end
  360.  
  361. #==============================================================================
  362. # ■ Game_Player
  363. #==============================================================================
  364. class Game_Player
  365.   #--------------------------------------------------------------------------
  366.   # ● リフレッシュ
  367.   #--------------------------------------------------------------------------
  368.   alias ex_pattern_refresh refresh
  369.   def refresh
  370.     ex_pattern_refresh
  371.     @original_pattern = set_graphic_option? ? 0 : 1
  372.   end
  373. end
  374. #==============================================================================
  375. # ■ Game_Character
  376. #==============================================================================
  377. class Game_Character
  378.   #--------------------------------------------------------------------------
  379.   # ● どちらかの処理が設定されているかどうか
  380.   #--------------------------------------------------------------------------
  381.   def set_graphic_option?
  382.     return true if @character_name =~ /{p=(\d+)}/i
  383.     return true if @character_name =~ /{l=(\d+)}/i
  384.     return false
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● 姿勢の矯正
  388.   #--------------------------------------------------------------------------
  389.   def straighten
  390.     if @walk_anime or @step_anime
  391.       @pattern = set_graphic_option? ? 0 : 1
  392.     end
  393.     @anime_count = 0
  394.   end
  395.   #--------------------------------------------------------------------------
  396.   # ● アニメカウントの更新
  397.   #--------------------------------------------------------------------------
  398.   def update_animation
  399.     speed = @move_speed + (dash? ? 1 : 0)
  400.     if @anime_count > 18 - speed * 2
  401.       if not @step_anime and @stop_count > 0
  402.         @pattern = @original_pattern
  403.       else
  404.         if @character_name =~ /{l=(\d+)}/i
  405.           loop = $1.to_i
  406.           max_pattern = @character_name =~ /{p=(\d+)}/i ? $1.to_i : 3
  407.         else
  408.           loop = 1
  409.           max_pattern = @character_name =~ /{p=(\d+)}/i ? $1.to_i : 4
  410.         end
  411.         if (@pattern + 1) >= max_pattern
  412.           @pattern = loop - 1
  413.         else
  414.           @pattern = @pattern + 1
  415.         end
  416.       end
  417.       @anime_count = 0
  418.     end
  419.   end
  420. end
  421. #==============================================================================
  422. # ■ Game_SrpgEvent
  423. #==============================================================================
  424. class Game_SrpgEvent < Game_Character
  425.   #--------------------------------------------------------------------------
  426.   # ● どちらかの処理が設定されているかどうか
  427.   #--------------------------------------------------------------------------
  428.   def set_graphic_option?
  429.     case graphic_mode
  430.     when 0
  431.       name = @character_name
  432.     when 1
  433.       name = @state_character_name
  434.     when 2
  435.       name = @skill_character_name
  436.     when 3
  437.       name = ""
  438.     end
  439.     return true if name =~ /{p=(\d+)}/i
  440.     return true if name =~ /{l=(\d+)}/i
  441.     return false
  442.   end
  443.   #--------------------------------------------------------------------------
  444.   # ● アニメカウントの更新
  445.   #--------------------------------------------------------------------------
  446.   def update_animation
  447.     speed = @move_speed + (dash? ? 1 : 0)
  448.     if @anime_count > 18 - speed * 2
  449.       if not @step_anime and @stop_count > 0
  450.         @pattern = @original_pattern
  451.       else
  452.         case graphic_mode
  453.         when 0
  454.           name = @character_name
  455.         when 1
  456.           name = @state_character_name
  457.         when 2
  458.           name = @skill_character_name
  459.         when 3
  460.           name = ""
  461.         end
  462.         if name =~ /{l=(\d+)}/i
  463.           loop = $1.to_i
  464.           max_pattern = name =~ /{p=(\d+)}/i ? $1.to_i : 3
  465.         else
  466.           loop = 1
  467.           max_pattern = name =~ /{p=(\d+)}/i ? $1.to_i : 4
  468.         end
  469.         if (@pattern + 1) >= max_pattern
  470.           @pattern = loop - 1
  471.         else
  472.           @pattern = @pattern + 1
  473.         end
  474.       end
  475.       @anime_count = 0
  476.     end
  477.   end
  478. end
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
842
在线时间
396 小时
注册时间
2008-1-1
帖子
84
3
发表于 2012-6-12 11:39:29 | 只看该作者
其實這個站的SRPG腳本做得很好
很適合做曹操傳一類的遊戲
鄙人曾經拿來做遊戲
不過最後有致命BUG而放棄工程
可惜就是沒有RGSS3的版本XD
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 03:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表