Terms of Use
Any plugins developed by taaspider are free for use for both commercial and noncommercial RPG Maker games, unless specified otherwise. Just remember to credit "taaspider".
Redistribution of parts or the whole of taaspider plugins is forbidden (which also includes reposting), unless it comes from the official website (linked within the post). You are allowed to edit and change the plugin code for your own use, but you're definitely not allowed to sell or reuse any part of the code as your own. Although not required to use my plugins, a free copy of your game would be nice!
Introduction
Replicating frequent event through your game can be quite time consuming, specially if you find yourself in need of updating all of them. Be it a visual encounter, a chest, an item or NPC, this kind of work can become quite time consuming, but reflecting in little to no progress in a project.
TAA_EventTemplates brings two important features:
The ability to set an event to automatically copy another (which serves as a template), so that if you ever need to change that chest behavior you can just alter the template. Wherever that template is referenced will be automatically updated the next time you start your game;
The ability to transform an event into a template. This feature lets you organize your events with less pages and care for your game's progress in a more organized way. Or even change how an event from another map behaves completely without being limited to switchs and variables.
You can also test the plugin using my sample demo project. It was built with MV, but you can open it with MZ as well (just open the game.rmmzproject file and you're good to go).
Spoiler: Instructions
Everything is based on event templates. The first thing you need to do is create a few maps to serve as a template sheet. You can create any number of maps you want, and even give them names, which you can later use to load your event templates!
On each of your map templates, create and organize the events you need. As with maps, events can be given a name, which can be used to reference it later. Just make sure that the combination of "Map Name" and "Event Name" are unique, otherwise we may run into trouble later. Then open the Plugin Manager and fill the only plugin parameters displayed with the map IDs from your template maps.
After that, just use note tags and plugin commands to reference one of your templates.
Be careful though: transforming an event into another do not alter the self switches states. So if the event's self switch A is on, for example, transforming it into another event won't change that. The event ID and Name are also not changed (so you can still reference them in move route commands, for example).
Also, event transformations are automatically saved and load any time the event is loaded again. That means that going out and back from the current map won't reset the transformation. The only way to do that is through explicit plugin commands.
WARNING: Map and event names cannot contain either the , or > symbols. If you're an MV user, I'd advise against creating names containing blank spaces, as that will make them unreachable through plugin commands.
If you're using MZ blank spaces are not a problem (, and > are still a no no though).
Spoiler: Event Note Tags
Setting a note tag in an event will cause it to automatically transform into the referenced template the first time it is loaded (as long as the map and event keys provided exists within our templates).
The basic note tag is as follows:
<TAA_EVT: mapKey,eventKey >
mapKey can be either the map template ID or its name. The same applies to eventKey (event ID or event name). Keep in mind that if you choose to reference them by name their name is case sensitive and the combination of both must be unique for this to work properly.
Remember: self switch states won't change when an event is transformed. When talking about note tags, that means that an event will always load with all self switches turned off, at least initially. But what if, for some reason, we want it to turn one of them on by default?
That can also be done with note tags:
<TAA_EVT: mapKey, eventKey, sw:abcd>
sw:abcd means that all four self switches will be turned on by default. If you don't want all, but just one of them to be turned on, just list it and not the others. For example:
<TAA_EVT: map1,event1,sw:A>
here we're loading event1 from map1 with self switch A already on.
<TAA_EVT: map1,event1,sw:cd>
and here we're loading the same event, but with switches C and D turned on.
Spoiler: Script Calls
$gameSystem.getMapIdByName(mapName)
If the given mapName corresponds to an existing map, returns its ID. Otherwise returns 0.
$gameSystem.hasEventTemplateData(mapId, eventId)
Returns true if the given map and event IDs (no names allowed) have a saved transformation registered. Otherwise false.
$gameSystem.deleteEventTemplatesData(mapId, eventId)
If the given Ids have saved transformations they are deleted. That means the next time this event is loaded it will be reset to its original form.
$gameSystem.transformLocalEvent(eventId, mapKey, eventKey, noHistory)
Transforms the event referenced by eventId (ID only, name not allowed) from the current map into the template referenced by mapKey and eventKey (names are allowed for this two). noHistory determines if the change must be saved in the event's records, allowing you to undo the transformation later. If false the transformation WILL BE remembered, if true it won't.
$gameSystem.transformRemoteEvent(mapId, eventID, mapKey, eventKey, noHistory)
Works in a very similar way to transformLocalEvent, only now it's applied to events from another map (that's why in this case you need to specify the mapId).
$gameSystem.rollbackLocalEvent(eventId, n)
Undo n transformations for the event referenced by eventId (no name allowed). If no records of previous forms are found, the command is ignored.
$gameSystem.rollbackRemoteEvent(mapId, eventId, n)
Same as rollbackLocalEvent, only for another maps.
$gameSystem.resetLocalEvent(eventId)
Ignores any saved data for the event eventId loacted in the current map and restores it to its original form.
$gameSystem.resetRemoteEvent(mapId, eventId)
Same as resetLocalEvent, only for events loacted in another maps.
Spoiler: PLUGIN COMMANDS
Transform Local Event
Triggers a transformation for an event located in the current map.
Transform Remote Event
Triggers a transformation for an event in a specific map (not the current one).
Rollback Local Event
Undo any number of transformations for an event located in the current map.
Rollback Remote Event
Undo any number of transformations for an event in a specific map (not the current one).
Reset Local Event
Resets an event in the current map to its original form.
Reset Remote Event
Resets an event in any specific map to its original form.