查看: 3903|回复: 1

[已经解决] 请教下如何用脚本语言在游戏里更改角色武器和职业

[复制链接]
梦石
0
星屑
327
在线时间
187 小时
注册时间
2016-4-12
回帖
29
发表于 2016-5-17 19:36:36 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
看了https://rpg.blue/forum.php?mod=v ... p;extra=#pid2682548这位仁兄的问题,
突然很好奇,怎么改武器和职业
var actor = $gameActors.actor($gameVariables.value(8));
if (actor) {
      actor.setCharacterImage("yf", 0);
      actor.setFaceImage("yf", 0);
      actor.setBattlerImage("yf");
     加在这里actor.CharacterName = "名字";      结果名字变成空的了,而如果写actor.setCharacterName("yf");则直接出错了
}
$gamePlayer.refresh();

求大仙指点
梦石
0
星屑
1907
在线时间
1555 小时
注册时间
2013-4-13
回帖
783
发表于 2016-5-19 22:47:59 | 显示全部楼层

修改名字actor.setName(name)
源代码:
Game_Actor.prototype.setName = function(name) {
    this._name = name;
};
修改装备:
强制修改 actor.forceChangeEquip(slotId, item);
会覆盖原有的装备, 不可装备的物品也不会被自动卸下.
源代码:
Game_Actor.prototype.forceChangeEquip = function(slotId, item) {
    this._equips[slotId].setObject(item);
    this.releaseUnequippableItems(true);
    this.refresh();
};
还有其他的正常装备方式:
在rpg_objects.js中Game_Actor的部分找吧.

点评

slotId是指什么?装备槽ID还是装备的id?actor.forceChangeEquip(slotId, item);这句不会用,看蒙了  发表于 2016-5-22 13:14
夏普的道具店

塞露提亚-道具屋的经营妙方同人作品
发布帖:点击这里
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部