赞 | 7 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 6845 |
最后登录 | 2017-5-20 |
在线时间 | 161 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 161 小时
- 注册时间
- 2016-7-24
- 帖子
- 80
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
这个应该从哪里开始复制,设置也不是很懂,插件不懂,求指导
这个插件让你在地图上,加载地图时,将运行一个简单的eval notetag。
介绍
这个插件让你在地图上,加载地图时,将运行一个简单的eval notetag。另外,您也可以设置多达十evals,将每个任何地图加载时运行。请记住,地图加载中发生多次为一个给定的步行通过。每次打开菜单的时间,例如,地图负荷将再次触发。这不应该被用来做一些仅仅是你第一次加载地图,但更多的,你需要在地图上(一般事件设置)的每个重载做的事情。
用法
通过以下notetag添加evals到您的地图:
Map > Notebox > <ON LOAD>code</ON LOAD>
它就是这么简单。你的eval代码现在每次运行的地图加载。另外请注意,“负载”可与“OML”,“地图载入”取代,或“ON地图载入”你的自由裁量权。
这里有几个例子...
<On Load>events.forEach(function(event) {if (event.displayName == "Sneak Thief") event._opacity = 32;});</On Load>
<oml>if (v[123] > 4)$gameTemp.reserveCommonEvent(56);</oml>
在第一个例子,用“贼偷袭”的显示名称的任何事件将在一个非常透明的外观。第二示例运行一个共同的事件,如果一个变量大于4。
支持作者
电子邮件[email protected]
插件
//=============================================================================
// NeMV -地图加载
// NeMV_OnMapLoad.js
//=============================================================================
var Imported = Imported || {};
Imported.NeMV_OnMapLoad = true;
var NeMV = NeMV || {};
NeMV.OML = NeMV.OML || {};
//=============================================================================
/*:
* @plugindesc V1.0.0一个非常简单的插件,它允许你运行JavaScript evals时,地图加载。
* @author Nekoyoubi
*
* @param ---Map Load Evals---
* @default
*
* @param OML Eval 1
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 2
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 3
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 4
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 5
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 6
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 7
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 8
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 9
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @param OML Eval 10
* @desc Set an eval that will be run on every map load.
* Example: if (v[123]>4) $gameTemp.reserveCommonEvent(56);
* @default
*
* @help
* ============================================================================
* Introduction
* ============================================================================
*
* This plugin gives you a simple notetag eval on your maps that will run when
* the map is loaded. Optionally, you can also setup up to ten evals that will
* run each time any map is loaded. Keep in mind that map loading happens many
* times for a given walk-through. Each time you open the menu, for instance,
* the map load will trigger again. This should not be used for doing something
* merely the first time you load a map, but more for things you need to do
* on each reload of the map (typically event settings).
*
* ============================================================================
* Usage
* ============================================================================
*
* Add load evals to your maps via the following notetag:
*
* Map > Notebox > <ON LOAD>code</ON LOAD>
*
* It's as easy as that. Your eval code will now run everytime that map is
* loaded. Also note that the "ON LOAD" can be replaced with "OML", "MAP LOAD",
* or "ON MAP LOAD" to your discretion.
*
* Here are a couple of examples...
*
* <On Load>
* events.forEach(function(event) {
* if (event.displayName == "Sneak Thief") event._opacity = 32;
* });
* </On Load>
*
* <oml>
* if (v[123] > 4)
* $gameTemp.reserveCommonEvent(56);
* </oml>
*
* In the first example, any events with the display name of "Sneak Thief" will
* take on a very transparent appearance. The second example runs a common
* event if a variable is greater than four.
*
* ============================================================================
* Support
* ============================================================================
*
* Should this plugin not work for you for any reason, please notify me by
* creating a GitHub issue, emailing me at lance-at-nekoyoubi.com, or message
* me in any social convention you happen to see me in.
*
* Thanks, and happy loading!
*
* ============================================================================
* Changelog
* ============================================================================
*
* Version 1.0.0:
* - initial plugin
*
*/
//=============================================================================
NeMV.OML.Parameters = PluginManager.parameters('NeMV_OnMapLoad');
NeMV.OML.Param = NeMV.OML.Param || {};
NeMV.OML.Param.Evals = [];
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 1']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 2']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 3']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 4']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 5']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 6']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 7']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 8']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 9']));
NeMV.OML.Param.Evals.push(String(NeMV.OML.Parameters['OML Eval 10']));
NeMV.OML.Scene_Map_onMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function() {
NeMV.OML.Scene_Map_onMapLoaded.call(this);
NeMV.OML.Param.Evals.forEach(function(ev) {
if (ev !== null && ev.length > 1)
NeMV.OML.evalMapLoad(ev);
});
var omlTag = /<(?:((?:ON)?\s*(?:MAP)?\s*LOAD)|OML)>([\s\S]*)<\/\1>/im;
omlMatch = $dataMap.note.match(omlTag);
if (omlMatch) NeMV.OML.evalMapLoad(omlMatch[2]);
};
NeMV.OML.evalMapLoad = function(code) {
var map = $gameMap;
var s = $gameSwitches._data;
var v = $gameVariables._data;
var events = $gameMap.events();
eval(code);
}; |
|