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

Project1

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

[已经解决] 求助三远景和ACT脚本冲突的解决方案

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
346 小时
注册时间
2010-12-12
帖子
246
跳转到指定楼层
1
发表于 2014-6-7 13:43:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
这个是我用的三远景脚本
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Spriteset_Map
  3. #------------------------------------------------------------------------------
  4. #  处理地图画面活动块和元件的类。本类在
  5. # Scene_Map 类的内部使用。
  6. #==============================================================================
  7.  
  8. class Spriteset_Map
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化对象
  11.   #--------------------------------------------------------------------------
  12.   def initialize
  13.     create_viewports
  14.     create_tilemap
  15.     create_parallax
  16.     create_characters
  17.     create_shadow
  18.     create_weather
  19.     create_pictures
  20.     create_timer
  21.     update
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 生成视区
  25.   #--------------------------------------------------------------------------
  26.   def create_viewports
  27.     @viewport1 = Viewport.new(0, 0, 544, 416)
  28.     @viewport2 = Viewport.new(0, 0, 544, 416)
  29.     @viewport3 = Viewport.new(0, 0, 544, 416)
  30.     @viewport4 = Viewport.new(0, 0, 544, 416)
  31.     @viewport2.z = 200
  32.     @viewport3.z = 5000
  33.     @viewport4.z = 10
  34.   end
  35.   #--------------------------------------------------------------------------
  36.   # ● 生成元件图
  37.   #--------------------------------------------------------------------------
  38.   def create_tilemap
  39.     @tilemap = Tilemap.new(@viewport1)
  40.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  41.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  42.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  43.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  44.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  45.     @tilemap.bitmaps[5] = Cache.system("TileB")
  46.     @tilemap.bitmaps[6] = Cache.system("TileC")
  47.     @tilemap.bitmaps[7] = Cache.system("TileD")
  48.     @tilemap.bitmaps[8] = Cache.system("TileE")
  49.     @tilemap.map_data = $game_map.data
  50.     @tilemap.passages = $game_map.passages
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # ● 生成远景
  54.   #--------------------------------------------------------------------------
  55.   def create_parallax
  56.     @parallax = Plane.new(@viewport1)
  57.     @parallax.z = -1000
  58.     @parallax2 = Plane.new(@viewport1)
  59.     @parallax2.z = 3000
  60.     @parallax3 = Plane.new(@viewport1)
  61.     @parallax3.z = -2000
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 生成角色活动块
  65.   #--------------------------------------------------------------------------
  66.   def create_characters
  67.     @character_sprites = []
  68.     for i in $game_map.events.keys.sort
  69.       sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  70.       @character_sprites.push(sprite)
  71.     end
  72.     for vehicle in $game_map.vehicles
  73.       sprite = Sprite_Character.new(@viewport1, vehicle)
  74.       @character_sprites.push(sprite)
  75.     end
  76.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # ● 生成飞行船阴影活动块
  80.   #--------------------------------------------------------------------------
  81.   def create_shadow
  82.     @shadow_sprite = Sprite.new(@viewport1)
  83.     @shadow_sprite.bitmap = Cache.system("Shadow")
  84.     @shadow_sprite.ox = @shadow_sprite.bitmap.width / 2
  85.     @shadow_sprite.oy = @shadow_sprite.bitmap.height
  86.     @shadow_sprite.z = 180
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 生成天气
  90.   #--------------------------------------------------------------------------
  91.   def create_weather
  92.     @weather = Spriteset_Weather.new(@viewport2)
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # ● 生成位图活动块
  96.   #--------------------------------------------------------------------------
  97.   def create_pictures
  98.     @picture_sprites = []
  99.     for i in 1..20
  100.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  101.         $game_map.screen.pictures[i]))
  102.     end
  103.   end
  104.   #--------------------------------------------------------------------------
  105.   # ● 生成计时器活动块
  106.   #--------------------------------------------------------------------------
  107.   def create_timer
  108.     @timer_sprite = Sprite_Timer.new(@viewport2)
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # ● 释放
  112.   #--------------------------------------------------------------------------
  113.   def dispose
  114.     dispose_tilemap
  115.     dispose_parallax
  116.     dispose_characters
  117.     dispose_shadow
  118.     dispose_weather
  119.     dispose_pictures
  120.     dispose_timer
  121.     dispose_viewports
  122.   end
  123.   #--------------------------------------------------------------------------
  124.   # ● 释放元件图
  125.   #--------------------------------------------------------------------------
  126.   def dispose_tilemap
  127.     @tilemap.dispose
  128.   end
  129.   #--------------------------------------------------------------------------
  130.   # ● 释放远景
  131.   #--------------------------------------------------------------------------
  132.   def dispose_parallax
  133.     @parallax.dispose
  134.     @parallax2.dispose
  135.     @parallax3.dispose
  136.   end
  137.   #--------------------------------------------------------------------------
  138.   # ● 释放角色活动块
  139.   #--------------------------------------------------------------------------
  140.   def dispose_characters
  141.     for sprite in @character_sprites
  142.       sprite.dispose
  143.     end
  144.   end
  145.   #--------------------------------------------------------------------------
  146.   # ● 释放飞行船阴影活动块
  147.   #--------------------------------------------------------------------------
  148.   def dispose_shadow
  149.     @shadow_sprite.dispose
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 释放天气
  153.   #--------------------------------------------------------------------------
  154.   def dispose_weather
  155.     @weather.dispose
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 释放位图活动块
  159.   #--------------------------------------------------------------------------
  160.   def dispose_pictures
  161.     for sprite in @picture_sprites
  162.       sprite.dispose
  163.     end
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ● 释放计时器活动块
  167.   #--------------------------------------------------------------------------
  168.   def dispose_timer
  169.     @timer_sprite.dispose
  170.   end
  171.   #--------------------------------------------------------------------------
  172.   # ● 释放视区
  173.   #--------------------------------------------------------------------------
  174.   def dispose_viewports
  175.     @viewport1.dispose
  176.     @viewport2.dispose
  177.     @viewport3.dispose
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● 刷新画面
  181.   #--------------------------------------------------------------------------
  182.   def update
  183.     update_tilemap
  184.     update_parallax
  185.     update_characters
  186.     update_shadow
  187.     update_weather
  188.     update_pictures
  189.     update_timer
  190.     update_viewports
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 刷新元件图
  194.   #--------------------------------------------------------------------------
  195.   def update_tilemap
  196.     @tilemap.ox = $game_map.display_x / 8
  197.     @tilemap.oy = $game_map.display_y / 8
  198.     @tilemap.update
  199.   end
  200.   #--------------------------------------------------------------------------
  201.   # ● 刷新远景
  202.   #--------------------------------------------------------------------------
  203.   def update_parallax
  204.     if @parallax_name != $game_map.parallax_name
  205.       @parallax_name = $game_map.parallax_name
  206.       if @parallax.bitmap != nil
  207.          @parallax.bitmap.dispose
  208.          @parallax2.bitmap.dispose
  209.          @parallax3.bitmap.dispose
  210.          @parallax2.bitmap = nil
  211.          @parallax.bitmap = nil
  212.          @parallax3.bitmap = nil
  213.       end
  214.       if @parallax_name != ""
  215.          @parallax.bitmap = Cache.parallax(@parallax_name)
  216.          @parallax2.bitmap = Cache.parallax(@parallax_name+"_2")
  217.          @parallax3.bitmap = Cache.parallax(@parallax_name+"_3")
  218.       end
  219.       Graphics.frame_reset
  220.     end
  221.     @parallax.ox = $game_map.display_x / 8
  222.     @parallax.oy = $game_map.display_y / 8
  223.     @parallax2.ox = @parallax.ox
  224.     @parallax2.oy = @parallax.oy
  225.     @parallax3.ox = $game_map.display_x / 16
  226.     @parallax3.oy = $game_map.display_y / 16
  227.   end
  228.   #--------------------------------------------------------------------------
  229.   # ● 刷新角色活动块
  230.   #--------------------------------------------------------------------------
  231.   def update_characters
  232.     for sprite in @character_sprites
  233.       sprite.update
  234.     end
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 刷新飞行船阴影活动块
  238.   #--------------------------------------------------------------------------
  239.   def update_shadow
  240.     airship = $game_map.airship
  241.     @shadow_sprite.x = airship.screen_x
  242.     @shadow_sprite.y = airship.screen_y + airship.altitude
  243.     @shadow_sprite.opacity = airship.altitude * 8
  244.     @shadow_sprite.update
  245.   end
  246.   #--------------------------------------------------------------------------
  247.   # ● 刷新天气
  248.   #--------------------------------------------------------------------------
  249.   def update_weather
  250.     @weather.type = $game_map.screen.weather_type
  251.     @weather.max = $game_map.screen.weather_max
  252.     @weather.ox = $game_map.display_x / 8
  253.     @weather.oy = $game_map.display_y / 8
  254.     @weather.update
  255.   end
  256.   #--------------------------------------------------------------------------
  257.   # ● 刷新活动块位图
  258.   #--------------------------------------------------------------------------
  259.   def update_pictures
  260.     for sprite in @picture_sprites
  261.       sprite.update
  262.     end
  263.   end
  264.   #--------------------------------------------------------------------------
  265.   # ● 刷新计时器位图
  266.   #--------------------------------------------------------------------------
  267.   def update_timer
  268.     @timer_sprite.update
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 刷新视区
  272.   #--------------------------------------------------------------------------
  273.   def update_viewports
  274.     @viewport1.tone = $game_map.screen.tone
  275.     @viewport1.ox = $game_map.screen.shake
  276.     @viewport2.color = $game_map.screen.flash_color
  277.     @viewport3.color.set(0, 0, 0, 255 - $game_map.screen.brightness)
  278.     @viewport1.update
  279.     @viewport2.update
  280.     @viewport3.update
  281.   end
  282. end

这个是我用的ACT脚本中扩充定义的Spriteset_ActionMap类
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Spriteset_ActionMap
  3. #==============================================================================
  4. class Spriteset_ActionMap < Spriteset_Map
  5.   #--------------------------------------------------------------------------
  6.   # ● オブジェクト初期化
  7.   #--------------------------------------------------------------------------
  8.   def initialize
  9.     @act_sprites = []
  10.     @act_sprites.push(Sprite_MiniGauge.new)
  11.     create_viewports
  12.     create_tilemap
  13.     create_parallax
  14.     create_characters
  15.     create_weather
  16.     create_pictures
  17.     create_timer
  18.     update
  19.     for i in 0...16
  20.       @act_sprites.push(Sprite_MiniMessage.new(nil, $game_action_map.messages[i]))
  21.     end
  22.     for i in 0...ACT::PL_BULLET_MAX
  23.       @act_sprites.push(Sprite_Bullet.new(@viewport2, $game_action_map.pl_bullets[i]))
  24.     end
  25.     for i in 0...ACT::EN_BULLET_MAX
  26.       @act_sprites.push(Sprite_Bullet.new(@viewport2, $game_action_map.en_bullets[i]))
  27.     end
  28.     for i in 0...ACT::EFFECT_MAX
  29.       @act_sprites.push(Sprite_Effect.new(@viewport2, $game_action_map.effects[i]))
  30.     end
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● タイルマップの作成
  34.   #--------------------------------------------------------------------------
  35.   def create_tilemap
  36.     @tilemap = Tilemap.new(@viewport1)
  37.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  38.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  39.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  40.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  41.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  42.     @tilemap.bitmaps[5] = Cache.system("TileB")
  43.     @tilemap.bitmaps[6] = Cache.system("TileC")
  44.     @tilemap.bitmaps[7] = Cache.system("TileD")
  45.     @tilemap.bitmaps[8] = Cache.system("TileE")
  46.     @tilemap.map_data = $game_action_map.data
  47.     @tilemap.passages = $game_action_map.passages
  48.   end
  49.   #--------------------------------------------------------------------------
  50.   # ● キャラクタースプライトの作成
  51.   #--------------------------------------------------------------------------
  52.   def create_characters
  53.     @character_sprites = []
  54.     for i in $game_action_map.events.keys.sort
  55.       sprite = Sprite_Character.new(@viewport1, $game_action_map.events[i])
  56.       @character_sprites.push(sprite)
  57.     end
  58.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_action_player))
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # ● ピクチャスプライトの作成
  62.   #--------------------------------------------------------------------------
  63.   def create_pictures
  64.     @picture_sprites = []
  65.     for i in 1..20
  66.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  67.         $game_action_map.screen.pictures[i]))
  68.     end
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # ● 解放
  72.   #--------------------------------------------------------------------------
  73.   def dispose
  74.     dispose_tilemap
  75.     dispose_parallax
  76.     dispose_characters
  77.     dispose_weather
  78.     dispose_pictures
  79.     dispose_timer
  80.     dispose_viewports
  81.     for sprite in @act_sprites do sprite.dispose end
  82.   end
  83.   #--------------------------------------------------------------------------
  84.   # ● フレーム更新
  85.   #--------------------------------------------------------------------------
  86.   def update
  87.     update_tilemap
  88.     update_parallax
  89.     update_characters
  90.     update_weather
  91.     update_pictures
  92.     update_timer
  93.     update_viewports
  94.     if @act_sprites != nil
  95.       for sprite in @act_sprites do sprite.update end
  96.     end
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● タイルマップの更新
  100.   #--------------------------------------------------------------------------
  101.   def update_tilemap
  102.     @tilemap.ox = $game_action_map.display_x / 8
  103.     @tilemap.oy = $game_action_map.display_y / 8
  104.     @tilemap.update
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 遠景の更新
  108.   #--------------------------------------------------------------------------
  109.   def update_parallax
  110.     if @parallax_name != $game_action_map.parallax_name
  111.       @parallax_name = $game_action_map.parallax_name
  112.       if @parallax.bitmap != nil
  113.         @parallax.bitmap.dispose
  114.         @parallax.bitmap = nil
  115.       end
  116.       if @parallax_name != ""
  117.         @parallax.bitmap = Cache.parallax(@parallax_name)
  118.       end
  119.       Graphics.frame_reset
  120.     end
  121.     @parallax.ox = $game_action_map.calc_parallax_x(@parallax.bitmap)
  122.     @parallax.oy = $game_action_map.calc_parallax_y(@parallax.bitmap)
  123.   end
  124.   #--------------------------------------------------------------------------
  125.   # ● キャラクタースプライトの更新
  126.   #--------------------------------------------------------------------------
  127.   def update_characters
  128.     for sprite in @character_sprites
  129.       sprite.update if sprite.character.update_flag
  130.     end
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 天候の更新
  134.   #--------------------------------------------------------------------------
  135.   def update_weather
  136.     @weather.type = $game_action_map.screen.weather_type
  137.     @weather.max = $game_action_map.screen.weather_max
  138.     @weather.ox = $game_action_map.display_x / 8
  139.     @weather.oy = $game_action_map.display_y / 8
  140.     @weather.update
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● ビューポートの更新
  144.   #--------------------------------------------------------------------------
  145.   def update_viewports
  146.     @viewport1.tone = $game_action_map.screen.tone
  147.     @viewport1.ox = $game_action_map.screen.shake
  148.     @viewport2.color = $game_action_map.screen.flash_color
  149.     @viewport3.color.set(0, 0, 0, 255 - $game_action_map.screen.brightness)
  150.     @viewport1.update
  151.     @viewport2.update
  152.     @viewport3.update
  153.   end
  154. end

如果将三远景脚本单纯的插入工程的话是不起作用的,替换掉原有的Spriteset_Map类也不行。所以我试着将两个脚本整合在一起,也就是把三远景脚本有,而Spriteset_ActionMap没有的代码添加进Spriteset_ActionMap中,得出以下脚本:
RUBY 代码复制
  1. #==============================================================================
  2. # ■ Spriteset_ActionMap
  3. #==============================================================================
  4. class Spriteset_ActionMap < Spriteset_Map
  5.   #--------------------------------------------------------------------------
  6.   # ● 对象初始化
  7.   #--------------------------------------------------------------------------
  8.   def initialize
  9.     @act_sprites = []
  10.     @act_sprites.push(Sprite_MiniGauge.new)
  11.     create_viewports
  12.     create_tilemap
  13.     create_parallax
  14.     create_characters
  15.     create_weather
  16.     create_pictures
  17.     create_timer
  18.     update
  19.     for i in 0...16
  20.       @act_sprites.push(Sprite_MiniMessage.new(nil, $game_action_map.messages[i]))
  21.     end
  22.     for i in 0...ACT::PL_BULLET_MAX
  23.       @act_sprites.push(Sprite_Bullet.new(@viewport2, $game_action_map.pl_bullets[i]))
  24.     end
  25.     for i in 0...ACT::EN_BULLET_MAX
  26.       @act_sprites.push(Sprite_Bullet.new(@viewport2, $game_action_map.en_bullets[i]))
  27.     end
  28.     for i in 0...ACT::EFFECT_MAX
  29.       @act_sprites.push(Sprite_Effect.new(@viewport2, $game_action_map.effects[i]))
  30.     end
  31.   end
  32.   #--------------------------------------------------------------------------
  33.   # ● 生成视区
  34.   #--------------------------------------------------------------------------
  35.   def create_viewports
  36.     @viewport1 = Viewport.new(0, 0, 544, 416)
  37.     @viewport2 = Viewport.new(0, 0, 544, 416)
  38.     @viewport3 = Viewport.new(0, 0, 544, 416)
  39.     @viewport4 = Viewport.new(0, 0, 544, 416)
  40.     @viewport2.z = 200
  41.     @viewport3.z = 5000
  42.     @viewport4.z = 10
  43.   end
  44.   #--------------------------------------------------------------------------
  45.   # ● 生成图块地图
  46.   #--------------------------------------------------------------------------
  47.   def create_tilemap
  48.     @tilemap = Tilemap.new(@viewport1)
  49.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  50.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  51.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  52.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  53.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  54.     @tilemap.bitmaps[5] = Cache.system("TileB")
  55.     @tilemap.bitmaps[6] = Cache.system("TileC")
  56.     @tilemap.bitmaps[7] = Cache.system("TileD")
  57.     @tilemap.bitmaps[8] = Cache.system("TileE")
  58.     @tilemap.map_data = $game_action_map.data
  59.     @tilemap.passages = $game_action_map.passages
  60.   end
  61.   #--------------------------------------------------------------------------
  62.   # ● 生成远景
  63.   #--------------------------------------------------------------------------
  64.   def create_parallax
  65.     @parallax = Plane.new(@viewport1)
  66.     @parallax.z = -1000
  67.     @parallax2 = Plane.new(@viewport1)
  68.     @parallax2.z = 3000
  69.     @parallax3 = Plane.new(@viewport1)
  70.     @parallax3.z = -2000
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● 生成角色的精灵
  74.   #--------------------------------------------------------------------------
  75.   def create_characters
  76.     @character_sprites = []
  77.     for i in $game_action_map.events.keys.sort
  78.       sprite = Sprite_Character.new(@viewport1, $game_action_map.events[i])
  79.       @character_sprites.push(sprite)
  80.     end
  81.     for vehicle in $game_map.vehicles
  82.       sprite = Sprite_Character.new(@viewport1, vehicle)
  83.       @character_sprites.push(sprite)
  84.     end
  85.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_action_player))
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 生成飞行船阴影活动块
  89.   #--------------------------------------------------------------------------
  90.   def create_shadow
  91.     @shadow_sprite = Sprite.new(@viewport1)
  92.     @shadow_sprite.bitmap = Cache.system("Shadow")
  93.     @shadow_sprite.ox = @shadow_sprite.bitmap.width / 2
  94.     @shadow_sprite.oy = @shadow_sprite.bitmap.height
  95.     @shadow_sprite.z = 180
  96.   end
  97.   #--------------------------------------------------------------------------
  98.   # ● 生成天气
  99.   #--------------------------------------------------------------------------
  100.   def create_weather
  101.     @weather = Spriteset_Weather.new(@viewport2)
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 生成图片的精灵
  105.   #--------------------------------------------------------------------------
  106.   def create_pictures
  107.     @picture_sprites = []
  108.     for i in 1..20
  109.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  110.         $game_action_map.screen.pictures[i]))
  111.     end
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # ● 生成计时器活动块
  115.   #--------------------------------------------------------------------------
  116.   def create_timer
  117.     @timer_sprite = Sprite_Timer.new(@viewport2)
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● 释放
  121.   #--------------------------------------------------------------------------
  122.   def dispose
  123.     dispose_tilemap
  124.     dispose_parallax
  125.     dispose_characters
  126.     dispose_weather
  127.     dispose_pictures
  128.     dispose_timer
  129.     dispose_viewports
  130.     for sprite in @act_sprites do sprite.dispose end
  131.     end
  132.   #--------------------------------------------------------------------------
  133.   # ● 释放元件图
  134.   #--------------------------------------------------------------------------
  135.   def dispose_tilemap
  136.     @tilemap.dispose
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 释放远景
  140.   #--------------------------------------------------------------------------
  141.   def dispose_parallax
  142.     @parallax.dispose
  143.     @parallax2.dispose
  144.     @parallax3.dispose
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # ● 释放角色活动块
  148.   #--------------------------------------------------------------------------
  149.   def dispose_characters
  150.     for sprite in @character_sprites
  151.       sprite.dispose
  152.     end
  153.   end
  154.   #--------------------------------------------------------------------------
  155.   # ● 释放飞行船阴影活动块
  156.   #--------------------------------------------------------------------------
  157.   def dispose_shadow
  158.     @shadow_sprite.dispose
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # ● 释放天气
  162.   #--------------------------------------------------------------------------
  163.   def dispose_weather
  164.     @weather.dispose
  165.   end
  166.   #--------------------------------------------------------------------------
  167.   # ● 释放位图活动块
  168.   #--------------------------------------------------------------------------
  169.   def dispose_pictures
  170.     for sprite in @picture_sprites
  171.       sprite.dispose
  172.     end
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● 释放计时器活动块
  176.   #--------------------------------------------------------------------------
  177.   def dispose_timer
  178.     @timer_sprite.dispose
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● 释放视区
  182.   #--------------------------------------------------------------------------
  183.   def dispose_viewports
  184.     @viewport1.dispose
  185.     @viewport2.dispose
  186.     @viewport3.dispose
  187.   end
  188.   #--------------------------------------------------------------------------
  189.   # ● 帧更新
  190.   #--------------------------------------------------------------------------
  191.   def update
  192.     update_tilemap
  193.     update_parallax
  194.     update_characters
  195.     update_weather
  196.     update_pictures
  197.     update_timer
  198.     update_viewports
  199.     if @act_sprites != nil
  200.       for sprite in @act_sprites do sprite.update end
  201.     end
  202.   end
  203.   #--------------------------------------------------------------------------
  204.   # ● 图块地图的更新
  205.   #--------------------------------------------------------------------------
  206.   def update_tilemap
  207.     @tilemap.ox = $game_action_map.display_x / 8
  208.     @tilemap.oy = $game_action_map.display_y / 8
  209.     @tilemap.update
  210.   end
  211.   #--------------------------------------------------------------------------
  212.   # ● 更新远景
  213.   #--------------------------------------------------------------------------
  214.   def update_parallax
  215.     if @parallax_name != $game_action_map.parallax_name
  216.       @parallax_name = $game_action_map.parallax_name
  217.       if @parallax.bitmap != nil
  218.          @parallax.bitmap.dispose
  219.          @parallax2.bitmap.dispose
  220.          @parallax3.bitmap.dispose
  221.          @parallax2.bitmap = nil
  222.          @parallax.bitmap = nil
  223.          @parallax3.bitmap = nil
  224.       end
  225.       if @parallax_name != ""
  226.         @parallax.bitmap = Cache.parallax(@parallax_name)
  227.         @parallax2.bitmap = Cache.parallax(@parallax_name+"_2")
  228.         @parallax3.bitmap = Cache.parallax(@parallax_name+"_3")
  229.       end
  230.       Graphics.frame_reset
  231.     end
  232.     @parallax.ox = $game_action_map.calc_parallax_x(@parallax.bitmap) /8
  233.     @parallax.oy = $game_action_map.calc_parallax_y(@parallax.bitmap) /8
  234.     @parallax2.ox = @parallax.ox
  235.     @parallax2.oy = @parallax.oy
  236.     @parallax3.ox = $game_action_map.calc_parallax_x(@parallax.bitmap) / 16
  237.     @parallax3.oy = $game_action_map.calc_parallax_y(@parallax.bitmap) / 16
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # ● 更新角色脚本
  241.   #--------------------------------------------------------------------------
  242.   def update_characters
  243.     for sprite in @character_sprites
  244.       sprite.update if sprite.character.update_flag
  245.     end
  246.   end
  247.   #--------------------------------------------------------------------------
  248.   # ● 刷新飞行船阴影活动块
  249.   #--------------------------------------------------------------------------
  250.   def update_shadow
  251.     airship = $game_map.airship
  252.     @shadow_sprite.x = airship.screen_x
  253.     @shadow_sprite.y = airship.screen_y + airship.altitude
  254.     @shadow_sprite.opacity = airship.altitude * 8
  255.     @shadow_sprite.update
  256.   end
  257.   #--------------------------------------------------------------------------
  258.   # ● 天气更新
  259.   #--------------------------------------------------------------------------
  260.   def update_weather
  261.     @weather.type = $game_action_map.screen.weather_type
  262.     @weather.max = $game_action_map.screen.weather_max
  263.     @weather.ox = $game_action_map.display_x / 8
  264.     @weather.oy = $game_action_map.display_y / 8
  265.     @weather.update
  266.   end
  267.   #--------------------------------------------------------------------------
  268.   # ● 刷新活动块位图
  269.   #--------------------------------------------------------------------------
  270.   def update_pictures
  271.     for sprite in @picture_sprites
  272.       sprite.update
  273.     end
  274.   end
  275.   #--------------------------------------------------------------------------
  276.   # ● 刷新计时器位图
  277.   #--------------------------------------------------------------------------
  278.   def update_timer
  279.     @timer_sprite.update
  280.   end
  281.   #--------------------------------------------------------------------------
  282.   # ● 视口更新
  283.   #--------------------------------------------------------------------------
  284.   def update_viewports
  285.     @viewport1.tone = $game_action_map.screen.tone
  286.     @viewport1.ox = $game_action_map.screen.shake
  287.     @viewport2.color = $game_action_map.screen.flash_color
  288.     @viewport3.color.set(0, 0, 0, 255 - $game_action_map.screen.brightness)
  289.     @viewport1.update
  290.     @viewport2.update
  291.     @viewport3.update
  292.   end
  293. end

这样的结果是,第244行sprite.update if sprite.character.update_flag中,抛出update_flag函数未定义的错误,而如果吧if语句给注释掉,虽然可以通过,但是会导致一些很微妙的异常。具体原因我也不知道,脚本渣实在找不出来,所以求助……
这个是脚本未改动的ACT范例,三个远景已经在工程中准备好,三远景脚本也放在游戏目录,只求两者完美融合的方法……
act_btl_ex.rar (496.84 KB, 下载次数: 34)
@铃仙·优昙华院·因幡 @рrotosssonny @魔之哆啦

Lv1.梦旅人

星君

梦石
0
星屑
83
在线时间
2980 小时
注册时间
2011-10-9
帖子
2317

贵宾短篇七萝莉正太组冠军

2
发表于 2014-6-7 23:44:56 | 只看该作者
本帖最后由 皮卡星 于 2014-6-7 16:51 编辑

∑(・ω・`|||)当我看到这个直接吐了一口老血好么
  1. class Spriteset_Map < Scene_ActionMap
复制代码
附上了脚本文件,反正很简单,就路过改了下
Scripts.rvdata (159.79 KB, 下载次数: 20)

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
346 小时
注册时间
2010-12-12
帖子
246
3
 楼主| 发表于 2014-6-8 12:20:51 | 只看该作者
本帖最后由 至高无上 于 2014-6-8 15:04 编辑
皮卡星 发表于 2014-6-7 23:44
∑(・ω・`|||)当我看到这个直接吐了一口老血好么附上了脚本文件,反正很简单,就路过改了下
...


我的游戏里面已经对内置脚本进行过大量的修改,不方便直接替换脚本文件,能详细说一下需要修改的地方吗?谢谢!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

星君

梦石
0
星屑
83
在线时间
2980 小时
注册时间
2011-10-9
帖子
2317

贵宾短篇七萝莉正太组冠军

4
发表于 2014-6-8 15:45:15 | 只看该作者
Spriteset_Map脚本
9行的class Spriteset_Map < Scene_ActionMap
替换成class Spriteset_Map

Spriteset_ActionMap脚本
109行到123行替换成
  1.   def update_parallax
  2.     if @parallax_name != $game_action_map.parallax_name
  3.       @parallax_name = $game_action_map.parallax_name
  4.       if @parallax.bitmap != nil
  5.          @parallax.bitmap.dispose
  6.          @parallax2.bitmap.dispose
  7.          @parallax3.bitmap.dispose
  8.          @parallax2.bitmap = nil
  9.          @parallax.bitmap = nil
  10.          @parallax3.bitmap = nil
  11.       end
  12.       if @parallax_name != ""
  13.          @parallax.bitmap = Cache.parallax(@parallax_name)
  14.          @parallax2.bitmap = Cache.parallax(@parallax_name+"_2")
  15.          @parallax3.bitmap = Cache.parallax(@parallax_name+"_3")
  16.       end
  17.       Graphics.frame_reset
  18.     end
  19.     @parallax.ox = $game_action_map.display_x / 8
  20.     @parallax.oy = $game_action_map.display_y / 8
  21.     @parallax2.ox = @parallax.ox
  22.     @parallax2.oy = @parallax.oy
  23.     @parallax3.ox = $game_action_map.display_x / 16
  24.     @parallax3.oy = $game_action_map.display_y / 16
  25.   end
复制代码

评分

参与人数 1星屑 +100 收起 理由
丿梁丶小柒 + 100 我很赞同

查看全部评分


回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-15 12:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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