幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 3072|回复: 13

[RM2K&2K3] 好吧。。那个纵向脚本的问题。。。。。

[复制链接]

19

主题

98

帖子

777

积分

⑤进阶

积分
777
发表于 2008-9-21 01:59:56 | 显示全部楼层 |阅读模式
关于昨天的那个脚本貌似有问题。。。。

错误如下:



看了半天意义不明,一按战斗就弹出来的。。。



脚本预览猛击此处
回复

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2008-9-21 06:45:28 | 显示全部楼层
怎么还有可能发生的位置???我的报错怎么从来没有这么人性化
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2008-9-21 07:15:00 | 显示全部楼层
默认的脚本没定义这个玩意。。。当然会这样。。。。

自己定义下。。搞搞坐标
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2008-9-21 07:29:34 | 显示全部楼层
阿。。。和我的估计一样。。。STR 是 几个放一块用的。。。screen_x是别的脚本定义的。。。


  1. #==============================================================================
  2. # ★RGSS2
  3. # STR11a_XP風バトル#バトラー v1.2 08/01/22
  4. # サポート:[url]http://otsu.cool.ne.jp/strcatyou/[/url]
  5. # ・戦闘画面にXP風にバトラーを表示。
  6. #  →Battlersフォルダに、
  7. #  "アクターのフェイスグラフィック"+"_"+"フェイスインデックス"と
  8. #  同名のファイルをインポートしておく必要があります。
  9. # (例)
  10. # ファイスグラフィック名がface00、
  11. # フェイスインデックスが5の場合、
  12. # ファイル名は "face00_5" となります。
  13. #
  14. #  □フェイスインデックスの割り当て図
  15. #  0123
  16. #  4567
  17. #
  18. # ・基準位置が画面のアニメーションの座標補整機能が実装されました。
  19. # ・アニメーションスピード調整機能追加。
  20. # ・従来のようにウィンドウ表示が可能に。
  21. #
  22. #------------------------------------------------------------------------------
  23. #
  24. # 更新履歴
  25. # ◇1.1f→1.2
  26. # バトラー座標の位置変更
  27. # ◇1.1→1.1f
  28. # フラッシュの処理を入れ忘れていたのを修正
  29. #
  30. #==============================================================================
  31. # ■ STRRGSS2(設定箇所)
  32. #==============================================================================
  33. module STRRGSS2
  34.   # 基準位置が画面のアニメーションの座標修正 true = 有効 false = 無効
  35.   BT_ANIME = true
  36.   # 補整が有効な場合のY座標修正
  37.   BT_ANIME_SY = 128
  38.   # アニメスピード 1 以上の整数 (参考) 2で2倍速、4で標準速
  39.   ANIME_SPEED = 4
  40.   
  41.   # アクターバックウィンドウを表示
  42.   ABWINDOW = true
  43.   # ウィンドウの方式 0 = ウィンドウスキン 1 = グラデーション
  44.   ABW_TYPE = 1
  45.   # ウィンドウ矩形
  46.   ABW_RECT = Rect.new(0, 0, 544, 128)
  47.   # ウィンドウの座標
  48.   ABW_X = 0
  49.   ABW_Y = 416 - 128
  50.   # ウィンドウ幅
  51.   ABW_W = 544
  52.   ABW_H = 128
  53.   # グラデーションのカラー [上,下]
  54.   ABW_C = [Color.new(0,0,0,0), Color.new(0,0,0,160)]
  55.   @a_back_sprite = Sprite.new(@viewport1)
  56. end
  57. #==============================================================================
  58. # ■ Game_Actor
  59. #==============================================================================
  60. class Game_Actor < Game_Battler
  61.   # バトラーグラフィックを表示
  62.   A_BATTLER = true # falseにすると画像を用意しなくても動作するようになります
  63.   # バトラーX座標修正
  64.   A_BATTLER_SX = -4
  65.   # バトラー座標
  66.   # Z座標
  67.   SCREEN_Z = 120
  68.   def set_b_xy(id)
  69.     w = 544 / $game_party.members.size
  70.     # X座標
  71.     x = (544 / 2) - (($game_party.actors.size - 1) * (w / 2))
  72.     m = $game_party.actors
  73.     x += (m.index(id) * w) + A_BATTLER_SX
  74.     @screen_x = x
  75.     # Y座標
  76.     @screen_y = 416 - 30
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 公開インスタンス変数
  80.   #--------------------------------------------------------------------------
  81.   attr_accessor :screen_x                 # バトル画面 X 座標
  82.   attr_accessor :screen_y                 # バトル画面 Y 座標
  83.   #--------------------------------------------------------------------------
  84.   # ● バトル画面 Z 座標の取得
  85.   #--------------------------------------------------------------------------
  86.   def screen_z
  87.     set_b_xy(@actor_id)
  88.     return SCREEN_Z
  89.   end
  90.   #--------------------------------------------------------------------------
  91.   # ★ エイリアス
  92.   #--------------------------------------------------------------------------
  93.   alias setup_str11 setup
  94.   def setup(actor_id)
  95.     setup_str11(actor_id)
  96.     @screen_x = 0
  97.     @screen_y = 0
  98.     @battler_name = @face_name + "_" + @face_index.to_s
  99.     @battler_name = "" unless A_BATTLER
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # ★ 再定義
  103.   #--------------------------------------------------------------------------
  104.   def use_sprite?
  105.     return true # 使う
  106.   end
  107. end
  108. #==============================================================================
  109. # ■ Sprite_Battler
  110. #==============================================================================
  111. class Sprite_Battler < Sprite_Base
  112.   #--------------------------------------------------------------------------
  113.   # ● 新しいエフェクトの設定
  114.   #--------------------------------------------------------------------------
  115.   alias setup_new_effect_str11a setup_new_effect
  116.   def setup_new_effect
  117.     if @battler.white_flash
  118.       @effect_type = WHITEN
  119.       @effect_duration = 16
  120.       @battler.white_flash = false
  121.     end
  122.     if @battler.animation_id != 0
  123.       animation = $data_animations[@battler.animation_id]
  124.       mirror = @battler.animation_mirror
  125.       sy = @battler.animation_sy
  126.       start_animation(animation, mirror, sy)
  127.       @battler.animation_id = 0
  128.       @battler.animation_sy = 0
  129.     end
  130.     setup_new_effect_str11a
  131.   end
  132. end
  133. #==============================================================================
  134. # ■ Sprite_Base
  135. #==============================================================================
  136. class Sprite_Base < Sprite
  137.   # 解像度
  138.   DISPLAY_W = 544
  139.   DISPLAY_H = 416
  140.   #--------------------------------------------------------------------------
  141.   # ★ 再定義の嵐
  142.   #--------------------------------------------------------------------------
  143.   def update
  144.     super
  145.     if @animation != nil
  146.       @animation_duration -= 1
  147.       if @animation_duration % STRRGSS2::ANIME_SPEED == 0
  148.         update_animation
  149.       end
  150.     end
  151.     @@animations.clear
  152.   end
  153.   alias start_animation_str11a start_animation
  154.   def start_animation(animation, mirror = false, sy = 0)
  155.     start_animation_str11a(animation, mirror)
  156.     if @animation.position == 3
  157.       if viewport == nil
  158.         @animation_ox = DISPLAY_W / 2
  159.         @animation_oy = (DISPLAY_H / 2) + sy
  160.       else
  161.         @animation_ox = viewport.rect.width / 2
  162.         @animation_oy = (viewport.rect.height / 2) + sy
  163.       end
  164.     end
  165.     @animation_duration = @animation.frame_max * STRRGSS2::ANIME_SPEED + 1
  166.   end
  167.   def update_animation
  168.     if @animation_duration > 0
  169.       frame_index = @animation.frame_max - (@animation_duration + (STRRGSS2::ANIME_SPEED-1)) / STRRGSS2::ANIME_SPEED
  170.       animation_set_sprites(@animation.frames[frame_index])
  171.       for timing in @animation.timings
  172.         if timing.frame == frame_index
  173.           animation_process_timing(timing)
  174.         end
  175.       end
  176.     else
  177.       dispose_animation
  178.     end
  179.   end
  180.   def animation_process_timing(timing)
  181.     timing.se.play
  182.     case timing.flash_scope
  183.     when 1
  184.       self.flash(timing.flash_color, timing.flash_duration * STRRGSS2::ANIME_SPEED)
  185.     when 2
  186.       if viewport != nil
  187.         viewport.flash(timing.flash_color, timing.flash_duration * STRRGSS2::ANIME_SPEED)
  188.       end
  189.     when 3
  190.       self.flash(nil, timing.flash_duration * STRRGSS2::ANIME_SPEED)
  191.     end
  192.   end
  193. end
  194. #==============================================================================
  195. # ■ Spriteset_Battle
  196. #==============================================================================
  197. class Spriteset_Battle
  198.   #--------------------------------------------------------------------------
  199.   # ● アクタースプライトの作成
  200.   #--------------------------------------------------------------------------
  201.   def create_actors
  202.     @actor_sprites = []
  203.     for actor in $game_party.members.reverse
  204.       @actor_sprites.push(Sprite_Battler.new(@viewport1, actor))
  205.     end
  206.     # アクターバックウィンドウ
  207.     if STRRGSS2::ABW_TYPE == 1
  208.       @a_back_sprite = Sprite.new(@viewport1)
  209.       c = STRRGSS2::ABW_C
  210.       rect = STRRGSS2::ABW_RECT
  211.       v = true
  212.       bitmap = Bitmap.new(STRRGSS2::ABW_W, STRRGSS2::ABW_H)
  213.       bitmap.gradient_fill_rect(rect, c[0], c[1], v)
  214.       @a_back_sprite.bitmap = bitmap
  215.       @a_back_sprite.x = STRRGSS2::ABW_X
  216.       @a_back_sprite.y = STRRGSS2::ABW_Y
  217.     else
  218.       rect = STRRGSS2::ABW_RECT
  219.       x = STRRGSS2::ABW_X + rect.x
  220.       y = STRRGSS2::ABW_Y + rect.y
  221.       @a_back_sprite = Window_Base.new(x, y, rect.width, rect.height)
  222.       @a_back_sprite.viewport = @viewport1
  223.     end
  224.     @a_back_sprite.z = 110
  225.     @a_back_sprite.visible = STRRGSS2::ABWINDOW
  226.   end
  227.   #--------------------------------------------------------------------------
  228.   # ● アクタースプライトの更新
  229.   #--------------------------------------------------------------------------
  230.   def update_actors
  231.     for sprite in @actor_sprites
  232.       sprite.update
  233.     end
  234.   end
  235.   #--------------------------------------------------------------------------
  236.   # ● アクタースプライトの解放
  237.   #--------------------------------------------------------------------------
  238.   def dispose_actors
  239.     for sprite in @actor_sprites
  240.       sprite.dispose
  241.     end
  242.     if STRRGSS2::ABW_TYPE == 1
  243.       @a_back_sprite.bitmap.dispose
  244.     end
  245.     @a_back_sprite.dispose
  246.   end
  247. end
  248. #==============================================================================
  249. # ■ Game_Battler
  250. #==============================================================================
  251. class Game_Battler
  252.   #--------------------------------------------------------------------------
  253.   # ● 公開インスタンス変数
  254.   #--------------------------------------------------------------------------
  255.   attr_accessor :animation_sy
  256.   #--------------------------------------------------------------------------
  257.   # ★ エイリアス
  258.   #--------------------------------------------------------------------------
  259.   alias clear_sprite_effects_str11a clear_sprite_effects
  260.   def clear_sprite_effects
  261.     clear_sprite_effects_str11a
  262.     @animation_sy = 0
  263.   end
  264. end
  265. #==============================================================================
  266. # ■ Game_Party
  267. #==============================================================================
  268. class Game_Party < Game_Unit
  269.   #--------------------------------------------------------------------------
  270.   # ● 公開インスタンス変数
  271.   #--------------------------------------------------------------------------
  272.   attr_reader   :actors
  273. end
  274. #==============================================================================
  275. # ■ Scene_Battle
  276. #==============================================================================
  277. class Scene_Battle < Scene_Base
  278.   #--------------------------------------------------------------------------
  279.   # ★ 再定義
  280.   #--------------------------------------------------------------------------
  281.   def display_attack_animation(targets)
  282.     if @active_battler.is_a?(Game_Enemy)
  283.       #Sound.play_enemy_attack
  284.       #wait(15, true)
  285.       display_normal_animation(targets, 1)
  286.     else
  287.       aid1 = @active_battler.atk_animation_id
  288.       aid2 = @active_battler.atk_animation_id2
  289.       display_normal_animation(targets, aid1, false)
  290.       display_normal_animation(targets, aid2, true)
  291.     end
  292.     wait_for_animation
  293.   end
  294.   #--------------------------------------------------------------------------
  295.   # ● 通常アニメーションの表示
  296.   #     targets      : 対象者の配列
  297.   #     animation_id : アニメーション ID
  298.   #     mirror       : 左右反転
  299.   #--------------------------------------------------------------------------
  300.   def display_normal_animation(targets, animation_id, mirror = false)
  301.     animation = $data_animations[animation_id]
  302.     if animation != nil
  303.       to_screen = (animation.position == 3)       # 位置が「画面」か?
  304.       for target in targets.uniq
  305.         target.animation_id = animation_id
  306.         target.animation_mirror = mirror
  307.         if target.is_a?(Game_Actor) and to_screen and STRRGSS2::BT_ANIME
  308.           target.animation_sy = STRRGSS2::BT_ANIME_SY
  309.         end
  310.         wait(20, true) unless to_screen           # 単体用ならウェイト
  311.       end
  312.       wait(20, true) if to_screen                 # 全体用ならウェイト
  313.     end
  314.   end
  315. end
复制代码
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

0

主题

47

帖子

376

积分

④见习

积分
376
QQ
发表于 2008-9-21 08:11:27 | 显示全部楼层
找出错几个未定义,在之前定义一下
PS:不过你用的RM系统导报错真是别致下次有的话
别告诉我你是在截图
感激你让我拥有秋天的美丽
回复 支持 反对

使用道具 举报

19

主题

98

帖子

777

积分

⑤进阶

积分
777
 楼主| 发表于 2008-9-21 09:26:46 | 显示全部楼层


这就是我用的报错脚本。。。似乎和某些脚本有冲突
  1. module ERRSettings
  2. #▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
  3. #请设置以下东东
  4. # 游戏测试的时候,是否保存错误信息?(true是false不是)
  5. SaveErrorData = true
  6. # 回溯跟踪错误的文件名
  7. BackTraceFileName = "Backtrace.txt"
  8. #▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
  9. end
  10. module RPG
  11. module_function
  12. def version
  13.    case
  14.      when defined? Hangup then 1.0
  15.      else 2.0
  16.    end
  17. end
  18. def debug?
  19.    $TEST or $DEBUG
  20. end
  21. end
  22. class Reset < Exception
  23. end
  24. class ScriptInterpreter
  25. include ERRSettings
  26. CallSystemError = true
  27. def run
  28.    Graphics.freeze
  29.    $scene = Scene_Title.new
  30.    $scene.main until $scene.nil?
  31.    Graphics.transition(RPG.version == 1 ? 20 : 30)
  32.    exit
  33. rescue Reset => exp
  34.    raise
  35. rescue SystemExit => exp
  36.    raise
  37. rescue Exception => exp
  38.    exception(exp)
  39.    exit
  40. end
  41. private
  42. def exception(exp)
  43.    save_backtrace(exp) if SaveErrorData or RPG.debug?
  44.    print(get_error_message(exp))
  45.    raise if CallSystemError and RPG.debug?
  46. end
  47. def get_error_message(exp)
  48.    if RPG.debug?
  49.      bt = BackTrace.get_backtraces(exp.backtrace)
  50.     
  51.      if exp.class.to_s=="SyntaxError"
  52.        $outexp="语法错误"
  53.      elsif exp.class.to_s=="NameError"
  54.        $outexp="变量未定义"
  55.      elsif exp.class.to_s=="NoMethodError"
  56.        $outexp="方法未定义"
  57.      elsif exp.class.to_s=="NoMemoryError"
  58.        $outexp="内存占有过大"
  59.      elsif exp.class.to_s=="ArgumentError"
  60.        $outexp="参数错误"   #如果愿意此处可以自定义添加
  61.      else
  62.        $outexp=exp.class.to_s
  63.      end
  64.      msg  = "◆ 发生错误\\n"
  65.      msg += "\\n真诚提醒您:请养成备份游戏文件的习惯。\\n \\n"
  66.      msg += "错误类型 :\\n\\t#{$outexp}\\n"
  67.      msg += "错误信息 :\\n\\t#{exp.message}\\n" if exp.message
  68.      msg += "错误可能发生的相关位置 :"
  69.      bt.each do |i|
  70.        msg += " \\n\\t#{i.name} : 第 #{i.line_no} 行"
  71.        msg += " : #{i.method_name}" if i.method_name
  72.      end
  73.      msg += "  \\n非常荣幸能为您发送错误报告\\n"
  74.    else
  75.      msg  = "内部发生错误强制结束。\\n"
  76.      msg += "真诚提醒您:请养成备份游戏文件的习惯。\\n"
  77.      msg += "▲错误报告文件「#{BackTraceFileName}」已经保存。\\n\\n"
  78.      msg += "  非常荣幸能为您发送错误报告\\n"
  79.    end
  80.    msg
  81. end
  82. def save_backtrace(exp)
  83.    bt = BackTrace.get_backtraces(exp.backtrace)
  84.   
  85.      if exp.class.to_s=="SyntaxError"
  86.        $outexp="语法错误"
  87.      elsif exp.class.to_s=="NameError"
  88.        $outexp="变量未定义"
  89.      elsif exp.class.to_s=="NoMethodError"
  90.        $outexp="方法未定义"
  91.      elsif exp.class.to_s=="NoMemoryError"
  92.        $outexp="内存占有过大"
  93.      elsif exp.class.to_s=="ArgumentError"
  94.        $outexp="参数错误"   #如果愿意此处可以自定义添加
  95.      else
  96.        $outexp=exp.class.to_s
  97.      end
  98.   
  99.    msg  = "◆ #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}\\n"
  100.    msg += "错误类型 :\\n\\t#{$outexp}\\n"
  101.    msg += "错误信息 :\\n\\t#{exp.message}\\n" if exp.message
  102.    msg += "错误可能发生的相关位置 :"
  103.    bt.each do |i|
  104.      msg += " \\n\\t#{i.name} : 第 #{i.line_no} 行"
  105.      msg += " : #{i.method_name}" if i.method_name
  106.    end
  107.    msg += "\\n-------------66RPG-------------------\\n"
  108.    File.open(BackTraceFileName, "a") do |file|
  109.      file.write(msg)
  110.    end
  111. end
  112. end
  113. # 回溯跟踪错误的类
  114. class BackTrace  
  115. BacktraceRegexp = /^Section([0-9]+):([0-9]+)(:in `(.+)')?$/
  116. def self.get_backtraces(bt)
  117.    r = []
  118.    bt.each do |i|
  119.      r << self.new(i)
  120.    end
  121.    r
  122. end  
  123. def initialize(line)
  124.    name, @line_no, @method_name =
  125.                                    BacktraceRegexp.match(line).to_a.values_at(1,2,4)
  126.    @name = get_section_name(name)
  127. end  
  128. attr_accessor :name
  129. attr_accessor :line_no
  130. attr_accessor :method_name  
  131. private
  132. def get_section_name(index)
  133.    $RGSS_SCRIPTS[index.to_i][1]
  134. end
  135. end
  136. begin
  137. si = ScriptInterpreter.new
  138. si.run
  139. end
复制代码
回复 支持 反对

使用道具 举报

88

主题

5419

帖子

214748万

积分

版主

S素世上最伟大最华丽

Rank: 7Rank: 7Rank: 7

积分
2147483647
QQ
发表于 2008-9-21 09:34:54 | 显示全部楼层
XP里本来就有定义screen_x……VX不知

另外:贴脚本的方式……这个不用提醒吧,为了避免不必要的错误,请使用正规的方式
回复 支持 反对

使用道具 举报

550

主题

9116

帖子

214748万

积分

超级版主

如同神一般的存在,腿神!拖后腿的神~~

Rank: 8Rank: 8

积分
2147483647
发表于 2008-9-21 11:04:48 | 显示全部楼层
VX 的 game_actor没有screen_x的。。。是自己定义的。。


反正我看到的是一大堆SRT11  STR10  STR9打头的脚本一起用的。。。。可能作用不同。。。。具体的没研究。。。

no兴趣

还有。。我贴的脚本里有 作者对 screen_x 的定义

PS to LZ  你那个报错是怎么搞出来的。。。。

to S 你没编辑帖子的权限么。。。改了不就可以了
我就是你们的神,庶民们,追随我吧!跟着我一起拖后腿!
回复 支持 反对

使用道具 举报

19

主题

98

帖子

777

积分

⑤进阶

积分
777
 楼主| 发表于 2008-9-21 12:27:10 | 显示全部楼层
  TO LS  报错脚本在5楼。。
回复 支持 反对

使用道具 举报

88

主题

5419

帖子

214748万

积分

版主

S素世上最伟大最华丽

Rank: 7Rank: 7Rank: 7

积分
2147483647
QQ
发表于 2008-9-21 14:05:00 | 显示全部楼层
这又不是我的领地,没有权限改的……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-5-18 14:51 , Processed in 0.031189 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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