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

Project1

 找回密码
 注册会员
搜索
查看: 2513|回复: 3
打印 上一主题 下一主题

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

[复制链接]

Lv2.观梦者

梦石
0
星屑
470
在线时间
271 小时
注册时间
2011-10-17
帖子
99
跳转到指定楼层
1
发表于 2017-6-30 14:18:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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

个人想法是利用增加步数(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);//此处为我添加的内容
    }

};

})();

Lv1.梦旅人

梦石
0
星屑
80
在线时间
254 小时
注册时间
2011-3-14
帖子
85
2
发表于 2017-7-4 17:20:25 | 只看该作者
加在if语句外试试?
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1309
在线时间
962 小时
注册时间
2012-4-30
帖子
1475

开拓者

3
发表于 2017-7-4 18:00:13 | 只看该作者
本帖最后由 铅笔描绘的思念 于 2017-7-4 19:22 编辑

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


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


就是调用参数形式错了
JAVASCRIPT 代码复制
  1. var CommonEventId = parseInt(PluginManager.parameters('MoveEvent')['CommonEventID']) || 12;
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
927
在线时间
217 小时
注册时间
2011-6-19
帖子
43
4
发表于 2017-7-4 18:23:27 | 只看该作者
楼主放错地方了
Game_Player.prototype.increaseSteps你的位置
Game_Party.prototype.increaseSteps计步
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-24 14:49

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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