Project1

标题: 无法显示经验 [打印本页]

作者: 冷血冰狐    时间: 2013-10-23 11:05
标题: 无法显示经验
本帖最后由 冷血冰狐 于 2013-10-24 20:53 编辑

无法显示当前经验,与剩余升级时间需要多少,求解决方式。。。

33223.jpg (101.77 KB, 下载次数: 14)

33223.jpg

作者: 艾拉梅德    时间: 2013-10-23 11:13
本帖最后由 艾拉梅德 于 2013-10-23 04:27 编辑

{:2_276:}
可能性1:window_status中,显示exp太长了导致exp数字到窗口外面了。
可能性2:window_status中把exp显示删了= =

目测还是第一种可能性比较正常= =
不过不管怎么说还是window_status吧。
原话显示exp是这样:
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
如果只是到窗口外面了把x改一下,没有了的话加上就行了= =

。。。。。。我不想连贴啊。。。
轩辕剑菜单我不知道是什么东西啊……
你干脆把你的window_status发出来吧。
上面两种可能性只是最大而已= =

最好的工程就是RM原版的window_status啊啊啊啊啊……
把window_status发一下看看……{:2_254:}
作者: 歌莉·萌露    时间: 2013-10-23 13:25
字都在窗体外了
作者: 你欠抽吧    时间: 2013-10-23 18:33
把Window_Status整个发出来
作者: 冷血冰狐    时间: 2013-10-24 14:41
你欠抽吧 发表于 2013-10-23 18:33
把Window_Status整个发出来

#==============================================================================
# ■ Scene_Status
#------------------------------------------------------------------------------
#  处理状态画面的类。
#==============================================================================

class Scene_Status
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor_index : 角色索引
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # ● 主处理
  #--------------------------------------------------------------------------
  def main
    # 获取角色
    @actor = $game_party.actors[@actor_index]
    # 生成状态窗口
    @status_window = Window_Status.new(@actor)
    # 执行过渡
    Graphics.transition
    # 主循环
    loop do
      # 刷新游戏画面
      Graphics.update
      # 刷新输入信息
      Input.update
      # 刷新画面
      update
      # 如果画面被切换的话就中断循环
      if $scene != self
        break
      end
    end
    # 准备过渡
    Graphics.freeze
    # 释放窗口
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 刷新画面
  #--------------------------------------------------------------------------
  def update
    # 按下 B 键的情况下
    if Input.trigger?(Input::B)
      # 演奏取消 SE
      $game_system.se_play($data_system.cancel_se)
      # 切换到菜单画面
      $scene = Scene_Menu.new(3)
      return
    end
    # 按下 R 键的情况下
    if Input.trigger?(Input::R)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至下一位角色
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # 切换到别的状态画面
      $scene = Scene_Status.new(@actor_index)
      return
    end
    # 按下 L 键的情况下
    if Input.trigger?(Input::L)
      # 演奏光标 SE
      $game_system.se_play($data_system.cursor_se)
      # 移至上一位角色
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # 切换到别的状态画面
      $scene = Scene_Status.new(@actor_index)
      return
    end
  end
end

作者: 你欠抽吧    时间: 2013-10-24 16:57
冷血冰狐 发表于 2013-10-24 14:41
#==============================================================================
# ■ Scene_Status
...

这是Scene_Status,Window_Status才是显示那些属性的窗口,往上找到Window_Status
作者: 美丽晨露    时间: 2013-10-24 17:22
在Window_Status内找到
self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
320+80显示数字的X坐标,修改它试试看
作者: 冷血冰狐    时间: 2013-10-24 19:53
你欠抽吧 发表于 2013-10-24 16:57
这是Scene_Status,Window_Status才是显示那些属性的窗口,往上找到Window_Status

#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  显示状态画面、完全规格的状态窗口。
#==============================================================================

class Window_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_actor_graphic(@actor, 40, 112)
    draw_actor_name(@actor, 4, 0)
    draw_actor_class(@actor, 4 + 144, 0)
    draw_actor_level(@actor, 96, 32)
    draw_actor_state(@actor, 96, 64)
    draw_actor_hp(@actor, 96, 112, 172)
    draw_actor_sp(@actor, 96, 144, 172)
    draw_actor_parameter(@actor, 96, 192, 0)
    draw_actor_parameter(@actor, 96, 224, 1)
    draw_actor_parameter(@actor, 96, 256, 2)
    draw_actor_parameter(@actor, 96, 304, 3)
    draw_actor_parameter(@actor, 96, 336, 4)
    draw_actor_parameter(@actor, 96, 368, 5)
    draw_actor_parameter(@actor, 96, 400, 6)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 48, 80, 32, "EXP")
    self.contents.draw_text(320, 80, 80, 32, "NEXT")
    self.contents.font.color = normal_color
    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
    self.contents.font.color = system_color
    self.contents.draw_text(320, 160, 96, 32, "装备")
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end

作者: 冷血冰狐    时间: 2013-10-24 19:57
美丽晨露 发表于 2013-10-24 17:22
在Window_Status内找到
self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
    self.conte ...

其实原本脚本工程是这样的,不知道为什么突然变这样了。不知道如何修改回去!

32232323.jpg (93.73 KB, 下载次数: 11)

32232323.jpg

作者: 冷血冰狐    时间: 2013-10-24 20:14
你欠抽吧 发表于 2013-10-24 16:57
这是Scene_Status,Window_Status才是显示那些属性的窗口,往上找到Window_Status

#==============================================================================
# ■ Window_Status
#------------------------------------------------------------------------------
#  显示状态画面、完全规格的状态窗口。
#==============================================================================

class Window_Status_New < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #     actor : 角色
  #--------------------------------------------------------------------------
  def initialize(actor)
    super(160, 40, 480, 436)
    self.windowskin = RPG::Cache.windowskin("../system/menu/windowskins/palskin")
    self.opacity = 180
    self.contents = Bitmap.new(width - 32, height - 32)
    @actor = actor
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    testname = @actor.battler_name+"_h.png"
    if $加密 == true
      bitmap=Bitmap.new("Graphics/system/menu/headp/#{testname}")
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) #——可自己调整大小
      self.contents.blt(0, y, bitmap, src_rect)  
      self.contents.font.size = 18
      self.contents.font.color = text_color(6)
      draw_actor_name(@actor, 300, 0)
      self.contents.font.color = text_color(0)
      draw_actor_class(@actor, 400, 32)
      draw_actor_level(@actor, 300, 32)
      draw_actor_state(@actor, 480, 32)
      draw_actor_hp(@actor, 300, 64, 150)
      draw_actor_sp(@actor, 300, 96, 150)
      draw_actor_exp_state(@actor, 300, 128, 150)
      draw_actor_parameter_state(@actor, 480, 66, 0)
      draw_actor_parameter_state(@actor, 480, 98, 1)
      draw_actor_parameter_state(@actor, 480, 130, 2)
      draw_actor_parameter_state(@actor, 320, 162, 3)
      draw_actor_parameter_state(@actor, 320, 194, 4)
      draw_actor_parameter_state(@actor, 480, 162, 5)
      draw_actor_parameter_state(@actor, 480, 194, 6)
      self.contents.font.color = system_color
      self.contents.draw_text(300, 260, 96, 32, "身上装备")
      draw_item_name($data_weapons[@actor.weapon_id], 300, 300)
      draw_item_name($data_armors[@actor.armor1_id], 460, 300)
      draw_item_name($data_armors[@actor.armor2_id], 300, 340)
      draw_item_name($data_armors[@actor.armor3_id], 460, 340)
      draw_item_name($data_armors[@actor.armor4_id], 300, 380)
    else
      if FileTest.exist?("Graphics/system/menu/headp/#{testname}")
        bitmap=Bitmap.new("Graphics/system/menu/headp/#{testname}")
        src_rect = Rect.new(0, 0, bitmap.width, bitmap.height) #——可自己调整大小
        self.contents.blt(160, y + 50, bitmap, src_rect,80)  
        self.contents.font.size = 18
        self.contents.font.color = text_color(6)
        @leftless = 296
        draw_actor_name(@actor, 300 - @leftless, 0)
        self.contents.font.color = text_color(0)
        #draw_actor_class(@actor, 400 - @leftless, 32)
        draw_actor_level(@actor, 300 - @leftless, 32)
        draw_actor_state(@actor, 480 - @leftless, 32)
        draw_actor_hp(@actor, 300 - @leftless, 64, 150)
        draw_actor_sp(@actor, 300 - @leftless, 96, 150)
        draw_actor_exp_state(@actor, 300 - @leftless, 128, 150)
        draw_actor_parameter_state(@actor, 480 - @leftless, 66, 0)
        draw_actor_parameter_state(@actor, 480 - @leftless, 98, 1)
        draw_actor_parameter_state(@actor, 480 - @leftless, 130, 2)
        draw_actor_parameter_state(@actor, 320 - @leftless, 162, 3)
        draw_actor_parameter_state(@actor, 320 - @leftless, 194, 4)
        draw_actor_parameter_state(@actor, 480 - @leftless, 162, 5)
        draw_actor_parameter_state(@actor, 480 - @leftless, 194, 6)
        self.contents.font.color = system_color
        self.contents.draw_text(300 - @leftless, 260, 96, 32, "身上装备")
        @newless = 10
        draw_item_name($data_weapons[@actor.weapon_id], 300 - @leftless, 300 - @newless)
        draw_item_name($data_armors[@actor.armor1_id], 460 - @leftless, 300 - @newless)
        draw_item_name($data_armors[@actor.armor2_id], 620 - @leftless, 300 - @newless)
        draw_item_name($data_armors[@actor.armor3_id], 300 - @leftless, 330 - @newless)
        draw_item_name($data_armors[@actor.armor4_id], 460 - @leftless, 330 - @newless)
        draw_item_name($data_armors[@actor.armor5_id], 620 - @leftless, 330 - @newless)
        draw_item_name($data_armors[@actor.armor6_id], 300 - @leftless, 360 - @newless)
        draw_item_name($data_armors[@actor.armor7_id], 460 - @leftless, 360 - @newless)
      else
        draw_actor_graphic(@actor, 40, 112)
        draw_actor_name(@actor, 4, 0)
        draw_actor_class(@actor, 4 + 144, 0)
        draw_actor_level(@actor, 96, 32)
        draw_actor_state(@actor, 96, 64)
        draw_actor_hp(@actor, 96, 112, 172)
        draw_actor_sp(@actor, 96, 144, 172)
        draw_actor_parameter(@actor, 96, 192, 0)
        draw_actor_parameter(@actor, 96, 224, 1)
        draw_actor_parameter(@actor, 96, 256, 2)
        draw_actor_parameter(@actor, 96, 304, 3)
        draw_actor_parameter(@actor, 96, 336, 4)
        draw_actor_parameter(@actor, 96, 368, 5)
        draw_actor_parameter(@actor, 96, 400, 6)
        self.contents.font.color = system_color
        self.contents.draw_text(200, 48, 80, 32, "EXP")
        self.contents.draw_text(200, 80, 80, 32, "NEXT")
        self.contents.font.color = normal_color
        self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
        self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
        self.contents.font.color = system_color
        self.contents.draw_text(320, 160, 96, 32, "装备")
        draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 208)
        draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 256)
        draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 304)
        draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 352)
        draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 400)
      end
    end
  end
  def dummy
    self.contents.font.color = system_color
    self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
    self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
    self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
    self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
    self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
    draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
    draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
    draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
    draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
    draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  end
end
这个才是!
作者: 你欠抽吧    时间: 2013-10-24 20:31
冷血冰狐 发表于 2013-10-24 20:14
#==============================================================================
# ■ Window_Status ...

        self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
        self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
这个就是了,320+80可能太大了,改小点试试,其他没有问题




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1