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

Project1

 找回密码
 注册会员
搜索

怎麼獲得事件ID ?

查看数: 4585 | 评论数: 4 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2015-10-25 18:09

正文摘要:

事件Script alert(Game_Interpreter.prototype.eventId) 有人可以教學一下嗎 ?

回复

taroxd 发表于 2015-10-25 20:44:54
本帖最后由 taroxd 于 2015-10-25 21:00 编辑

console.log 原来是异步的,怪不得 console.log(this); 发现 _eventId 是 0
JAVASCRIPT 代码复制
  1. console.log(this.eventId());


以下为谜之 Plugin Command 功能

  1. // Plugin Command: eventID x
  2. // assign eventID to variable x

  3. (function() {

  4.     var _pluginCommand = Game_Interpreter.prototype.pluginCommand;
  5.     Game_Interpreter.prototype.pluginCommand = function(command, args) {
  6.         _pluginCommand.call(command, args);
  7.         if (command === "eventID") {
  8.             $gameVariables.setValue(parseInt(args[0]), this.eventId());
  9.         }
  10.         return true;
  11.     };

  12. })();
复制代码
killGOF2 发表于 2015-10-25 20:43:08
本帖最后由 killGOF2 于 2015-10-25 20:44 编辑

試了很久才發現了....

this._mapId

原來在事件Script裡
Game_Interpreter 要加上 this.  才能呼叫(;´Д`)


alert(this._mapId)
喵呜喵5 发表于 2015-10-25 19:43:37
alert(Game_Interpreter.prototype.eventId())

点评

undefined  发表于 2015-10-25 20:38
unowoo 发表于 2015-10-25 19:25:00
$gameMap.events()可以获得当前地图的所有事件
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

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

GMT+8, 2024-9-20 16:53

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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