Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,349
Reaction score
1,633
First Language
English
Primarily Uses
RMMZ

Event Spawner - Version 1.6
RPG Maker MV Plugin
Galv

Introduction
Spawn events from one map to the map the player is on.


Screenshot
event-spawner_zpsybgkovgj.jpg



Features
This plugin adds the ability to duplicate/spawn events from a specified “Spawn Map” to the current map the player is on.
These events can be temporary (which disappear when player leaves the map) or permanent (they remain even when player leaves the map and returns) and can be cleared with script commands if required.
Events can be spawned to a specific x,y location or a random tile with specified region ID.
Self-Switches work with spawned events.


How To Use
- Copy the "GALV_EventSpawner.js" file into your project's /js/plugins/ folder.
- Activate plugin using the 'Plugin Manager'
- Read the help file and examine the demo to learn how it works.


Plugin
Get it here


Credit and Thanks
- Galv


Terms
Free to use in any RPG Maker MV project including commercial. Please credit "Galv".
smile.png



Updates
2017-06-24 - Version 1.6 - added ability to get last spawned event ID and store it in variable
2017-01-21 - Version 1.5 - fixed a bug clearning events on a different map
2016-11-08 - Version 1.4 - fixed incorrect documentation
2016-07-25 - Version 1.3 - create event note meta each time an event is spawned
2016-05-15 - Version 1.1 - fixed issue where events wouldn't spawn at y2
2016-05-15 - Version 1.0 - release
 
Last edited:

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
830
First Language
English
Primarily Uses
Hey Galv, you may want to consider adding this to your code so meta can be read from spawned events:


alias_DataManager_onLoad = DataManager.onLoad;
DataManager.onLoad = function (object) {
alias_DataManager_onLoad.call(this, object);
var array;
if (object === $dataSpawnMap) {
this.extractMetadata(object);
array = object.events;
} else {
array = object;
}
if (Array.isArray(array)) {
for (var i = 0; i < array.length; i++) {
var data = array;
if (data && data.note !== undefined) {
this.extractMetadata(data);
}
}
}
};


Needed to write this because I wanted to read a meta tag from spawned events
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
How am I able to associate the map ID? The default is 1- but If I am doing this in a project that already has maps made, how can I correct this?
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
830
First Language
English
Primarily Uses
How am I able to associate the map ID? The default is 1- but If I am doing this in a project that already has maps made, how can I correct this?

When you select a map in the editor the id is located at the bottom. Put the id of the map you want to spawn events from in the parameter, without the leading zeros.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
OK I've got the map ID Fixed, but the event is parent null etc.


I think the project is having diffculty spawning the event itself now- I have a single event in the map with the asssociated ID.


I want it to spawn on regions i have painted on a map but I don't know how to associate the event with the script call.
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
830
First Language
English
Primarily Uses
OK I've got the map ID Fixed, but the event is parent null etc.


I think the project is having diffculty spawning the event itself now- I have a single event in the map with the asssociated ID.


I want it to spawn on regions i have painted on a map but I don't know how to associate the event with the script call.

You just use the event id. Script command examples are in the help documentation for the plugin.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
OK I have the map ID for spawning as map  026:Spawn Map (17x13)


The event in the map is 001:Crazy Chicken


The region I want it to spawn randomly on is 13


The script call I have on a local event on the different map (Map ID 25) is:


// Spawn event with ID 1 on region 13, temp


Galv.SPAWN.event(1,13,false);


When I try to activate the event to initiate the script command I recieve this error:


Cannot read property 'parent' of null


Now I know null means virtually "nothing" but the rest makes no sense to me- I've copied over what I needed and have been going back and forth reading the help list, but I'm stuck at this point.
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
830
First Language
English
Primarily Uses
Post screenshots of your setup
 
Last edited by a moderator:

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
I hope my colour linking helps make he process a little more understandable from my view point.

problemo.png
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
830
First Language
English
Primarily Uses
It looks perfectly setup, so getting an error is strange.


Are you using any other plugins? Try turning some off.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
Now that you mention it I have other plugins that use events for lighting and effects etc, but the numbers I used for the event spawn aren't the same ones I have dictated for the other events. I will work on turning some off for the moment to see if anything changes.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
Strange, I had all my plugins turned off. it works now- but the moment I turn on YEP Event mini label plugin, it brings up the null error message.
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
830
First Language
English
Primarily Uses
Strange, I had all my plugins turned off. it works now- but the moment I turn on YEP Event mini label plugin, it brings up the null error message.

I'm not getting any error with YEP mini label. Did you do anything special with it?
 
Last edited by a moderator:

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
I haven't changed anything with it, with it turned off/removed all other plugins work fine.


My next issue is combined with the graphics randomizer selection request I made,




At this point I need each event spawned to do a random hand out on what graphics it will be appointed with. If I have a moveroute option with a graphic change done in common event setting for 'this event' it changes the graphic on the spawn event creator instead of spawns themselves.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
Sorry to add further confusion, for some reason the plugin is now having conflicts with Terrax lighting plugin. I will investigate to see if there is a fix.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,349
Reaction score
1,633
First Language
English
Primarily Uses
RMMZ
Hey Galv, you may want to consider adding this to your code so meta can be read from spawned events:



alias_DataManager_onLoad = DataManager.onLoad;
DataManager.onLoad = function (object) {
alias_DataManager_onLoad.call(this, object);
var array;
if (object === $dataSpawnMap) {
this.extractMetadata(object);
array = object.events;
} else {
array = object;
}
if (Array.isArray(array)) {
for (var i = 0; i < array.length; i++) {
var data = array;
if (data && data.note !== undefined) {
this.extractMetadata(data);
}
}
}
};


Needed to write this because I wanted to read a meta tag from spawned events





Thanks - I added ran the extraMetadata function from the spawn event when it gets created instead. Please let me know if this works for you.


@Skurge if you are having issues, make sure to try changing the position of the plugins in your plugin list to see if it has an effect.


I will look into terrax lighting plugin to see if I can make them compatible when I get some time freed up
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
Thank you for checking in and for all your service, I look forward to that bug fix if there is anything- in the mean time I'll try some more with rearranging the plugins.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
Been doing bug testing and plugin rearranging again for a couple of hours. All my efforts seem to be stumped- I can assume it has to be the terrax lighting having conflicts.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,349
Reaction score
1,633
First Language
English
Primarily Uses
RMMZ
I have tested tarrax lighting with this plugin now and they both work together. The lighting system doesn't detect the spawned events, though.


I recommend asking Terrax to update his plugin to reference $gameMap events instead of $dataMap events. I did a test updating it all and spawned events work with lighting also.
 

Skurge

Archtross Dev
Veteran
Joined
Jul 12, 2015
Messages
1,216
Reaction score
277
First Language
English
Primarily Uses
N/A
Terrax has been absent for some time, i'll try to message him. With your test updating was that change you made fixed the issue? I'm not sure if you encounntered the same issues as me but whatever you have done might be a saving grace.
 

Latest Threads

Latest Posts

Latest Profile Posts

TeamEdel.png

Realized halfway through drawing this that the female protagonist's party is growing bigger. :guffaw:
oddly enough, at this point... 3 major things have kept me from porting my project to MZ... animations, and that's mainly because they don't match the artstyle of my game. and two... I NEED a YED Sideview Battler like plugin and I have yet to see one. 3rd, I don't have the money for all the stuff I need plugin wise. and I already have it on MV... lol
Generally speaking, would there be interest in some form of tutorial regarding general project management? I see there are a lot of indie/self-taught devs around here, and looking back i feel like there was a lack of resources on how to properly manage a project that might take several years to finish
I've been working on some ABS team A.I. for 'A New Suburbia', and thought I'd share.

I'm generally quite please although the AI is a little grenade heavy right now :rolleyes: - Sneaking and stalking next! Please excuse the terrible map... it was just for ease of viewing!
Voting for the second round of the Map Madness Tournament is now live! Vote for your favorite in each matchup! https://forums.rpgmakerweb.com/index.php?forums/map-madness-2021-polls.187/

Forum statistics

Threads
110,581
Messages
1,054,396
Members
143,699
Latest member
BigChungus21
Top