Introduction
WARNING: This plugin is best used with RPG Maker MV 1.5.0 or above! This is because the MV 1.5.0 editor allows for this plugin to be made in an orderly and efficient manner. Please make sure your RPG Maker MV software is up to date before using this plugin to make the most out of it.
警告:此插件最适用于RPG Maker MV 1.5.0或更高版本!在使用此插件充分利用它之前,请确保您的RPG Maker MV软件是最新的。
While in RPG Maker MV, there’s the ability to make events hidden and reveal themselves to make it look like they’ve spawned out of nothing. However, there isn’t an innate function to actually spawn an event from nothing. This plugin will provide users the ability to actually spawn an event that is premade and ready from another map(s).
在RPG Maker MV中,有的事件似乎并不存在但却突然出现。实际上该插件将为用户提供了另一个地图预制事件的能力。
A spawned event will contain all the data from its original source, from the event’s page conditions to the event commands to the graphical settings. And should the original source be updated in the future, the spawned event will update as well. Spawned events can also be preserved and remain on the map if the player reenters the map or reloads a save.
生成的事件将包含其原始源的所有数据,从事件的页面条件到事件命令再到图形设置。如果更新原始源,则生成的事件也将更新。如果玩家重新进入地图或重新加载保存,则也可以保留已生成的事件并保留在地图上。
More information will be explained in the Instructions section of this plugin’s help file.
更多信息将在此插件帮助文件“说明”部分中。
Instructions
Use the plugin parameter ‘Template Maps’ to select which maps your game will preload maps from. These maps will contain the events that you want other events to spawn as. Any kind of event can be used as a spawn template, from trigger events to auto run events to parallel events.
使用插件参数“模板地图”选择游戏将从中预加载地图的地图。这些地图将包含您希望生成的事件。任何类型的事件都可以用作生成模板,从触发事件、自动运行事件再到并行事件。
If you are using RPG Maker MV 1.5.0+ and wish to make use of template names, add them through the ‘Template Names’ plugin parameter. The data from the Template Names parameters can be changed and all events in-game that use script calls with the respective Template Name will be updated accordingly.
如果您正在使用RPG Maker MV 1.5.0+并希望使用模板名称,请通过“模板名称”插件参数添加它们。可以更改模板名称参数中的数据,并且相应地更新具有相应模板名称的脚本调用的游戏中所有事件。
——————–
Spawning Limitations
——————–
However, there are some rules that must be applied before an event can be spawned at a desired location. They are as follows:
The spawn location must not be occupied by another event, even if the event is of a different priority level. This is to prevent overstacking and causing problems for the RPG Maker MV engine.
The spawn location cannot have a vehicle present. This is to prevent priority conflicts with the event when triggered.
The spawn location must exist on the map. It cannot have coordinates that are outside of the map’s boundaries.
As long as these rules are followed, the event will spawn properly provided you follow the format used for the Script Calls listed in the section below.
但是,在事件生成之前,必须遵守以下规则:
1.即使事件具有不同的优先级,生成的位置也不能被其他事件占用。这是为了防止重叠导致RPG Maker MV引擎出现问题。
2.生成地点不能有交通工具存在。这是为了防止在触发时与事件发生优先级冲突。
3.生成位置必须存在于地图上。它不能在地图边界之外的坐标。
只要遵循这些规则,并使用脚本调用格式,事件就会正确衍生。
Script Calls
To spawn events into your maps, use the following script calls:
要将事件生成到地图中,请使用以下脚本调用:
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Spawn Event – Script Calls
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
This will spawn a new event using the information from ‘mapId’ ‘eventId’ as its base. The new event’s ID will start at 1001 (or whatever you’ve set the plugin parameter ‘ID Starting Range’ to) and onward.
使用'mapId''eventId'中的信息作为其基础来生成新事件。新事件的ID将从1001开始(或者您在插件参数'ID Starting Range'设置参数。
– – –
Yanfly.SpawnEventAt(mapId, eventId, x, y, preserved)
– This will spawn the desired event into the specific coordinates.
– Replace ‘mapId’ with the ID of the map with the event to morph into.
– Replace ‘eventId’ with the ID of the event to morph the target into.
– Replace ‘x’ with the X position on the map to spawn the event at.
– Replace ‘y’ with the Y position on the map to spawn the event at.
– The X and Y positions MUST NOT have an event present at that location.
– Replace ‘preserved’ with ‘true’ or ‘false’ to preserve the spawn.
- 这会将所需的事件产生到特定的坐标中。
- 将'mapId'替换为地图ID。
- 将'eventId'替换为事件的ID。
- 将'x'替换为地图上的X位置以衍生事件。
- 将'y'替换为地图上的Y位置以衍生事件。
- X和Y位置不得在该位置存在事件。
- 将'保留'替换为'true'或'false'以保留衍生。
Example: Yanfly.SpawnEventAt(1, 5, 30, 40, true)
– Map 1’s Event 5 will be spawned at X, Y coordinates: 30, 40.
– This event will be preserved.
- 地图1的事件5将在30,40处衍生。
- 此事件将被保留。
Example: Yanfly.SpawnEventAt(2, 10, 50, 60, false)
– Map 2’s Event 10 will be spawned at X, Y coordinates: 50, 60.
– This event will NOT be preserved.
- 地图2的事件10将在50,60处衍生。
- 此事件将不会被保留。
– – –
Yanfly.SpawnEventTemplateAt(template, x, y, preserved)
– This will spawn the desired event by template name at the coordinates.
– Replace ‘template’ with a name from the ‘Template Names’ plugin param. This must be in ‘string’ form (surround the name with quotes).
– Replace ‘x’ with the X position on the map to spawn the event at.
– Replace ‘y’ with the Y position on the map to spawn the event at.
– The X and Y positions MUST NOT have an event present at that location.
– Replace ‘preserved’ with ‘true’ or ‘false’ to preserve the spawn.
- 这将在坐标处按模板名称生成所需的事件。
- 将“模板”替换为“模板名称”插件参数中的名称。这必须是“字符串”形式(用引号括起名称)。
- 将'x'替换为地图上的X位置以衍生事件。
- 将'y'替换为地图上的Y位置以衍生事件。
- X和Y位置不得在该位置存在事件。
- 将'保留'替换为'true'或'false'。
Example:Yanfly.SpawnEventTemplateAt(‘StrawberryPlant’, 30, 40, true)
– The ‘StrawberryPlant’ template from the plugin parameters will be spawned at X, Y coordinates: 30, 40.
– This event will be preserved.
- 插件参数中的'StrawberryPlant'模板将在30,40衍生
- 此事件将被保留。
Example: Yanfly.SpawnEventTemplateAt(‘MineralVein’, 50, 60, false)
– The ‘MineralVein’ template from the plugin parameters will be spawned at X, Y coordinates: 50, 60.
– This event will NOT be preserved.
- 插件参数中的'MineralVein'模板将在50,60处衍生
- 此事件不会被保留。
– – –
Yanfly.SpawnEventInRegion(mapId, eventId, region, preserved)
– This will spawn the desired event at a random place within a region(s).
– Replace ‘mapId’ with the ID of the map with the event to morph into.
– Replace ‘eventId’ with the ID of the event to morph the target into.
– Replace ‘region’ with the ID of the region to spawn the event into. If you want to use multiple regions, place them in an array.
– Replace ‘preserved’ with ‘true’ or ‘false’ to preserve the spawn.
- 这将在一个区域内的随机位置产生所需的事件。
- 将'mapId'替换为地图ID。
- 将'eventId'替换为事件的ID。
- 将'region'替换为要将事件生成的区域的ID。如果要使用多个区域,请将它们放在一个数组中。
- 将'保留'替换为'true'或'false'以保留衍生
Example: Yanfly.SpawnEventInRegion(1, 5, 20, true)
– Map 1’s Event 5 will be spawned at a random point in region 20.
– This event will be preserved.
- 地图1的事件5将在区域20的随机点衍生
- 此事件将被保留。
Example: Yanfly.SpawnEventInRegion(2, 10, [20, 25], true)
– Map 2’s Event 10 will be spawned at a random point in regions 20 or 25.
– This event will NOT be preserved.
- 地图2的事件10将在区域20或25中的随机点衍生
- 此事件将不会被保留。
– – –
Yanfly.SpawnEventTemplateInRegion(template, region, preserved)
– This will spawn the desired event at a random place within a region(s).
– Replace ‘template’ with a name from the ‘Template Names’ plugin param. This must be in ‘string’ form (surround the name with quotes).
– Replace ‘region’ with the ID of the region to spawn the event into. If you want to use multiple regions, place them in an array.
– Replace ‘preserved’ with ‘true’ or ‘false’ to preserve the spawn.
- 这将在区域内的随机位置产生所需的事件。
- 将“模板”替换为“模板名称”插件参数中的名称。这必须是“字符串”形式(用引号括起名称)。
- 将'region'替换为要将事件生成的区域的ID。如果要使用多个区域,请将它们放在一个数组中。
- 将'保留'替换为'true'或'false'以保留衍生
Example: Yanfly.SpawnEventTemplateInRegion(‘StrawberryPlant’, 20, true)
– The ‘StrawberryPlant’ template from the plugin parameters will be spawned at a random point in region 20.
– This event will be preserved.
- 插件参数中的'StrawberryPlant'模板将在区域20中的随机点衍生
- 此事件将被保留。
Example: Yanfly.SpawnEventTemplateInRegion(‘MineralVein’, [20, 25], true)
– The ‘MineralVein’ template from the plugin parameters will be spawned at a random point in regions 20 or 25.
– This event will NOT be preserved.
- 插件参数中的'MineralVein'模板将在区域20或25中的随机点衍生
- 此事件不会被保留。
– – –
- Note: If a spawned event is preserved, it will remain on that map when the map is reloaded from a save file or revisited from a different map. If an event is set up to not be preserved, it will automatically despawn itself upon leaving the map.
*注意:如果保留了衍生事件,则当从保存文件重新加载地图或从其他地图重新访问地图时,它将保留在该地图上。如果事件设置为不保留,它将在离开地图时自动消失。
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Obtaining Spawned Event Data – Script Calls
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
$gameMap.event(eventId)
– This will grab the event as an object.
– Replace ‘eventId’ with the ID of the event you wish to grab.
– ID’s past 1000 (or whatever you’ve set it to in the plugin parameters) are spawned events.
- 这会将事件作为对象获取。
- 将'eventId'替换为您想要抓取的事件的ID。
- ID过去的1000(或者您在插件参数中设置的任何内容)都是生成的事件。
– – –
$gameMap.FirstSpawnedEvent()
– This will grab the first available spawned event as an object.
– If the first event has been despawned, the next on in the list will be returned as an object. If there are no spawned events left, this script call will return an undefined value.
- 这将抓取第一个可用的衍生事件作为对象。
- 如果第一个事件已经被删除,则列表中的下一个事件将作为对象返回。如果没有生成的事件,则此脚本调用将返回未定义的值。
– – –
$gameMap.FirstSpawnedEventID()
– This will grab the first available spawned event’s ID as a number.
– If the first event has been despawned, the next on in the list will be returned as a number. If there are no spawned events left, this script call will return a value of 0.
- 这将获取第一个可用的衍生事件ID作为数字。
- 如果第一个事件已经被删除,则列表中的下一个事件将作为数字返回。如果没有生成的事件,则此脚本调用将返回值0。
– – –
$gameMap.LastSpawnedEvent()
– This will grab the last available spawned event as an object.
– If the last event has been despawned, the previous event in the list will be returned as an object. If there are no spawned events left, this script call will return an undefined value.
- 这将抓取最后一个可用的衍生事件作为对象。
- 如果最后一个事件已被删除,则列表中的上一个事件将作为对象返回。如果没有生成的事件,则此脚本调用将返回未定义的值。
– – –
$gameMap.LastSpawnedEventID()
– This will grab the last available spawned event’s ID as a number.
– If the last event has been despawned, the previous event ID on in the list will be returned as a number. If there are no spawned events left, this script call will return a value of 0.
- 这将获取最后一个可用的衍生事件的ID作为数字。
- 如果最后一个事件已被删除,则列表中的上一个事件ID将作为数字返回。如果没有生成的事件,则此脚本调用将返回值0。
– – –
$gameSystem.getMapSpawnedEventTotal()
– Returns the total number of spawned events on that map ever (this number will include the spawned events that have despawned).
- 返回该地图上产生的事件总数(此数字将包括已经生成的已生成的事件)。
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Despawn Event – Script Calls
– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –
Yanfly.DespawnEventID(eventId)
– Despawn a target spawned event if you have the spawned event’s ID.
– Replace ‘eventId’ with the spawned event’s ID.
- 如果您有衍生事件的ID,则消除目标生成事件。
- 将'eventId'替换为衍生事件的ID。
Example: Yanfly.DespawnEventID(1001)
– This will despawn event 1001 on the current map.
– The latest spawned event is no longer preserved.
- 这将在当前地图上消除事件1001。
- 不再保留最新的衍生事件。
Example:Yanfly.DespawnEventID($gameMap.LastSpawnedEventID())
– This will despawn the last spawned event based on ID on the current map.
– Event 1001 is no longer preserved.
- 这将根据当前地图上的ID消除最后生成的事件。
- 不再保留事件1001。
– – –
Yanfly.DespawnEvent(event)
– Despawn a target spawned event object.
– Replace ‘event’ with the spawned event object.
- 消除一个目标生成的事件对象。
- 用生成的事件对象替换'event'。
Example: Yanfly.DespawnEvent($gameMap.FirstSpawnedEvent())
– This will despawn the first spawned event on the current map.
– First spawned event is no longer preserved.
- 这将消除当前地图上的第一个衍生事件。
- 不再保留第一个产生的事件。
– – –
Yanfly.ClearSpawnedEvents()
– Clears the current map of all spawned events.
- 清除当前地图的所有衍生事件。
– – –
Yanfly.ClearSpawnedEvents(mapId)
– Clears a specific map of all spawned events.
– Replace ‘mapId’ with the mpa you wish to clear of spawned events.
- 清除特定地图的所有衍生事件。
- 将'mapId'替换为您希望清除衍生事件的地图ID。
Example: Yanfly.ClearSpawnedEvents(10)
– Clears all spawned events on map 10.
- 清除地图10上的所有衍生事件。
- Note: When a spawned event is despawned, any preserved data will also be removed in addition to the removed spawned event.
*注意:当生成事件时,除了已删除的衍生事件之外,还将删除任何保留的数据。