查看: 5521|回复: 4

[已经过期] 怎麼獲得事件ID ?

[复制链接]
梦石
0
星屑
50
在线时间
75 小时
注册时间
2015-2-2
回帖
12
发表于 2015-10-25 18:09:15 | 显示全部楼层 |阅读模式

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

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

×
事件Script
alert(Game_Interpreter.prototype.eventId)

ssssss.jpg

有人可以教學一下嗎 ?
梦石
0
星屑
50
在线时间
430 小时
注册时间
2010-8-15
回帖
15
发表于 2015-10-25 19:25:00 | 显示全部楼层
$gameMap.events()可以获得当前地图的所有事件
回复

使用道具 举报

梦石
1
星屑
23236
在线时间
9564 小时
注册时间
2012-6-19
回帖
7018

开拓者短篇九导演组冠军

发表于 2015-10-25 19:43:37 | 显示全部楼层
alert(Game_Interpreter.prototype.eventId())

点评

undefined  发表于 2015-10-25 20:38
回复

使用道具 举报

梦石
0
星屑
50
在线时间
75 小时
注册时间
2015-2-2
回帖
12
 楼主| 发表于 2015-10-25 20:43:08 | 显示全部楼层
本帖最后由 killGOF2 于 2015-10-25 20:44 编辑

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

this._mapId

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


alert(this._mapId)
回复

使用道具 举报

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-10-25 20:44:54 | 显示全部楼层
本帖最后由 taroxd 于 2015-10-25 21:00 编辑

console.log 原来是异步的,怪不得 console.log(this); 发现 _eventId 是 0
[pre lang="javascript"]console.log(this.eventId());[/pre]

以下为谜之 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. })();
复制代码
回复 1 0

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部