Project1

标题: 怎麼獲得事件ID ? [打印本页]

作者: killGOF2    时间: 2015-10-25 18:09
标题: 怎麼獲得事件ID ?
事件Script
alert(Game_Interpreter.prototype.eventId)



有人可以教學一下嗎 ?

作者: unowoo    时间: 2015-10-25 19:25
$gameMap.events()可以获得当前地图的所有事件
作者: 喵呜喵5    时间: 2015-10-25 19:43
alert(Game_Interpreter.prototype.eventId())
作者: killGOF2    时间: 2015-10-25 20:43
本帖最后由 killGOF2 于 2015-10-25 20:44 编辑

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

this._mapId

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


alert(this._mapId)
作者: taroxd    时间: 2015-10-25 20:44
本帖最后由 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. })();
复制代码





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