Project1
标题: 怎样制作出图中得到道具时的效果(已解决) [打印本页]
作者: 世界第一中二    时间: 2017-1-19 01:44
标题: 怎样制作出图中得到道具时的效果(已解决)
 本帖最后由 世界第一中二 于 2017-2-18 15:41 编辑 
如图
另外萌新有在用下面这个道具显色脚本,希望get道具的时候能够兼容道具显色。
求解 
 
- #============================================================================== 
- # [PS0]物品颜色描绘 
- #      Window_Base_Itemcolor 
- #------------------------------------------------------------------------------ 
- #     在物品、技能选项中显示物品品质并显示品质框和修改物品名颜色。 
- #============================================================================== 
- # [更新记录] 
- #    - 2012.01.03 By 仲秋启明 
- #      * 修改为VA定义 
- #    - 2011.12.27 By 仲秋启明 
- #      * 移植至RGSS3,遵循PS0协议; 
- #      * 优化数据库备注中设定方法 
- #    - 2011.08.22 By 冰舞蝶恋 
- #      * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框) 
- #    - 2010.08.06 By 仲秋启明 
- #      * 蓝本(物品颜色描绘脚本(完整无冲突版)) 
- #------------------------------------------------------------------------------ 
- # [使用方法] 
- #    - 替换原Window_Base中的draw_item_name定义或复制到Main之前 
- #============================================================================== 
- $_PS0 = {} if $_PS0 == nil   
- $_PS0["Window_Base_Itemcolor"] = 20111227 
- #============================================================================== 
- # [PS0] 通用配置模块   
- #============================================================================== 
- module PS0 
-   module Window_Base_Itemcolor 
-     Color1 = Color.new(255, 255, 255)  # 一般品质的色彩(白,1) 
-     Color2 = Color.new(128, 128, 255)  # 精良品质的色彩(蓝,2) 
-     Color3 = Color.new(170, 0, 255)    # 卓越品质的色彩(紫,3) 
-     Color4 = Color.new(255, 128, 0)    # 史诗品质的色彩(橙,4) 
-     Color5 = Color.new(255, 0, 200)    # 传说品质的色彩(粉,5) 
-   end 
- end 
- #============================================================================== 
- # ■ Window_Base 
- #============================================================================== 
- class Window_Base < Window 
-   def draw_item_name(item, x, y, enabled = true, width = 172) 
-     if item != nil 
-       n = item.note 
-       a = n.split{/<(?:Quality|品质)\s*(.+)>/i} 
-       c = a[1].to_i 
-       if c <= 1 
-         color = PS0::Window_Base_Itemcolor::Color1 
-       elsif c == 2 
-         color = PS0::Window_Base_Itemcolor::Color2 
-       elsif c == 3 
-         color = PS0::Window_Base_Itemcolor::Color3 
-       elsif c == 4 
-         color = PS0::Window_Base_Itemcolor::Color4 
-       elsif c == 5 
-         color = PS0::Window_Base_Itemcolor::Color5 
-       elsif c == 6 
-         color = PS0::Window_Base_Itemcolor::Color6 
-       elsif c == 7 
-         color = PS0::Window_Base_Itemcolor::Color7 
-       else 
-         color = Color.new(0, 0, 0, 0) 
-       end 
-       self.contents.fill_rect(x, y, 24, 1, color) 
-       self.contents.fill_rect(x, y, 1, 24, color) 
-       self.contents.fill_rect(x, y+23, 24, 1, color) 
-       self.contents.fill_rect(x+23, y, 1, 24, color) 
-       draw_icon(item.icon_index, x, y, enabled) 
-       change_color(color, enabled) 
-       draw_text(x + 24, y, width, line_height, item.name) 
-     end 
-   end 
- end 
- #============================================================================== 
- # [PS0] End of Script 
- #============================================================================== 
- #============================================================================== 
 
- # [PS0]物品颜色描绘 
 
- #      Window_Base_Itemcolor 
 
- #------------------------------------------------------------------------------ 
 
- #     在物品、技能选项中显示物品品质并显示品质框和修改物品名颜色。 
 
- #============================================================================== 
 
- # [更新记录] 
 
- #    - 2012.01.03 By 仲秋启明 
 
- #      * 修改为VA定义 
 
- #    - 2011.12.27 By 仲秋启明 
 
- #      * 移植至RGSS3,遵循PS0协议; 
 
- #      * 优化数据库备注中设定方法 
 
- #    - 2011.08.22 By 冰舞蝶恋 
 
- #      * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框) 
 
- #    - 2010.08.06 By 仲秋启明 
 
- #      * 蓝本(物品颜色描绘脚本(完整无冲突版)) 
 
- #------------------------------------------------------------------------------ 
 
- # [使用方法] 
 
- #    - 替换原Window_Base中的draw_item_name定义或复制到Main之前 
 
- #============================================================================== 
 
- $_PS0 = {} if $_PS0 == nil   
 
- $_PS0["Window_Base_Itemcolor"] = 20111227 
 
- #============================================================================== 
 
- # [PS0] 通用配置模块   
 
- #============================================================================== 
 
- module PS0 
 
-   module Window_Base_Itemcolor 
 
-     Color1 = Color.new(255, 255, 255)  # 一般品质的色彩(白,1) 
 
-     Color2 = Color.new(128, 128, 255)  # 精良品质的色彩(蓝,2) 
 
-     Color3 = Color.new(170, 0, 255)    # 卓越品质的色彩(紫,3) 
 
-     Color4 = Color.new(255, 128, 0)    # 史诗品质的色彩(橙,4) 
 
-     Color5 = Color.new(255, 0, 200)    # 传说品质的色彩(粉,5) 
 
-   end 
 
- end 
 
- #============================================================================== 
 
- # ■ Window_Base 
 
- #============================================================================== 
 
- class Window_Base < Window 
 
-   def draw_item_name(item, x, y, enabled = true, width = 172) 
 
-     if item != nil 
 
-       n = item.note 
 
-       a = n.split{/<(?:Quality|品质)\s*(.+)>/i} 
 
-       c = a[1].to_i 
 
-       if c <= 1 
 
-         color = PS0::Window_Base_Itemcolor::Color1 
 
-       elsif c == 2 
 
-         color = PS0::Window_Base_Itemcolor::Color2 
 
-       elsif c == 3 
 
-         color = PS0::Window_Base_Itemcolor::Color3 
 
-       elsif c == 4 
 
-         color = PS0::Window_Base_Itemcolor::Color4 
 
-       elsif c == 5 
 
-         color = PS0::Window_Base_Itemcolor::Color5 
 
-       elsif c == 6 
 
-         color = PS0::Window_Base_Itemcolor::Color6 
 
-       elsif c == 7 
 
-         color = PS0::Window_Base_Itemcolor::Color7 
 
-       else 
 
-         color = Color.new(0, 0, 0, 0) 
 
-       end 
 
-       self.contents.fill_rect(x, y, 24, 1, color) 
 
-       self.contents.fill_rect(x, y, 1, 24, color) 
 
-       self.contents.fill_rect(x, y+23, 24, 1, color) 
 
-       self.contents.fill_rect(x+23, y, 1, 24, color) 
 
-       draw_icon(item.icon_index, x, y, enabled) 
 
-       change_color(color, enabled) 
 
-       draw_text(x + 24, y, width, line_height, item.name) 
 
-     end 
 
-   end 
 
- end 
 
- #============================================================================== 
 
- # [PS0] End of Script 
 
- #============================================================================== 
 
以后发脚本可以用发帖工具栏里的<>工具放代码,格式好看还有高亮(——VIPArcher留
- 
223829y3p14ce7f3p661re.jpg
(77.35 KB, 下载次数: 48)
 
 
作者: 世界第一中二    时间: 2017-1-19 01:45
如果实在无法兼容的话只要该道具get的效果脚本就可以了=w=
作者: asdxjp233    时间: 2017-1-19 10:05
发布脚本请用以下格式
- #============================================================================== 
- # [PS0]物品颜色描绘 
- #      Window_Base_Itemcolor 
- #------------------------------------------------------------------------------ 
- #     在物品、技能选项中显示物品品质并显示品质框和修改物品名颜色。 
- #============================================================================== 
- # [更新记录] 
- #    - 2012.01.03 By 仲秋启明 
- #      * 修改为VA定义 
- #    - 2011.12.27 By 仲秋启明 
- #      * 移植至RGSS3,遵循PS0协议; 
- #      * 优化数据库备注中设定方法 
- #    - 2011.08.22 By 冰舞蝶恋 
- #      * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框) 
- #    - 2010.08.06 By 仲秋启明 
- #      * 蓝本(物品颜色描绘脚本(完整无冲突版)) 
- #------------------------------------------------------------------------------ 
- # [使用方法] 
- #    - 替换原Window_Base中的draw_item_name定义或复制到Main之前 
- #============================================================================== 
- $_PS0 = {} if $_PS0 == nil   
- $_PS0["Window_Base_Itemcolor"] = 20111227 
- #============================================================================== 
- # [PS0] 通用配置模块   
- #============================================================================== 
- module PS0 
-   module Window_Base_Itemcolor 
-     Color1 = Color.new(255, 255, 255)  # 一般品质的色彩(白,1) 
-     Color2 = Color.new(128, 128, 255)  # 精良品质的色彩(蓝,2) 
-     Color3 = Color.new(170, 0, 255)    # 卓越品质的色彩(紫,3) 
-     Color4 = Color.new(255, 128, 0)    # 史诗品质的色彩(橙,4) 
-     Color5 = Color.new(255, 0, 200)    # 传说品质的色彩(粉,5) 
-   end 
- end 
- #============================================================================== 
- # ■ Window_Base 
- #============================================================================== 
- class Window_Base < Window 
-   def draw_item_name(item, x, y, enabled = true, width = 172) 
-     if item != nil 
-       n = item.note 
-       a = n.split{/<(?:Quality|品质)\s*(.+)>/i} 
-       c = a[1].to_i 
-       if c <= 1 
-         color = PS0::Window_Base_Itemcolor::Color1 
-       elsif c == 2 
-         color = PS0::Window_Base_Itemcolor::Color2 
-       elsif c == 3 
-         color = PS0::Window_Base_Itemcolor::Color3 
-       elsif c == 4 
-         color = PS0::Window_Base_Itemcolor::Color4 
-       elsif c == 5 
-         color = PS0::Window_Base_Itemcolor::Color5 
-       elsif c == 6 
-         color = PS0::Window_Base_Itemcolor::Color6 
-       elsif c == 7 
-         color = PS0::Window_Base_Itemcolor::Color7 
-       else 
-         color = Color.new(0, 0, 0, 0) 
-       end 
-       self.contents.fill_rect(x, y, 24, 1, color) 
-       self.contents.fill_rect(x, y, 1, 24, color) 
-       self.contents.fill_rect(x, y+23, 24, 1, color) 
-       self.contents.fill_rect(x+23, y, 1, 24, color) 
-       draw_icon(item.icon_index, x, y, enabled) 
-       change_color(color, enabled) 
-       draw_text(x + 24, y, width, line_height, item.name) 
-     end 
-   end 
- end 
- #============================================================================== 
- # [PS0] End of Script 
- #============================================================================== 
- #============================================================================== 
 
- # [PS0]物品颜色描绘 
 
- #      Window_Base_Itemcolor 
 
- #------------------------------------------------------------------------------ 
 
- #     在物品、技能选项中显示物品品质并显示品质框和修改物品名颜色。 
 
- #============================================================================== 
 
- # [更新记录] 
 
- #    - 2012.01.03 By 仲秋启明 
 
- #      * 修改为VA定义 
 
- #    - 2011.12.27 By 仲秋启明 
 
- #      * 移植至RGSS3,遵循PS0协议; 
 
- #      * 优化数据库备注中设定方法 
 
- #    - 2011.08.22 By 冰舞蝶恋 
 
- #      * 蓝本(实用·极简 -- 按品质,给物品描绘色彩边框) 
 
- #    - 2010.08.06 By 仲秋启明 
 
- #      * 蓝本(物品颜色描绘脚本(完整无冲突版)) 
 
- #------------------------------------------------------------------------------ 
 
- # [使用方法] 
 
- #    - 替换原Window_Base中的draw_item_name定义或复制到Main之前 
 
- #============================================================================== 
 
- $_PS0 = {} if $_PS0 == nil   
 
- $_PS0["Window_Base_Itemcolor"] = 20111227 
 
- #============================================================================== 
 
- # [PS0] 通用配置模块   
 
- #============================================================================== 
 
- module PS0 
 
-   module Window_Base_Itemcolor 
 
-     Color1 = Color.new(255, 255, 255)  # 一般品质的色彩(白,1) 
 
-     Color2 = Color.new(128, 128, 255)  # 精良品质的色彩(蓝,2) 
 
-     Color3 = Color.new(170, 0, 255)    # 卓越品质的色彩(紫,3) 
 
-     Color4 = Color.new(255, 128, 0)    # 史诗品质的色彩(橙,4) 
 
-     Color5 = Color.new(255, 0, 200)    # 传说品质的色彩(粉,5) 
 
-   end 
 
- end 
 
- #============================================================================== 
 
- # ■ Window_Base 
 
- #============================================================================== 
 
- class Window_Base < Window 
 
-   def draw_item_name(item, x, y, enabled = true, width = 172) 
 
-     if item != nil 
 
-       n = item.note 
 
-       a = n.split{/<(?:Quality|品质)\s*(.+)>/i} 
 
-       c = a[1].to_i 
 
-       if c <= 1 
 
-         color = PS0::Window_Base_Itemcolor::Color1 
 
-       elsif c == 2 
 
-         color = PS0::Window_Base_Itemcolor::Color2 
 
-       elsif c == 3 
 
-         color = PS0::Window_Base_Itemcolor::Color3 
 
-       elsif c == 4 
 
-         color = PS0::Window_Base_Itemcolor::Color4 
 
-       elsif c == 5 
 
-         color = PS0::Window_Base_Itemcolor::Color5 
 
-       elsif c == 6 
 
-         color = PS0::Window_Base_Itemcolor::Color6 
 
-       elsif c == 7 
 
-         color = PS0::Window_Base_Itemcolor::Color7 
 
-       else 
 
-         color = Color.new(0, 0, 0, 0) 
 
-       end 
 
-       self.contents.fill_rect(x, y, 24, 1, color) 
 
-       self.contents.fill_rect(x, y, 1, 24, color) 
 
-       self.contents.fill_rect(x, y+23, 24, 1, color) 
 
-       self.contents.fill_rect(x+23, y, 1, 24, color) 
 
-       draw_icon(item.icon_index, x, y, enabled) 
 
-       change_color(color, enabled) 
 
-       draw_text(x + 24, y, width, line_height, item.name) 
 
-     end 
 
-   end 
 
- end 
 
- #============================================================================== 
 
- # [PS0] End of Script 
 
- #============================================================================== 
 
作者: VIPArcher    时间: 2017-1-19 12:51
 本帖最后由 VIPArcher 于 2017-2-7 12:02 编辑 
用这个脚本试试  https://viparcher.github.io/Hexo ... %E9%A2%9C%E8%89%B2/
然后那个物品得失脚本我猜你用的是 Yanfly Engine Ace - Event Window
如果是这个可以用下面的代码放在这个脚本的下面新建个脚本页,或者替换 event_window_make_item_text 方法
- class Game_Interpreter
 
-   #--------------------------------------------------------------------------
 
-   # new method: event_window_make_item_text
 
-   #--------------------------------------------------------------------------
 
-   def event_window_make_item_text(item, value)
 
-     return unless SceneManager.scene_is?(Scene_Map)
 
-     return if Switch.hide_event_window
 
-     if value > 0
 
-       text = YEA::EVENT_WINDOW::FOUND_TEXT
 
-     elsif value < 0
 
-       text = YEA::EVENT_WINDOW::LOST_TEXT
 
-     else; return
 
-     end
 
-     text += sprintf("\ei[%d]\ec[%d]%s\ec[0]", item.icon_index, VIPArcher::ItemColor::Color_Lv[item.color], item.name)
 
-     if value.abs > 1
 
-       fmt = YEA::EVENT_WINDOW::AMOUNT_TEXT
 
-       text += sprintf(fmt, value.abs.group)
 
-     end
 
-     event_window_add_text(text)
 
-   end
 
- end
未测试
作者: 百里_飞柳    时间: 2017-1-19 13:15
无条件同意楼上VIP女神的观点
这个截图……是我在微博晒的制作进度呀……
这个物品得失是我自己糊的自用脚本,并不打算公开,因为不想弄整合问题
然后同样推荐yea-event window,更加强大,除了在显示文字框时会出现消失的设定比较诡异外
作者: 世界第一中二    时间: 2017-1-20 15:22
 本帖最后由 世界第一中二 于 2017-1-20 15:27 编辑 
额,萌新经过测试……发现稍微有些问题,获得物品时显示的颜色和我设定的物品等级颜色不符,如下,上图
检验了两个道具的颜色两个都与设定不一样
另外我的道具颜色是这么设定的,用的是dalao写的道具颜色修改脚本
- #============================================================================== 
- # ★ 设定部分 ★ 
- #============================================================================== 
- module VIPArcher::ItemColor 
-   RIM = true #是否描绘边框 
-   FILL = true #是否填充边框 
-   #为了方便设置品质等级, 
-   Color_Lv = { 
- # 品质 => 控制符颜色编号, 
-     0  =>  0, 
-     1  =>  24, 
-     2  =>  1, 
-     3  =>  30, 
-     4  =>  14, 
-     5  =>  27, 
-     6  =>  18 
-     # 继续添加 
-   };Color_Lv.default = 0 #这行不能删 
- end 
- #============================================================================== 
 
- # ★ 设定部分 ★ 
 
- #============================================================================== 
 
- module VIPArcher::ItemColor 
 
-   RIM = true #是否描绘边框 
 
-   FILL = true #是否填充边框 
 
-   #为了方便设置品质等级, 
 
-   Color_Lv = { 
 
- # 品质 => 控制符颜色编号, 
 
-     0  =>  0, 
 
-     1  =>  24, 
 
-     2  =>  1, 
 
-     3  =>  30, 
 
-     4  =>  14, 
 
-     5  =>  27, 
 
-     6  =>  18 
 
-     # 继续添加 
 
-   };Color_Lv.default = 0 #这行不能删 
 
- end 
 
- 
{_QYGMDW]7WPXB_19TMWRXE.png
(263.07 KB, 下载次数: 51)
 
 
- 
X6S(%X4IHC_SB]05$HVG3AJ.png
(182.32 KB, 下载次数: 44)
 
 
作者: 世界第一中二    时间: 2017-2-8 22:22
谢谢dalao,已经解决了~
| 欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |