查看: 5655|回复: 3

[已经过期] 请问如何实现移动触发公共事件(附上自己写的失败插件)

[复制链接]
梦石
0
星屑
470
在线时间
271 小时
注册时间
2011-10-17
回帖
70
发表于 2017-6-30 14:18:32 | 显示全部楼层 |阅读模式

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

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

×
功能很简单,每移动一步,执行一下公共事件

个人想法是利用增加步数(Game_Player.prototype.increaseSteps)来修改

结果自己写的插件经测试完全没有反应,请大神指教

另外话说论坛怎么发代码的格式?


//=============================================================================
// MoveEvent
//
// Last Update: 2017.6.30
//=============================================================================

/*:
* @plugindesc Allows move trigger CommonEvent
* @author
*
* @param Common Event ID
* @default 12
*
* @help This plugin does not provide plugin commands.
*
*/

(function() {

  var CommonEventId = parseInt(parameters['Common Event ID'] || 12);


//增加步数
Game_Player.prototype.increaseSteps = function() {
    //游戏人物 增加步数 呼叫(this , x , y)
    Game_Character.prototype.increaseSteps.call(this);
    //如果( 是普通() )
    if (this.isNormal()) {
        //游戏队伍 增加步数()
        $gameParty.increaseSteps();
        $gameTemp.reserveCommonEvent(CommonEventId);//此处为我添加的内容
    }

};

})();
梦石
0
星屑
95
在线时间
256 小时
注册时间
2011-3-14
回帖
78
发表于 2017-7-4 17:20:25 | 显示全部楼层
加在if语句外试试?
回复

使用道具 举报

梦石
0
星屑
2306
在线时间
1010 小时
注册时间
2012-4-30
回帖
1455

开拓者

发表于 2017-7-4 18:00:13 | 显示全部楼层
本帖最后由 铅笔描绘的思念 于 2017-7-4 19:22 编辑

var CommonEventId = parseInt(parameters['Common Event ID']) || 12;


↑上面是猜的
不明原因。。独立成插件使用参数没效果。。怪


就是调用参数形式错了
[pre lang="javascript"]var CommonEventId = parseInt(PluginManager.parameters('MoveEvent')['CommonEventID']) || 12;[/pre]
回复

使用道具 举报

梦石
0
星屑
942
在线时间
218 小时
注册时间
2011-6-19
回帖
38
发表于 2017-7-4 18:23:27 | 显示全部楼层
楼主放错地方了
Game_Player.prototype.increaseSteps你的位置
Game_Party.prototype.increaseSteps计步
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部