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

Project1

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

[已经解决] 地图加载这个看不懂 求帮助

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
161 小时
注册时间
2016-7-24
帖子
80
跳转到指定楼层
1
发表于 2016-8-9 10:00:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

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);

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

本版积分规则

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

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

GMT+8, 2024-12-1 05:02

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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