| 
 
| 赞 | 8 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 68 |  
| 经验 | 11339 |  
| 最后登录 | 2025-8-30 |  
| 在线时间 | 340 小时 |  
 Lv4.逐梦者 
	梦石5 星屑1833 在线时间340 小时注册时间2014-4-1帖子270 | 
| 
如题,想做一个ARPG(XAS系统),但是xas系统的hud没有显示经验条的,所以我想请教有没有办法把角色的经验变成条状然后显示在地图上,我使用过"地图显示血条魔条"这个脚本进行改造,但是发现这个脚本只能显示一个角色的经验,而且不能同步,大概就是在地图上有一个事件,对话能加经验,但是在那个脚本加上的经验不能显示出来,需要打开菜单再关闭才能同步,脚本如下,经验变成条的脚本
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  #  ●設定區域#=================================== module WDmodule Exp_Gauge  #EXP條COLOR,請修改成TEXT文字  EXP_GAUGE_COLOR1 = 6  EXP_GAUGE_COLOR2 = 14  #EXP條文字顯示設定,true為打開,false為關閉   EXP_TEXT_DISPLAY = trueendend #==============================================================================# ■ Window_Base#------------------------------------------------------------------------------#  ゲーム中の全てのウィンドウのスーパークラスです。#============================================================================== class Window_Base < Window  include WD::Exp_Gauge   def exp_gauge_color1;   text_color(EXP_GAUGE_COLOR1);  end;    # EXP ゲージ 1  def exp_gauge_color2;   text_color(EXP_GAUGE_COLOR2);  end;    # EXP ゲージ 2   #--------------------------------------------------------------------------  # ● シンプルなステータスの描画  #--------------------------------------------------------------------------  def draw_actor_simple_status(actor, x, y)    draw_actor_name(actor, x, y + line_height * 0.5)    draw_actor_level(actor, x, y - line_height * 0.5)    draw_actor_icons(actor, x, y + line_height * 1.5)    draw_actor_class(actor, x + 120, y - line_height * 0.5)    draw_actor_hp(actor, x + 120, y + line_height * 0.5)    draw_actor_mp(actor, x + 120, y + line_height * 1.5)    draw_actor_exp(actor, x, y + line_height * 2.5, EXP_TEXT_DISPLAY)  end  #--------------------------------------------------------------------------  # ● EXP の描画  #--------------------------------------------------------------------------  def draw_actor_exp(actor, x, y, display = true, width = 244)    this_level = actor.exp - actor.past_level_exp    next_level = actor.next_level_exp - actor.past_level_exp    draw_gauge(x, y, width, actor.exp_rate, exp_gauge_color1, exp_gauge_color2)    change_color(system_color)    if display      draw_text(x, y, 30, line_height, "EXP")      draw_current_and_max_values(x, y, width, this_level, next_level, mp_color(actor), normal_color)    end  endend class Game_Actor < Game_Battler  #--------------------------------------------------------------------------  # ● EXP の割合を取得  #--------------------------------------------------------------------------  def exp_rate    this_level = exp - past_level_exp    next_level = next_level_exp - past_level_exp    next_level > 0 ? this_level.to_f / next_level : 0  end  #--------------------------------------------------------------------------  # ● 前のレベルの経験値を取得  #--------------------------------------------------------------------------  def past_level_exp    @level > 1 ? exp_for_level(@level - 1) : 0  endend
#  ●設定區域 
#=================================== 
  
module WD 
module Exp_Gauge 
  #EXP條COLOR,請修改成TEXT文字 
  EXP_GAUGE_COLOR1 = 6 
  EXP_GAUGE_COLOR2 = 14 
  
 #EXP條文字顯示設定,true為打開,false為關閉 
   EXP_TEXT_DISPLAY = true 
end 
end 
  
#============================================================================== 
# ■ Window_Base 
#------------------------------------------------------------------------------ 
#  ゲーム中の全てのウィンドウのスーパークラスです。 
#============================================================================== 
  
class Window_Base < Window 
  include WD::Exp_Gauge 
  
  def exp_gauge_color1;   text_color(EXP_GAUGE_COLOR1);  end;    # EXP ゲージ 1 
  def exp_gauge_color2;   text_color(EXP_GAUGE_COLOR2);  end;    # EXP ゲージ 2 
  
  #-------------------------------------------------------------------------- 
  # ● シンプルなステータスの描画 
  #-------------------------------------------------------------------------- 
  def draw_actor_simple_status(actor, x, y) 
    draw_actor_name(actor, x, y + line_height * 0.5) 
    draw_actor_level(actor, x, y - line_height * 0.5) 
    draw_actor_icons(actor, x, y + line_height * 1.5) 
    draw_actor_class(actor, x + 120, y - line_height * 0.5) 
    draw_actor_hp(actor, x + 120, y + line_height * 0.5) 
    draw_actor_mp(actor, x + 120, y + line_height * 1.5) 
    draw_actor_exp(actor, x, y + line_height * 2.5, EXP_TEXT_DISPLAY) 
  end 
  #-------------------------------------------------------------------------- 
  # ● EXP の描画 
  #-------------------------------------------------------------------------- 
  def draw_actor_exp(actor, x, y, display = true, width = 244) 
    this_level = actor.exp - actor.past_level_exp 
    next_level = actor.next_level_exp - actor.past_level_exp 
    draw_gauge(x, y, width, actor.exp_rate, exp_gauge_color1, exp_gauge_color2) 
    change_color(system_color) 
    if display 
      draw_text(x, y, 30, line_height, "EXP") 
      draw_current_and_max_values(x, y, width, this_level, next_level, mp_color(actor), normal_color) 
    end 
  end 
end 
  
class Game_Actor < Game_Battler 
  #-------------------------------------------------------------------------- 
  # ● EXP の割合を取得 
  #-------------------------------------------------------------------------- 
  def exp_rate 
    this_level = exp - past_level_exp 
    next_level = next_level_exp - past_level_exp 
    next_level > 0 ? this_level.to_f / next_level : 0 
  end 
  #-------------------------------------------------------------------------- 
  # ● 前のレベルの経験値を取得 
  #-------------------------------------------------------------------------- 
  def past_level_exp 
    @level > 1 ? exp_for_level(@level - 1) : 0 
  end 
end 
地图显示经验条的脚本
 #============================================================================#  〇 地图显示血条魔条#                   ——By.冰舞蝶恋#----------------------------------------------------------------------------#     说明:显示的文字可自由更动来达到游戏需要的效果。#----------------------------------------------------------------------------#     以下是作者的白痴留言,尽管无视吧!#     啊哈哈!这可是咱第一个独立完成的脚本吖!!#     一时无聊做的……兴许可以用在ARPG之类的地方吧。偶然看到有不少人在拿RM做#     ARPG,又发现似乎没有(除了邪恶的fux2字眼的那个- -||b),做了个比较完善#     的……排版不是很好看,坐标可以自己调整。#============================================================================#   ○ACE移植#                   ——By.米酒獭酱#只是把这个脚本移植到了ACE上,因为找不到ACE代表魔攻魔防的系统变量所以舍去了,#若大家找到了也可以加上~#总之这个脚本就是集显示图片显示头像显示变量显示金钱什么的为一体的脚本~#(话说本人也是第一次弄脚本竟然就移植成功了)# 坐标可以自由调整+1~$LBA = 20  # 当这个开挂开启时,地图状态才显示。#==============================================================================# ■ Scene_Map#------------------------------------------------------------------------------#  处理地图画面的类。#==============================================================================class Scene_Map < Scene_Base  #--------------------------------------------------------------------------  # ● 開始処理  #--------------------------------------------------------------------------  alias map_windpwz_start start  def start    map_windpwz_start    @mapz_window = Window_MapZ.new(0, 0)    @mapz_window.refresh    @mapz_window.hide  end  alias map_windpwz_update update  def update    map_windpwz_update    @mapz_window.visible = $game_switches[$LBA]  endendclass Window_MapZ < Window_Base  #--------------------------------------------------------------------------  # ● 初始化对像  #--------------------------------------------------------------------------  def initialize(x,y)    super(-12, -12, 544+16,416+16)    self.opacity = 0    update  end  #--------------------------------------------------------------------------  # ● 刷新  #--------------------------------------------------------------------------  def refresh   self.contents.clear#~    draw_actor_face($game_actors[1],0 ,0 )   #$game_map.screen.pictures[1].show("你要显示的图片名", 0, 0, 0, 100, 100, 255, 0) #若要使用请取消注释#~    draw_actor_hp($game_actors[1], 80+12, 0, 160)#~    draw_actor_mp($game_actors[1], 80+12, 32, 160)   draw_actor_exp($game_actors[1], 10, 300, 160)   self.contents.font.color = normal_color#~    self.contents.draw_text(84+12, 52+8, 544, 24, "#{$game_actors[1].name}  Lv.#{$game_actors[1].level}")   self.contents.font.color = system_color#~    self.contents.draw_text(0+96+120+40, 0-4, 544, 24, "攻:")#~    self.contents.draw_text(0+96+120+40, 22-4, 544, 24, "防:")#~    self.contents.draw_text(0+96+120+96+40, 0-4, 544, 24, "所持金钱:")#~    self.contents.draw_text(-18, 22-4, 544, 24, "G", 2)   self.contents.font.color = normal_color#~    self.contents.draw_text(-456+96+120+40, 0-4, 544, 24, $game_actors[1].atk, 2)#~    self.contents.draw_text(-456+96+120+40, 22-4, 544, 24, $game_actors[1].def, 2)#~    self.contents.draw_text(-36, 22-4, 544, 24, $game_party.gold, 2)      self.contents.font.color = text_color(5)#改颜色什么的~#~    self.contents.draw_text(0,380 , 534, 24, "显示变量的名字:#{ $game_variables[13]}")  endend
#============================================================================ 
#  〇 地图显示血条魔条 
#                   ——By.冰舞蝶恋 
#---------------------------------------------------------------------------- 
#     说明:显示的文字可自由更动来达到游戏需要的效果。 
#---------------------------------------------------------------------------- 
#     以下是作者的白痴留言,尽管无视吧! 
#     啊哈哈!这可是咱第一个独立完成的脚本吖!! 
#     一时无聊做的……兴许可以用在ARPG之类的地方吧。偶然看到有不少人在拿RM做 
#     ARPG,又发现似乎没有(除了邪恶的fux2字眼的那个- -||b),做了个比较完善 
#     的……排版不是很好看,坐标可以自己调整。 
#============================================================================ 
#   ○ACE移植 
#                   ——By.米酒獭酱 
#只是把这个脚本移植到了ACE上,因为找不到ACE代表魔攻魔防的系统变量所以舍去了, 
#若大家找到了也可以加上~ 
#总之这个脚本就是集显示图片显示头像显示变量显示金钱什么的为一体的脚本~ 
#(话说本人也是第一次弄脚本竟然就移植成功了) 
# 坐标可以自由调整+1~ 
$LBA = 20  # 当这个开挂开启时,地图状态才显示。 
#============================================================================== 
# ■ Scene_Map 
#------------------------------------------------------------------------------ 
#  处理地图画面的类。 
#============================================================================== 
class Scene_Map < Scene_Base 
  #-------------------------------------------------------------------------- 
  # ● 開始処理 
  #-------------------------------------------------------------------------- 
  alias map_windpwz_start start 
  def start 
    map_windpwz_start 
    @mapz_window = Window_MapZ.new(0, 0) 
    @mapz_window.refresh 
    @mapz_window.hide 
  end 
  alias map_windpwz_update update 
  def update 
    map_windpwz_update 
    @mapz_window.visible = $game_switches[$LBA] 
  end 
end 
class Window_MapZ < Window_Base 
  #-------------------------------------------------------------------------- 
  # ● 初始化对像 
  #-------------------------------------------------------------------------- 
  def initialize(x,y) 
    super(-12, -12, 544+16,416+16) 
    self.opacity = 0 
    update 
  end 
  #-------------------------------------------------------------------------- 
  # ● 刷新 
  #-------------------------------------------------------------------------- 
  def refresh 
   self.contents.clear 
#~    draw_actor_face($game_actors[1],0 ,0 ) 
   #$game_map.screen.pictures[1].show("你要显示的图片名", 0, 0, 0, 100, 100, 255, 0) #若要使用请取消注释 
#~    draw_actor_hp($game_actors[1], 80+12, 0, 160) 
#~    draw_actor_mp($game_actors[1], 80+12, 32, 160) 
   draw_actor_exp($game_actors[1], 10, 300, 160) 
   self.contents.font.color = normal_color 
#~    self.contents.draw_text(84+12, 52+8, 544, 24, "#{$game_actors[1].name}  Lv.#{$game_actors[1].level}") 
   self.contents.font.color = system_color 
#~    self.contents.draw_text(0+96+120+40, 0-4, 544, 24, "攻:") 
#~    self.contents.draw_text(0+96+120+40, 22-4, 544, 24, "防:") 
#~    self.contents.draw_text(0+96+120+96+40, 0-4, 544, 24, "所持金钱:") 
#~    self.contents.draw_text(-18, 22-4, 544, 24, "G", 2) 
   self.contents.font.color = normal_color 
#~    self.contents.draw_text(-456+96+120+40, 0-4, 544, 24, $game_actors[1].atk, 2) 
#~    self.contents.draw_text(-456+96+120+40, 22-4, 544, 24, $game_actors[1].def, 2) 
#~    self.contents.draw_text(-36, 22-4, 544, 24, $game_party.gold, 2)    
   self.contents.font.color = text_color(5)#改颜色什么的~ 
#~    self.contents.draw_text(0,380 , 534, 24, "显示变量的名字:#{ $game_variables[13]}") 
  end 
end 
谢谢大神们
 | 
 |