Project1

标题: 纯新手,求指点为什么脚本添加进去无用 [打印本页]

作者: q459354048    时间: 2017-11-8 16:10
标题: 纯新手,求指点为什么脚本添加进去无用
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#
# 脚本功能:给不同物品显示不同颜色,类似暗黑破坏神,比如套装为绿色,超级为金色
# 可以更改的种类包括物品、防具、特技、武器。
#
# 使用方法:对于不想为白色表示的物品,在描述中最后添加@6,@4一类的即可。
# 数字为颜色编号,和对话框中的一样。
# ——————————————————————————————————————
module RPG
class Skill
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Weapon
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Item
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name_color != nil ? name_color.to_i : 0
end
end
class Armor
def description
description = @description.split(/@/)[0]
return description != nil ? description : ''
end
def name_color_66RPG
name_color = @description.split(/@/)[1]
return name != nil ? name_color.to_i : 0
end
end
end
# ——————————————————————————————————————
我按照网上的教学把这个插入到了main的上面,
但是为什么还是没有作用
我物品备注也加了@3  游戏开始后没有显示@3但是也没有颜色

@3.png (10.64 KB, 下载次数: 25)

@3.png

作者: 心六    时间: 2017-11-8 16:18
本帖最后由 心六 于 2017-11-8 16:23 编辑

试试在红色格里的备注写上@3。




另外,要习惯善用[添加代码文字]功能,使用在脚本内容上。
  1. 效果
复制代码


作者: q459354048    时间: 2017-11-8 16:25
心六 发表于 2017-11-8 16:18
试试在红色格里的备注写上@3。



刚刚试了一下,仍然没用
作者: 心六    时间: 2017-11-8 16:33
本帖最后由 心六 于 2017-11-8 16:35 编辑
q459354048 发表于 2017-11-8 16:25
刚刚试了一下,仍然没用

抱歉,刚刚没有详细看主楼内容就回复了,这个脚本只能在RPG Maker XP使用的,不能在RPG Maker VX Ace上使用。

不过可以尝试使用这个脚本,
【物品描绘品质颜色】


作者: soulsaga    时间: 2017-11-8 16:35
LZ你这个脚本是XP用的吧..VA的在这..
https://rpg.blue/thread-217113-1-1.html
作者: chd114    时间: 2017-11-8 19:54
你的脚本明显缺了一部分在显示名字、描述时改字体颜色的吧···

  1. class Armor
  2. def description
  3. description = @description.split(/@/)[0]
  4. return description != nil ? description : ''
  5. end
  6. def name_color_66RPG
  7. name_color = @description.split(/@/)[1]
  8. return name != nil ? name_color.to_i : 0
  9. end
  10. end
复制代码
这些只是读取颜色编号,然后获取名字/描述的时候不会把@颜色代码会算进去
作者: q459354048    时间: 2017-11-9 00:37
好吧,感谢各位的解答。原来是版本的问题




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