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

Project1

 找回密码
 注册会员
搜索

新手想请教如何更改立绘和物品栏的排版和图片

查看数: 2170 | 评论数: 6 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2016-10-24 18:12

正文摘要:

本帖最后由 wangxiaojiav6 于 2016-10-25 11:37 编辑 新手刚入坑,研究了两天va,但脚本一直不是很明白……(代码苦手……) 想做出立绘在对话框前面的效果,找到了一个可以实现的脚本,但是出现了字体离立绘太远 ...

回复

wangxiaojiav6 发表于 2016-10-26 17:47:00
魔法丶小肉包 发表于 2016-10-26 17:16
不好意思,刚刚发现原来存档界面的是领队角色名而不是地图名,请把下面的脚本放在楼上脚本的下面
module  ...

QWQ谢谢!!太感谢你了,已经放进去运行成功了~~大神受我一拜qwq
魔法丶小肉包 发表于 2016-10-26 17:16:16
wangxiaojiav6 发表于 2016-10-26 16:42
太感谢了!!!好棒啊!!!QWQ,多谢大神拯救代码手残…………

不好意思,刚刚发现原来存档界面的是领队角色名而不是地图名,请把下面的脚本放在楼上脚本的下面
RUBY 代码复制
  1. module DataManager
  2.   def self.make_save_header
  3.     header = {}
  4.     header[:characters] = $game_party.characters_for_savefile
  5.     header[:playtime_s] = $game_system.playtime_s
  6.     header[:name] = $game_party.leader.name
  7.     header[:lv] = $game_party.leader.level
  8.     header[:hp] = $game_party.leader.hp
  9.     header[:face] = $game_party.face_for_savefile
  10.     header
  11.   end
  12. end
  13. class Window_SaveFile < Window_Base
  14.   def refresh
  15.     contents.clear
  16.     change_color(normal_color)
  17.     name = MFXRB::FHF+MFXRB::FILE + " #{@file_index + 1}"
  18.     draw_text(4, 0, 200, line_height, name)
  19.     @name_width = text_size(name).width
  20.     draw_party_face(140, y)
  21.     draw_an(-470, y + line_height)
  22.     draw_lv(-490, y + line_height*2)
  23.     draw_shp(-400, y + line_height*2)
  24.   end
  25.   def draw_an(x, y)
  26.     header = DataManager.load_header(@file_index)
  27.     return unless header
  28.     draw_text(x, y, width, line_height, header[:name], 2)
  29.   end
  30. end

评分

参与人数 1星屑 +250 梦石 +1 收起 理由
RaidenInfinity + 250 + 1 楼主认可的解答

查看全部评分

wangxiaojiav6 发表于 2016-10-26 16:42:36
魔法丶小肉包 发表于 2016-10-25 23:30
根据楼主给出的菜单要求↓
效果图:

太感谢了!!!{:2_249:}好棒啊!!!QWQ,多谢大神拯救代码手残…………

点评

RM2003默认存档排版,那个位置是领队角色的名字  发表于 2016-10-26 16:52
存档画面的那个“大海原”我很好奇是目前所在地图名还是领队角色名字....,我把这个当地图名写了  发表于 2016-10-26 16:46
魔法丶小肉包 发表于 2016-10-25 23:30:25
根据楼主给出的菜单要求↓
效果图:


脚本↓
RUBY 代码复制
  1. module MFXRB
  2.   ITEM = "ITEM"
  3.   SKILL= "MAGIC"
  4.   EQUIP= "EQI"
  5.   SAVE = "SAVE"
  6.   GEND = "SHUT DOWN"
  7.   SAVETEXT="CONTINUE"
  8.   FILE = "DATA"
  9.   FH   = "☆"
  10.   FHF  = "△"
  11. end
  12. module DataManager
  13.   def self.make_save_header
  14.     header = {}
  15.     header[:characters] = $game_party.characters_for_savefile
  16.     header[:playtime_s] = $game_system.playtime_s
  17.     header[:map] = $game_map.display_name
  18.     header[:lv] = $game_party.leader.level
  19.     header[:hp] = $game_party.leader.hp
  20.     header[:face] = $game_party.face_for_savefile
  21.     header
  22.   end
  23. end
  24. class Game_Party < Game_Unit
  25.   def face_for_savefile
  26.     battle_members.collect do |actor|
  27.       [actor.face_name, actor.face_index]
  28.     end
  29.   end
  30. end
  31. class Scene_Menu < Scene_MenuBase
  32.   def create_command_window
  33.     @command_window = Window_MenuCommand.new
  34.     @command_window.set_handler(:item,      method(:command_item))
  35.     @command_window.set_handler(:skill,     method(:command_personal))
  36.     @command_window.set_handler(:equip,     method(:command_personal))
  37.     @command_window.set_handler(:save,      method(:command_save))
  38.     @command_window.set_handler(:game_end,  method(:command_game_end))
  39.     @command_window.set_handler(:cancel,    method(:return_scene))
  40.   end
  41. end
  42. class Window_MenuCommand < Window_Command
  43.   def make_command_list
  44.     add_main_commands
  45.     add_original_commands
  46.     add_save_command
  47.     add_game_end_command
  48.   end
  49.   def add_main_commands
  50.     add_command(MFXRB::FH+MFXRB::ITEM,   :item,   main_commands_enabled)
  51.     add_command(MFXRB::FH+MFXRB::SKILL,  :skill,  main_commands_enabled)
  52.     add_command(MFXRB::FH+MFXRB::EQUIP,  :equip,  main_commands_enabled)
  53.   end
  54.   def add_save_command
  55.     add_command(MFXRB::FH+MFXRB::SAVE, :save, save_enabled)
  56.   end
  57.   def add_game_end_command
  58.     add_command(MFXRB::FH+MFXRB::GEND, :game_end)
  59.   end
  60. end
  61. class Window_MenuStatus < Window_Selectable
  62.   def draw_item(index)
  63.     actor = $game_party.members[index]
  64.     enabled = $game_party.battle_members.include?(actor)
  65.     rect = item_rect(index)
  66.     draw_item_background(index)
  67.     draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
  68.     draw_actor_name(actor, rect.x + 100, rect.y + 1)
  69.     draw_actor_class(actor, rect.x + 250, rect.y + 1)
  70.     draw_actor_level(actor, rect.x + 100, rect.y + line_height)
  71.     d_a_zt(actor,rect.x + 180, rect.y + line_height)
  72.     d_ah(actor, rect.x + 240, rect.y + line_height)
  73.     d_aexp(actor, rect.x + 100, rect.y + line_height*2)
  74.     d_am(actor, rect.x + 240, rect.y + line_height*2)
  75.   end
  76. end
  77. class Window_Base < Window
  78.   def d_a_zt(actor,x,y,width=100)
  79.       draw_text_ex(x,y,if actor.dead?;"死亡";else "正常";end)
  80.   end
  81.     def d_ah(actor, x, y)
  82.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  83.     draw_text(x + 35, y, 100, line_height, actor.hp.to_s+"/"+actor.mhp.to_s)
  84.   end
  85.   def d_am(actor, x, y, width = 124)
  86.     draw_text(x, y, 30, line_height, Vocab::mp_a)
  87.     draw_text(x + 35, y, 100, line_height, actor.mp.to_s+"/"+actor.mmp.to_s)
  88.   end
  89.   def d_aexp(actor, x, y, width = 124)
  90.     s1 = actor.max_level? ? "-------" : actor.exp
  91.     s2 = actor.max_level? ? "-------" : actor.next_level_exp - actor.exp
  92.     draw_text(x, y, 30, line_height, "E")
  93.     draw_text(x + 35, y, 100, line_height, s1.to_s+"/"+s2.to_s)
  94.   end
  95. end
  96. class Scene_File < Scene_MenuBase
  97.   def visible_max
  98.     return 3
  99.   end
  100. end
  101. class Scene_Save < Scene_File
  102.   def help_window_text
  103.     MFXRB::FH+MFXRB::SAVETEXT+MFXRB::FH
  104.   end
  105. end
  106. class Window_SaveFile < Window_Base
  107.   def refresh
  108.     contents.clear
  109.     change_color(normal_color)
  110.     name = MFXRB::FHF+MFXRB::FILE + " #{@file_index + 1}"
  111.     draw_text(4, 0, 200, line_height, name)
  112.     @name_width = text_size(name).width
  113.     draw_party_face(140, y)
  114.     draw_map(-490, y + line_height)
  115.     draw_lv(-490, y + line_height*2)
  116.     draw_shp(-400, y + line_height*2)
  117.   end
  118.   def draw_map(x, y)
  119.     header = DataManager.load_header(@file_index)
  120.     return unless header
  121.     draw_text(x, y, width, line_height, header[:map], 2)
  122.   end
  123.   def draw_lv(x, y)
  124.     header = DataManager.load_header(@file_index)
  125.     return unless header
  126.     draw_text(x, y, width, line_height, "LV "+header[:lv].to_s, 2)
  127.   end
  128.   def draw_shp(x, y)
  129.     header = DataManager.load_header(@file_index)
  130.     return unless header
  131.     draw_text(x, y, width, line_height, "HP "+header[:hp].to_s, 2)
  132.   end
  133.   def draw_party_face(x, y)
  134.     header = DataManager.load_header(@file_index)
  135.     return unless header && header[:face]
  136.     header[:face].each_with_index do |data, i|
  137.       draw_face(data[0], data[1], x + i * 96, y)
  138.     end
  139.   end
  140. end
wangxiaojiav6 发表于 2016-10-25 13:09:28
RaidenInfinity 发表于 2016-10-25 12:06
你的第一个问题的解决方法主要是在这一段

非常感谢这么细致的回复,按照你的方法已经解决了。QWQ,谢谢你。
排版的话是希望能做出上面那个图的感觉,还在看论坛的教程,想看看能不能根据更改背景图片和窗口位置实现。(很喜欢深海囚人的菜单栏……)
再次感谢你的帮助QWQ,谢谢大神~~

RaidenInfinity 发表于 2016-10-25 12:06:46
你的第一个问题的解决方法主要是在这一段

RUBY 代码复制
  1. class Window_Message
  2.   #--------------------------------------------------------------------------
  3.   # ● 获取换行位置
  4.   #--------------------------------------------------------------------------
  5.   def new_line_x
  6.     # 如果有头像
  7.     unless $game_message.face_name.empty?
  8.       value=112
  9.       value=LBQ::Bust::INDENT unless $game_temp.bust_name.empty?
  10.     # 木有
  11.     else
  12.       value=0
  13.     end
  14.     return value
  15.   end
  16. end


因为并未提供工程,所以我只能凭着脚本作猜测。new_line_x这个方法,决定文字显示的X值。如果在事件指令中没有指定脸图,那么X值会是0。“在不显示立绘的情况下,怎么让文字的位置回复到最左边” 的这个问题,我不觉得有问题,这个得实际看到工程测试了才能理解。那么下列的这两行:

RUBY 代码复制
  1. value=112
  2. value=LBQ::Bust::INDENT unless $game_temp.bust_name.empty?


这个脚本呢,如果有提供立绘,那就使用 LBQ::Bust::INDENT 这个常量来决定X值,否则使用112(普通脸图)。
“字体离立绘太远”的这个问题,解决的方法有两种,一是更改常量:
RUBY 代码复制
  1. $imported ||= {}
  2. $imported[:LBQ_Bust]=true
  3.  
  4. module LBQ
  5.   module Bust
  6.     FOLDER="Busts"
  7.     SUB1=[/【/,    "\\{\\c[6]-- "]
  8.     SUB2=[/】/,    " --\\c[0]\\}"]
  9.  
  10.     TEXT_FOR_NEXT="[next]"
  11.     TEXT_FOR_END ="[end]"
  12.  
  13.     INDENT=255 #半身像的缩进 <----把255改成你觉得合适的X值 … 然后我要吐槽下LBQ大佬啊你为啥等号前后不加空格
  14.   end
  15. end


二就是舍弃常量,直接定义数值:
RUBY 代码复制
  1. value = 200 unless $game_temp.bust_name.empty? #把200改成你觉得合适的X值


至于第二个问题,“将默认的物品栏的排版和图片换成自己的素材”,没有详细的资讯(排版成怎么样?什么素材?之类的)大概是帮不了。
不过如果需要的话,可以使用论坛的私信功能联系我,可能可以帮上忙,定制所需的脚本。

评分

参与人数 1星屑 +250 梦石 +1 收起 理由
怪蜀黍 + 250 + 1 楼主认可的解答

查看全部评分

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

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

GMT+8, 2025-7-22 07:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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