A downloadable RPG Maker MV Plugin

Get this RPG Maker MV Plugin and 1 more for $7.50 USD
View bundle
Buy Now$5.00 USD or more

An event spawner allows you to create a new event on the game map by creating a copy of a template event located on another map. This spawner reuses unspawned events to allow for more freedom to spawn even more events.

Event Spawner which recycles unspawned events!

This event spawner is unlike other publicly available spawners in that it will automatically recycle unspawned events before spawning a new event. This greatly(completely if used properly) decreases performance loss over time due to event clutter. Tested up to 500,000+ spawns and unspawns with zero performance loss, this spawner should never encounter framerate drops if used properly.

Ultimate Event Spawner Features:

  • Use as many spawn/template maps as you wish to hold your spawnable events.
  • Spawn an event from a spawn map onto the game map using x,y coordinates or regionId(s).
  • Spawning an event onto a regionId will pick a random tile marked with regionId(s) specified to spawn the event on.
  • Save spawned events. Saved events will re-appear when the player re-enters the map.
  • Restore unspawned saved events exactly as they were before unspawned, retains current event page and eventId.
  • Transform events on the game map using events on another map as a template.
  • Complete compatibility with Ritter_BoundarySystem plugin allowing the spawning and unspawning of events on boundaries you create using script calls. This allows for creating the feel of an unlimited number of enemies, excellent for ABS games! Automatically spawn enemies outside of the players screen and unspawn them when they are too far away! (Separate plugin Ritter_BoundarySystem required!)

 Click here to Purchase Ritter Ultimate Event Spawner & Ritter Boundary System Bundle and save!

Install Instructions:

Download the plugin file and place it inside your projects js/plugins folder.


Add Ritter_EventSpawner plugin to your projects plugin manager.

Place below Ritter_BoundarySystem when using Boundary System + Spawner.


Configure the parameters to fit your needs.


Create a new map to use for holding your source/template events to be used by the spawner to copy onto the game map. Create your events on the new map.

Play test and try the script calls below!

 

Script Calls:

Ritter.spawnEvent(mapId, eventId, x, y, save)

  • mapId = the Id of the map which holds the event you want to spawn.
  • eventId = the Id of the event on the map specified in mapId.
  • x = x coordinate to place the event on the game map.
  • y = y coordinate to place the event on the game map.
  • save = true to save event and respawn it when you re-enter map.
  • save = false to use the event as a temporary event which goes away on map change. You can leave out save from script call to not save the event.

Example script call:

Ritter.spawnEvent(42, 15, 8, 16, true)

Would spawn event 15 from map 42 on the game map at 8,16 coordinates and save the event data to automatically be respawned upon re-entering the map.

Example script call two:

Ritter.spawnEvent(42, 15, 8, 16)

Would spawn event 15 from map 42 on the game map at 8,16 coordinates as a temporary event that goes away on map change. 

 

Ritter.spawnEventRegion(mapId, eventId, regions, save)

  • mapId = the Id of the map which holds the event you want to spawn.
  • eventId = the Id of the event on the map specified in mapId.
  • regions = regionId(s) to place the spawned event on randomly. To use multiple regionIds to randomly pick from list them like this [4,8,15,16,23,42]
  • save = true to save event and respawn it when you re-enter map.
  • save = false to use the event as a temporary event which goes away on map change.

Example script call: 

Ritter.spawnEventRegion(4, 8, 15, true)

Would spawn event 8 from map 4 on a random tile marked with regionId 15 and save the events data to be automatically respawned upon re-entering the map.

Example script call with array of regions: 

Ritter.spawnEventRegion(4, 8, [15,16,23,42])

Would spawn event 8 from map 4 on a random tile marked with any of the regionIds 15,16,23,42 as a temporary event that isn't saved.


Ritter.transformEvent(eventId, mapId, spawnId)

  • eventId = id of the event on game map to transform.
  • mapId = spawn map id that has template event.
  • spawnId = id of event on spawn map to use as template.

Example Script call:

Ritter.transformEvent(1010, 4, 8)

Would transform event 1010 into event 8 from map 4.


Ritter.unspawnEvent(eventId, removeSave)

  • eventId = the Id of the event on the map to unspawn.
  • removeSave = true to remove the event from saved events.
  • removeSave = false to keep the event on save list to respawn upon re-entering the map. Leave removeSave empty to keep saved event.

Example script call:
Ritter.unspawnEvent(1000, true)

Would unspawn event 1000 from the game map and delete the saved event data.

Example script call two:
Ritter.unspawnEvent(1000)

Would unspawn event 1000 from the game map.


Ritter.unspawnAll(removeSave)

  • removeSave = true to delete saved event data.
  • leave empty to retain saved event data.

Unspawns all spawned events on the map.


Ritter.restoreUnspawnedEvent(eventId)

Restores an unspawned saved event to the game map.

Ritter.restoreUnspawnedEvent("event_name")

Restores an unspawned saved event to the game map using its name instead of Id.

Ritter.restoreUnspawnedEvent(x, y)

Restores an unspawned saved event to the game map using its last known x, y location on the map.




$gameMap._lastSpawnEventId

Returns the Id of the most recently spawned event.


Ritter Boundary System Spawner Description and Script Calls:

The Boundary System plugin allows for the spawning and unspawning of events on or within boundaries you create using a simple script call. The boundaries are stored and later accessed using the name you gave your boundary. You can create as many boundaries as you wish.

Boundaries can be created around the player, around any event on the map, or around an x,y location on the map. This allows for the spawning of events in many creative ways including spawning enemies just outside of the players screen constantly, or at any pace you find that fits well in your game.

Easily limit the number of events that each boundary is allowed to spawn to prevent spawning too many events on the map and causing performance loss, when a boundary is limited to spawning 40 events it will only ever use 40 events at once, if any of the boundary events are unspawned in the unspawn boundary that frees up space for more events to spawn on the boundary.

Read the description of the script calls below to understand how the boundary system and Event Spawner work hand in hand to create a unique experience within your game.


Ritter.Boundary.createSpawnerBoundary(width, height, thickness, name, eventId, expandBy, maxEvents, centerx, centery)

This is the script call to create your boundary, or boundaries.

width = the number of tiles wide your boundary is.

height = the number of tiles high your boundary is.

thickness = the number of tiles thick your boundary is.

name = the "name" of your boundary to be used later when spawning/unspawning on this boundary.

eventId = use 0 if creating a boundary around player, use an eventId if creating a boundary around an event, or use -1 if creating a boundary around an x,y location, and set the x, y location as shown below.

expandBy = the number of tiles the boundary expands its thickness by in the direction of the players movement. This helps increase the odds that events will spawn in front of the player while the player is moving as opposed to the sides and back, helping to ensure that the player has higher odds of encountering enemies in the direction the player is moving.

maxEvents = the number of events the boundary is allowed to spawn, use this to manage the total events on the map to prevent event clutter and performance loss.

centerx = only use centerx if spawning on an x,y location. centerx = the x location of the center of the boundary. leave out of the script call completely if spawning on player or event.

centery = only use centery if spawning on an x,y location. centery = the y location of the center of the boundary. leave out of the script call completely if spawning on player or event.


Example Script calls:
Ritter.Boundary.createSpawnerBoundary(11, 11, 1, "spawn", 0, 2, 30)

This would create a boundary of 11 tiles width and height around the game player with 1 thickness which is named "spawn", the boundary will expand by 2 tiles in the direction the player is moving and have a maximum of 30 events it can spawn.

Ritter.Boundary.createSpawnerBoundary(15, 15, 1, "unspawn", 0, 0, 0)

This would create a boundary of 15 tiles width and height around the game player with 1 thickness which is named "unspawn", the boundary will not expand in the direction the player is moving and will not be able to spawn any events.

Ritter.Boundary.createSpawnerBoundary(5, 5, 2, "eventBoundary", 50, 0, 5)

This would create a boundary of 5 tiles width and height around event 50 with 2 thickness which is named "eventBoundary", the boundary will not expand and is limited to spawning 5 events maximum at a time.

Ritter.Boundary.createBoundary(5, 5, 1, "xyBoundary", -1, 0, 20, 50, 50)

This would create a boundary of 5 tiles width and height around coordinates 50,50 on the game map which is named "xyBoundary", the boundary will not expand and is limited to spawning 20 events at a time.


Ritter.spawnEventOnBoundary(mapId, eventId, regions, boundaryName, save)

  • mapId = The mapId of the spawn map which holds your template/source event to be copied to game map.
  • eventId = The eventId of the template/source event to be copied to the game map.
  • regions = The region Ids to use for spawning events on. List as an array to use multiple regionIds. [1, 2, 3]
  • boundaryName = The "name" you gave your boundary that you wish to spawn on.
  • save = Whether the event data is saved, set to true or false.
    • defaults to false and can be left out of the script call for non-saved events.


Example Script call using boundary created above:
Ritter.spawnEventOnBoundary(4, 8, [15, 16], "spawn")

This would spawn event 8 from map 4 on a random tile marked with regionIds 15 or 16 that pass through the boundary named "spawn".


Ritter.spawnEventInBoundary(mapId, eventId, regions, boundaryName, save)

  • mapId = The mapId of the spawn map which holds your template/source event to be copied to game map.
  • eventId = The eventId of the template/source event to be copied to the game map.
  • regions = The region Ids to use for spawning events on. List as an array to use multiple regionIds. [1, 2, 3]
  • boundaryName = the "name" you gave your boundary that you wish to spawn on.
  • save = Whether the event data is saved, set to true or false.
    • defaults to false and can be left out of the script call for non-saved events.


Example Script call using boundary created above:
Ritter.spawnEventInBoundary(4, 8, [15, 16], "spawn")

This would spawn event 8 from map 4 on a random tile marked with regionIds 15 or 16 that is within the boundary named "spawn".

Ritter.spawnFillInBoundary(mapId, eventId, regions, boundaryName, save)

  • mapId = The mapId of the spawn map which holds your template/source event to be copied to game map.
  • eventId = The eventId of the template/source event to be copied to the game map.
  • regions = The region Ids to use for spawning events on. List as an array to use multiple regionIds. [1, 2, 3]
  • boundaryName = the "name" you gave your boundary that you wish to spawn on.
  • save = Whether the event data is saved, set to true or false.
    • defaults to false and can be left out of the script call for non-saved events.

Example Script call using boundary created above: Ritter.spawnFillInBoundary(4, 8, [15, 16], "spawn")

This would spawn event 8 from map 4 on a every tile marked with regionIds 15 or 16 that is within the boundary named "spawn".

Ritter.spawnFillOnBoundary(mapId, eventId, regions, boundaryName, save)

  • mapId = The mapId of the spawn map which holds your template/source event to be copied to game map.
  • eventId = The eventId of the template/source event to be copied to the game map.
  • regions = The region Ids to use for spawning events on. List as an array to use multiple regionIds. [1, 2, 3]
  • boundaryName = the "name" you gave your boundary that you wish to spawn on.
  • save = Whether the event data is saved, set to true or false.
    • defaults to false and can be left out of the script call for non-saved events.

Example Script call using boundary created above: Ritter.spawnFillOnBoundary(4, 8, [15, 16], "spawn")

This would spawn event 8 from map 4 on a every tile marked with regionIds 15 or 16 that is along the edge of the boundary named "spawn".


Ritter.unspawnEventOnBoundary(boundaryName)

  • boundaryName = the "name" you assigned to the boundary you wish to use for unspawnEventOnBoundary.


Example Script call using boundary created above:
Ritter.unspawnEventOnBoundary("unspawn")

This would unspawn any events located on the boundary "unspawn".


Ritter.unspawnBoundaryEvent(eventId, removeSave)

  •  eventId = eventId of an event to unspawn
  • removeSave = true/false - deletes save data

This call will unspawn a specific boundary event with the option of removing it from saved boundary events.


Ritter.Boundary.checkBoundaryTileSaveData(boundaryName)

  • boundaryName = the "name" you assigned to the boundary you wish to check and respawn any unspawned saved events located within.

Utilize this script call as often as needed to respawn saved events. It can be useful for running in a parallel event for times when you're not spawning new events but wish to still have your saved spawned events respawn.



Also available for RPG Maker MZ!


Check out these other RPG Maker MV Plugins!



Terms of Use:

  • You are granted non-exclusive rights to use this plugin for Commercial and Non-Commercial Use in as many projects as you wish to create.
  • Do not redistribute this plugin without permission.
  • Do not take code from this plugin without permission.
  • Do not remove my name from @Author.
  • Do not take credit for creating this plugin.
  • Editing of code is allowed as long as it's within plugin file.
  • I do not offer support for any changes made to plugin code.
  • While it's not mandatory please consider crediting me in your game credits:
    • (Something similar to this would be great)
    • Ultimate Event Spawner Plugin
    • Craig "Ritter" Barger


Version Log:

  • 1.0: Released Plugin.
  • 1.1: Fixed an incompatibility issue with Chrono Engine.
  • 1.2: Added two new methods for restoring unspawned saved events.
             Added calls to fill boundaries with events with a single call.
  • 1.3: Fixed a bug which prevented the user from adding more than 3, sometimes 4, preload maps within the plugin parameters.
  • 1.4: Fixed an incompatibility issue with Altimit Movement plugin.
  • 1.5: Added saved events to boundaries.


Is this spawner missing something you need?

Have any ideas on expanding this plugin further?

I'd love to hear your thoughts in the comments below and if they're reasonable I'll see about adding them into the spawner!


Check my profile for bundles!

StatusReleased
CategoryTool
Rating
Rated 5.0 out of 5 stars
(5 total ratings)
AuthornotRitter
Tagsplugin, rmmv, RPG Maker, RPG Maker MV

Purchase

Get this RPG Maker MV Plugin and 1 more for $7.50 USD
View bundle
Buy Now$5.00 USD or more

In order to download this RPG Maker MV Plugin you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:

Ritter_EventSpawner.zip -- v1.5 9.6 kB
Ritter_EventSpawner.zip -- v1.4 7.3 kB
Ritter_EventSpawner.zip -- v1.3 7.1 kB
Ultimate_Event_Spawner_Demo.zip 240 MB

Development log

Comments

Log in with itch.io to leave a comment.

I'm wondering if you can help me with something.

Currently when you unspawn a saved event, the event ID it was using remains "in use" as in it wont be overwritten by future spawned events. I was wondering, if it's possible, if you could tell me how to change this behavior so future spawned events will overwrite the IDs of deleted events. It's fine if it breaks the restoring deleted events function.

Note: I'm using v1.4 as the newer version doesn't work with my game.

The image shows the events of the current map. There were originally 6 "Weed" events, I then destroyed 2 (red arrows) and spawned 2 more (blue arrows).



I want the newly spawned events to overwrite the IDs of the unspawned events. My game will have thousands of spawned events and I'm worried about the event data array getting out of hand. (Maybe this fear is unfounded?)

Hello! It appears you may just need to remove the saved event data when unspawning a saved event.

let eventId = this._eventId;
let removeSave = true;
Ritter.unspawnEvent(eventId, removeSave);

typically you would remove the saved event data unless there is a specific need for retaining the data and the event it was tied to, it's left available as an option but typically you'd be removing the saved event data when unspawning.

If you remove the save data when you unspawn a saved event the unspawned event should be returned to the pool and continue to be recycled as normal.

For all intents and purposes a saved event is a "real" event, it will always exist and it will be treated differently until the saved event data is removed.

as a side note your fears are not unfounded, if you aren't removing saved event data then you will end up with thousands of events on the map which will cause performance issues. As long as we're managing our saved events properly and keeping the number of events active at once in check (ie not having 5000 events active on the map at once) then you should be able to spawn millions of events and never have those performance drops which are caused by too many events on the map.

Thank you and I hope this solves your issue! Good luck with your project!

I am removing the save when I unspawn it. Reading your reply that it should be removing it from the maps event list caused me to do more digging and it turns out its a conflict with another plugin causing  it to keep the event data after being removed.

(2 edits)

Hi Ritter - I have a question.

I am using the Hakuen Studio Self Variable Plugin and have added increasing time-based Self Variables to spawned events and use your plugin to spawn these events.

The plugins work flawlessly together as long as I don't leave the map where I spawn your event. 

If I leave the map and re-enter the original map where the event has spawned, I receive this error. 

https://imgur.com/a/1zqg2Ho

Example: 
I spawn your event. I leave the map. I re-enter the map and game crashes. Game doesn't crash if self-variables are not enabled. 

Any idea why this is happening, or is this something I should reach out to Hakuen Studio about?

Game works fine if events are not spawned using your plugin but are already placed within the map. Crash only happens with spawned events.

I'm taking a look into it and so far I'm unable to replicate the crash (using Ultimate Event Spawner v1.8). I seem to have both plugins working together even after a map change. I've tried setting self variables on temp events and leaving the map and returning which works (I wouldn't advise using temporary spawned events with these self variables but i tested it anyway), I also did the same with saved spawn events which also worked when returning to the map.

At this point I'm not sure what's causing your problems but it seems like it might be deeper than these 2 plugins conflicting. I'd need more information or a dummy project which crashes (remove all the plugins from js/plugins folder before zipping it, if you decide to do this) 

(1 edit)

Gotcha.

To yourself any anyone reading this, I meant to post this in the MZ plugin, not the MV plugin. 

I will try to get that to you that information and video later today after work and will repost in the correct thread. My apologies for the wrong thread.

I'll do it on a fresh save with only those two plugins and will send over to you later today (: Your activity and willingness to help is incredible. Will see if it's a deeper issue, my brain is definitely confused by this one haha

Does this plugin have a spawn overlap command? It seems things won't spawn if the player or another event is on the tile, even if the existing event is on another layer or set to through. I would like this feature because I sometimes change the player to a cursor, and want to spawn something at the cursor's position.

(+1)

Hello! I'll take a look into making this easier to do in the near future but the code which is blocking your events from spawning is located inside the Ritter.canSpawnOn() Function. I do have one method in place to allow for spawning on events which requires a script call to enable it. 

If you use the script call

Ritter._spawnOnEvents = true;

this will allow you to spawn on top of events. 

it can be disabled by using 

Ritter._spawnOnEvents = false;

it's defaulted to false so if you want to spawn on top of events set it to true.

I'm considering adding this as an optional argument for the Ritter.spawnEvent command, that may be something that happens in an update soon.

Thank you and I hope this helps you out in the meantime!

Thank you very much. A script call is fine, as long as it's mentioned in the documentation.

(1 edit) (+1)

Ok, so that script call does work for spawning on events but not for spawning on the player.

E: I found the line blocking spawn on player position, I'll add an additional check for if the player is not set to through or same as character priority

(2 edits)

I picked this up with the sale and it replaced Yanfly Event Morph nicely. The notetags work and the script call is a lot simpler.

However I am trying the event spawner on a map that spawns both moving and non moving events. If I unspawn a moving event (using Autonomous movement>random) then spawn a static event, the new static event moves for a few tiles before settling in a position. If I only unspawn static events and respawn the same static event there's no issue. I could get a video and a screencap of the event pages if you need to see it in action.

Hello again! Glad to see that some stuff is working for you! I've tried creating some events to spawn where one was using autonomous movement random and the other was using autonomous movement fixed. I was unable to replicate your issue. If you could show me what's happening along with the events in question that would help clear things up.

Steps I took:

Created 2 events on a spawn map.
One using Autonomous movement Random and the other using Autonomous movement Fixed.
I spawned the random event first and let it move around for a little bit.
I unspawned the random event.
I then spawned the Fixed event.
resulting in the fixed event staying in place on the tile it was spawned on without moving.
I did this a few more times alternating between the two events and couldn't get it to break.

I can dig deeper with more information.

Thank you and Good Luck!

(2 edits)

Thanks for testing. It's being caused by Altimit Pixel Movement as when I turned it off the issue dissapeared. Although I don't get the issue with Galv spawn+Altimit so I'll try to narrow down where the conflict is.

(1 edit)

Here is a video of the issue. Altimit Pixel + Ritter Spawn conflict
(1 edit) (+1)

Interesting one here. So it seems like the events are returning to the tile the chicken event was on when it unspawned upon being respawned as the other berry bush event.

This is happening with my spawner, for a reason I'll soon be looking into, but not with other spawners because this spawner recycles events. So when you unspawn a chicken that event goes into a sort of 'unspawned events pool' which the spawner looks to before spawning another event. if there are any unspawned 'null' events available it will grab one of those and transform it into a new event instead of creating another event on the map. Whereas galv spawner will just spawn a new event every single time you spawn an event.

The problem seems to be that the event wants to return to the position it was in when it was last unspawned.

spawn chicken
unspawn chicken
spawn berry bush
berry bush wants to move to where chicken previously was.

 I'll take a look into this and hopefully have a fix soon.


Edit:

I've located the problem within altimit movement code, deciding on the best fix.

(1 edit) (+1)

I just uploaded version 1.4 of the spawner which should fix this issue. 

If you're curious about what the issue here was with altimit movement and the way my spawner recycles events... basically with altimit movement whenever an event is moving it is given a ._moveTarget = true property and also ._moveTargetX and ._moveTargetY properties. These properties had to be reset when unspawning an event since these events are recycled.

The events were respawning with flags that tell altimit when and where to move the event to lol.

I hope this works out for you! If you find any other issues or if this one somehow persists be sure to let me know!

Thank you!

(+1)

Works like a charm! Thanks again for resolving such a niche bug report so fast. This plugin replaced both Yanfly Event Morph and Galv Spawn for me.

Hello

I want to unspawn the spawned event (by event name, not by event id)

Is there a way?

If the feature isn't there, could you add it?

Hello!

There's currently no function in this plugin to allow for unspawning events by name but something like that is very possible to do, it's just there are often more than one event sharing the same name. In a situation with multiple events sharing the same name (spawned from the same template event) then you'd need to either unspawn them all or just unspawn the first one or last one in the list, or create other parameters.

Overall something like that would be very easy to set up depending on what your needs are. I could write a function to do this.

If you're still interested let me know what your needs are and i'll see what I can do.

Thank you!

Hello. Thanks for the reply & sorry for the delay in responding.

If you could implement additional functionality it would be helpful.

I use the chrono engine to spawn enemies.

I would like to make an enemy disappear when an event (enemy) is defeated or when a certain amount of time has elapsed after the event (enemy) has spawned.

The current specs assign the ID of the spawn event in the order in which they spawned.

Therefore. It is difficult when I want to unspawn a spawn event by specifying a specific event ID. Therefore, I wanted to use individual event names to unspawn events.

I do not have a problem with the same name being unspawned at the same time.

(I see no problem with the hassle of preparing multiple events with the same content but different names).

However, I also think it would be useful to have the ability to unspawn events in the order they are spawned, with the event names specified.

I have one more question,

In ChronoEngine, when a spawn event (enemy) is defeated, the spawn event (enemy) does not seem to be unspawned.

It seems that the event itself remains on the map without being unspawned even if the spawning event (enemy) is defeated.

1: In the "Ritter Ultimate Event Spawner", is it possible to erase an event and not be unspawned?

Is it only with the unspawn command that spawned events can be unspawned?

2: The chrono engine does not seem to process "event (enemy) defeated = event (enemy) erase".

I would like to add a self unspawner to the chrono engine side to handle when an enemy disappears, but is it possible to quote "Ritter Ultimate Event Spawner" as a separate plugin? (I'm a programming beginner, so I'll give up if it seems too difficult)

There may be some discrepancies in the machine-translated English. Thanks for reading.

Have you done a stress test/performance benchmark on your spawner? https://forums.rpgmakerweb.com/index.php?threads/here-is-a-benchmark-test-for-th...

Hello! I have not done this yet but it looks interesting. I'll get to it soon and see how it goes!

One more question: Does the event transform feature also copy the notetag of the template event? I need something to replace YEP Event Morph which overlooked that feature

Hello again, sorry i've been a bit busy lately and haven't gotten around to testing the benchmark with this spawner. I'd assume it would be very similar in performance to other spawners as it seems the benchmark just spawn in events as it needs them. Unless there's a benchmark test which spawns & unspawns events constantly to see how many spawns & unspawns you can do before framerate goes down. That kind of benchmark is where you'd see the biggest difference between this spawner and others.

To address your other concern, my spawner does indeed copy the notetag from the template event when an event is transformed. All data on the template event should be copied over when you transform an event.

Thank you for taking interest in this plugin!

Ok, thank you for always being so responsive. Are you having another sale soon?

Hey itch summer sale is in 10 days and I'll be participating in it. I currently have some bundles available on my profile which offer some discount. Single plugin discounts will be available during the sale.

Thank you!

(1 edit)

If type more than a certain number in 'Preload', the black screen will appear and the game will not run. (Demo: 4 , My Game: 5). can you please fix this? The recycle event spawner plugin is really powerful, but I can't use it because of this issue.

Hello this is an interesting one, sorry you're experiencing this issue. I was able to replicate this issue and I'm taking a look into solving it now. Thank you for reporting this.

Were you able to fix your other issue with the $gameMap._lastSpawnEventId command?

Deleted 1 year ago

Just posting to let you know that I haven't forgotten about this and I've been trying to find an optimal solution to the black screen issue. Sadly it's not resolved just yet. Sorry about the delay.

(+1)

Thank you for your efforts.

I was lucky to find this plugin, so I'll be sad if I can't use it.

Hello I've uploaded a version 1.3 of the event spawner. This update fixes the black screen bug when adding a bunch of pre-load maps to the plugin parameters.

As far as the other issue with the last spawn eventId... that's still unresolved as of now. I've poured some time into trying to find a solution to this specific problem you're having but it's more specific to the way you're trying to access it rather than the command itself failing. I'll continue to try to find a solution for your needs but it may just be the method of its use in this case causing the issue.

(7 edits)

(See also the EDITs at the end of this message.)

Hello again! I hope you're having a great holiday season! I love so much your plugins!
I was testing them a little bit more and I noticed 2 important issues.
To spawn the events, I used the script call Ritter.spawnEventRegion(mapId, eventId, regions, save)

1. First of all, your Ultimate Event Spawner plugin and your Boundary System plugin seem to have an issue when using them with the Orange Time System plugin by Hudell.
For example, if I use this plugin command within a spawned event 

TOGGLE SELF SWITCH A IN 10 SECONDS 

it won't work as intended if the player is transferred into another map and then comes back. It only works if the player stays in the same map until that self switch is toggled. I made some gifs to let you see what's going on.
- In this gif, you can see that the plugin command by Hudell is working properly because the player stays in the map until the self switch is toggled: https://imgur.com/e8rR1Q7
- And in this gif, you can see that the issue happens when changing the map and infact the self switch isn't toggled: https://imgur.com/1xk4x4i
- The same issue happens even after changing the map, saving the game and reloading the save file (in case you don't know this, the Orange Time System plugin is intended to work even after closing the game because it tracks the flowing of time): https://imgur.com/4rb4rnp

2. The second issue is happening when using your plugins with the Galv's Simple Crops plugin. In a previous message, you said that your plugins were working properly with it, but they seem to have an issue. 
The Simple Crops plugin works properly with a spawned event if the player doesn't change the map, as you can see in this gif: https://imgur.com/KjruTQk
The issue happens when the player changes the map and then comes back and as you can see in this gif the spawned event starts to flicker: 

These plugins are so important for my game, so please... can you fix those issues? I extremely need them.

(Fortunately, your plugins are working properly with the Galv's Tools plugin, so far!)

EDIT 1: After installing the Ritter_EventSpawner SavedEvent Fix Testing plugin, the Galv's Crops plugin seems to be working properly, but that didn't fix the issues with the Orange Time System plugin. As you can see in this gif, now the self switch is toggled properly even after changing the map... but the game crashes if the player saves the game, closes the game, re-opens the game, loads the save file, changes the map and finally comes back to that map where the self switch was toggled (the crash happens at the end of the gif): 

And here's the console log: 

rpg_managers.js:1949 TypeError: Cannot read property 'events' of undefined

    at Game_Map.restoreSavedEvents (Ritter_EventSpawner.js:630)

    at Game_Map.setupEvents (Ritter_EventSpawner.js:674)

    at Game_Map.setup (rpg_objects.js:5442)

    at Game_Map.setup (Galv_SimpleCrops.js:572)

    at Game_Map.setup (Ritter_EventSpawner.js:355)

    at Game_Player.performTransfer (rpg_objects.js:7480)

    at Scene_Map.onMapLoaded (rpg_scenes.js:569)

    at Scene_Map.isReady (rpg_scenes.js:561)

    at Function.SceneManager.updateScene (rpg_managers.js:2018)

    at Function.SceneManager.updateMain (rpg_managers.js:1983)

SceneManager.catchException @ rpg_managers.js:1949

EDIT 2: Well... After more testing, the game crashes even with the Galv's Simple Crops plugin with the Ritter_EventSpawner SavedEvent Fix Testing plugin. As you can see in this gif, the game crashes after spawning the plantable event, planting the seed, waiting for the plant to grow, saving the game in another map, closing the game, re-opening the game, loading the save file and coming back to the map in which there is the plant (the crash happens at the end of the gif): 

And here's the console log: 

rpg_managers.js:1949 TypeError: Cannot read property 'events' of undefined

    at Game_Map.restoreSavedEvents (Ritter_EventSpawner.js:630)

    at Game_Map.setupEvents (Ritter_EventSpawner.js:674)

    at Game_Map.setup (rpg_objects.js:5442)

    at Game_Map.setup (Galv_SimpleCrops.js:572)

    at Game_Map.setup (Ritter_EventSpawner.js:355)

    at Game_Player.performTransfer (rpg_objects.js:7480)

    at Scene_Map.onMapLoaded (rpg_scenes.js:569)

    at Scene_Map.isReady (rpg_scenes.js:561)

    at Function.SceneManager.updateScene (rpg_managers.js:2018)

    at Function.SceneManager.updateMain (rpg_managers.js:1983)

SceneManager.catchException @ rpg_managers.js:1949

EDIT 3: After even more testing, the crashes didn't happen anymore after setting the spawn map in the Preload Spawn Maps parameter of your Ritter_EventSpawner SavedEvent Fix Testing plugin. I really don't know why that fixed the crashes! XD

Hello! I just bought your plugins (Event Spawner and Boundary System) and I'm testing the demo you uploaded. The game crashes right after clicking on "Playtest". I'm using Event Spawner v1.2 and Boundary System v2.0. Since the demo had the Event Spawner v1.1, I installed the latest version of the plugin (v1.2), but the game crashes with both of them. The game doesn't crash if I don't install the Boundary System plugin. Here's the console log: 

rpg_managers.js:1949 TypeError: Ritter.clearBoundaryEvents is not a function

    at Game_Player.reserveTransfer (Ritter_EventSpawner.js:673)

    at Function.DataManager.setupNewGame (rpg_managers.js:220)

    at Scene_Boot.start (rpg_scenes.js:402)

    at Function.SceneManager.updateScene (rpg_managers.js:2019)

    at Function.SceneManager.updateMain (rpg_managers.js:1983)

    at Function.SceneManager.update (rpg_managers.js:1907)

SceneManager.catchException @ rpg_managers.js:1949

(1 edit)

Hey again, sorry about this! Chances are I may have broken something in the demo with an update to the spawner + boundary system and didn't think to check the demo. I'll get around to looking into this soon. Hopefully in the meantime the info provided in the plugin files and on the store page for the spawner will help you get the plugins working.

(3 edits)

I tried to install both of the plugins in a new blank project and the game crashes the same way as the demo!

EDIT: Nevermind! I was putting the plugins in the wrong order! Now I put the Boundary System over the Event Spawner and it doesn't crash anymore! Sorry for the misunderstanding. XD

(1 edit)

Hello! I want to buy this plugin for RPG Maker MV, but before buying it, I'd like to know some things. First of all, is this plugin compatible with the ABS plugins made by the RPG Maker community? I'm referring to qABS (made by Quxios) and Alpha ABS (made by KageDesu). I tested other event spawner plugins and they don't seem to work with event note tags of spawned events (for example, when I tried to use an event spawner plugin made by someone else, the game throws an error like "can't read property 'notetag' of undefined" if I interact with a spawned event with an event note tag in it after quitting the game and loading a save file because it seems like event note tags of spawned events are not copied/saved after reloading the game and in fact they seem to work only the first time the player spawns those events). Event note tags are extremely important for ABS plugins because they work with them. And I also need event note tags for other things. So, does this plugin work with event note tags of spawned events?

Hello! Thank you for taking interest in this plugin. I developed this plugin initially for myself in a project using Chrono Engine ABS (Moghunter) and I developed the spawner with notetags in mind. While I have not tested this plugin against qABS or Alpha ABS I would be willing to give it a go over the weekend if you'd like. If any issues with notetags not working or anything else is reported I do try to implement compatibility patches for popular plugins such as those ABS plugins.

(1 edit)

Thank you for the reply! Well, if your plugin works with the Moghunter ABS plugin, I suppose it should work with other plugins that use event note tags in general. For example, I would like to know also if your plugin works with some plugins made by Galv that use event note tags as well (such as Galv Tool plugin and Galv Simple Crops plugin). If that worked, I would instant buy your plugins because I really need them! You can give it a go over the weekend if you want to try those plugins. I would be so grateful with you!

Hello I did some testing against Galvs Tool Plugin and Simple Crops plugin and the seem to work together. I did some testing with saving the game and loading the save which seemed to work as well. Crops I planted were still at their proper stage after reloading the save. 

My crop events were spawned onto the map using the spawner as saved events and continued to work as they should. This was using the Ritter_EventSpawner SavedEvent Fix Testing.zip version of the plugin.

If you're going to unspawn the events after crops are harvested you'll want to be sure to erase the saved event data.

I didn't get around to testing against those ABS plugins yet but I'd be surprised if they weren't compatible with each other.

Hey, thank you so much for testing those plugins! I'm gonna buy your plugin right now! Can't wait to play around with it! 

(1 edit)

Here is a video showing a bug I found.

Removing the first party member and the even associated crashes the game. The game will not crash upon reloading the map when removing other events, but it will if I reload the map and then open and close the menu (not shown). Note: it will not crash if the event I despawned was the last spawned event. I am using SavedEventFixTesting version of the plugin because the default will not work with my project.

some other useful info

Hello thank you for choosing this plugin and I'm sorry you're having an issue with the Saved Event Fix Testing plugin file. I'll take a look into this as soon as I can to see if I can replicate and fix the problem.

Hey, sorry it took a few days things have been really busy for me. I was able to replicate the crash successfully and I believe I've solved the crashing issue but it may require more testing. I'm currently unable to get it to crash anymore by doing the following steps:

  • spawn saved event
  • spawn another saved event
  • unspawn first saved event
  • change map
  • return to original map (where it would crash)

I'm also unable to make it crash anymore when opening the menu instead of changing maps.

Just download the Ritter_EventSpawner SavedEvent Fix Testing.zip again and replace the old plugin with this new one, be sure to let me know if you encounter any more problems! This version of the plugin may require more testing still before I'm satisfied enough to replace the original spawner with this other method.

Thanks again!

I found a weird bug that cost me hours of work x0

Basically, the spawned event can't load new (in my case triggered by self-switches) event pages in "Autorun" mode. 

(1 edit)

Hello sorry to hear you're having problems! I'm taking a look into this but so far in my testing with Autorun events I've encountered no issues. Any additional information about the event you're having problems with could help.

I don't know maybe I'm the only one who got this bug xD The solution is to change the event page from Autorun to Parallel, or to change it's self switch before it gets spawned. I'm just posting this in case someone else got this issue. 

Srry didn't mean to sound frustrated. I've tried YEP's and GALV's plugins before that and it's by far the best one :)

P.S. Also, please, please make sure that your event is spawning on a tile, in case you're working with parallax.

Found this plugin while looking for a solution to the performance issues of the YanFly EventSpawner.


With this plugin, my game has been spawning / destroying events for a minute before performance started to go down. I don't know if I'm doing something wrong, I'm just using spawnEvent ( no saving ) and unspawnEvent when the event hits a certain region. There are at best 40 events moving on the map simultaneously, rest are unspawned. I don't see why performance would degrade over time.

Also, this plugin is not compatible with RPG Maker MV < 1.6 ( has to do with node js version ).

(4 edits)

Worked on it a bit more. To give a bit more context : I have a mountain, from which boulders go down. There are a few spawners at different places which are parallel events. The boulders themselves are parallel events with movement routes.

1/ I encountered the same weird problem with YEP_EventSpawner : when I let the game run for a bit and my FPS is heavily impacted, if i just open a ShowText command, the game is back up to 120 FPS. The moment i close it though, I'm back to 1 FPS.

2/ Used the profiler inside the console. I saw that a ton of performance was used on processMoveCommand, which might mean that the movement was continued to be processed, even in unspawned events .

By adding the line "this._index = this._list.length;", i completely removed this problem and gained a TON of FPS. Still, letting the game run the FPS are still going down.

3/ Did a simple check on $gameMap._events and it's kinda obvious. The _events array is getting bigger and bigger as game goes on. I see a ton of events flagged "erased=true" though. I get it's the engine way to "remove" events. But it also means you can't get away with not pooling events...

Hello and thank you for purchasing this plugin! I'm sorry to see you're having problems with it.  If you're seeing the event array grow larger that would mean events are not being recycled which is leading to the fps drop. I would need more information on the process you're using to spawn and unspawn the events to understand why this is happening. It could be a number of things causing this to occur, the only way this spawner will create a new event on the map is if there are no unspawned events to transform, so something is causing the spawner to miss some/all of the unspawned events, or events are not being unspawned properly. 

I'd need more information on the boulder events and the event(s)/common event(s) you're using to spawn/unspawn them to get a clear view of what's happening.

Hey notRitter,

Thank you for the reply ! My setup is quite simple :

I have a parallel event to spawn boulders, with 2 commands :
- Script : Ritter.spawnEvent(13, 1, 11, 87, false)
- Wait(60)

The event spawned, my boulder, is on a separate template map. This event is also a parallel event with the following commands :
- Script : <custom plugin checking region tile of the boulder for ajusting speed / unspawning event >
- SetMoveRoute >This Event > Move Down ( repeat/skip/wait unchecked )

The script checking the region tile also handles the removal of the event if the boulder is on a specific tile :
> this._index = this._list.length;
> Ritter.unspawnEvent(this.eventId(), true);

(8 edits)

Quick update, I kinda hate myself because I left the YEP_EventSpawner plugin in the project and that was the cause of all the non-recycling weirdness... fml. So performances are great now !

That being said, I still have a problem with the plugin. I created a test project with only your plugin and absolutely nothing else. I have a parallel event with only 1 command : SetMoveRoute > This Event > Down with repeat/wait/skip unchecked ( it's the Boulder ).

I have two test map :
- First map, the Boulder is placed on the map.
- Second map, the Boulder is spawned using Ritter.spawnEvent.

I also have on both map an Event (Action Trigger), that does a simple TransferPlayer command on the current map.

When this last event is interacted with :
- First map, no problem.
- Second map ( spawned event ), callstack :



I can send you the test project if you'd like.

EDIT 1 : If I TransferPlayer from the Map 2 to another map, it works, even if the new map also has Ritter.spawnEvent. So the only problem is if I transfer from a map using Ritter.spawnEvent to the exact same map. Which is a bummer for respawning in my case.

EDIT 2 : As a workaround I transfer the player in a temporary map, and then back to the original map. Not as clean as I wish but it works and from a user perspective there's no difference.

Interesting, I'll have to take a look into this issue you encountered to see if I can replicate it and patch it, seems like something worth fixing. Glad to see you have figured out a way to get things working. Thank you for reporting this! I'll put out a devlog for this plugin once this is patched.

Hi notRitter!

I see that you are active at the moment so I take this opportunity to report my problem hoping to find a solution here.

The error occurs after returning to a map that contains a saved spawned event.

The bug disappears when I deactivate this plugin precisely.

https://drive.google.com/file/d/1JkIQm4yKJTWzNlDwu3-E67GuVIz544yr/view

I already tested it with "Ritter_EventSpawner SavedEvent Fix Testing".

Hello sorry to see you're encountering this problem. I'll take a look at this plugin and see if there's anything that can be done.

Is there anything special about the saved event you are spawning? I've tested this every way I could think of and couldn't get it to crash... but I'm not very familiar with this DisableEventStart plugin so maybe there are other conditions that occur?

(1 edit)

Heya Ritter it seems this event spawner is completely incompatible with the popular Qmovement (via the required Qplus plugin) for some reason, is there a way to patch this? ^^ Thanks in advance <3


(1 edit)

Oh my sorry about that I'll look into this!

Thank you I'll let you know what I can do soon.

(1 edit)

Thank-you so much for looking into it! <3 Good luck!

Although it may be impossible, there's another common bug with other spawner's spawned events being un-interactable, while I've been working around it with my current spawner if you also happen to fix that issue in yours I'll actually die of happiness. But just getting it working is a+ as well!

Hey Ritter just touching base after a week to see if any progress may have been made or if a solution could not be found~

(3 edits)

Hey sorry its taking so long, I've been trying to solve this issue it's just had me baffled for a bit. I'm hoping I'll get this solved soon! I'm still working on this. I've made some progress and was able to get it to stop crashing but only if I disabled a wait timer for spawned events but I'm sure that method will interfere with the QPlus plugin in one way or another, I'm trying to fix the actual problem causing the issue. On the plus side after disabling that timer I was able to interact with spawned events so hopefully once I find the root cause of the problem everything should work out.

Edit:

Okay so I'm not really 100% on this fix BUT I uploaded it, so if you want to help out testing it just download the plugin again and replace the old one with this new one. So far in my testing it seems to be working pretty well but it always helps to have extra testing.

(1 edit) (+1)

Aye aye sir! Will download it and toss it into my game- let you know as soon as I run into any trouble! I am working on my crops today so it'll hopefully get put through the ringer!


And THANK-YOU so much for working on this problem aaaaa- you're freakin' awesome!

Hmmmm redownloaded it from itch.to and threw it in a fresh project but I still seem to get the same error? Using mv 1.6.2 btw~ <3


(1 edit)

Ohh I made a small mistake heh. Used a > when i should have used >=

just reuploaded a fixed version, try this one out. sorry about that.

your plugin order looks good too, the spawner does need to be below QPlus and Qmovement for this fix to work so thats good

I'm currently in the process of doing finishing touches on the Spawner & Boundary system demo. It'll be finished shortly. I also went and updated the spawner a bit adding in a couple more commands (relating to boundary system) and made it easier to restore unspawned saved events. So on top of a demo we're also getting a spawner update :]

(2 edits)

Hey notritter, I got your spawn plugin, seems like I can't spawn a full regionID Area using the script provide (I did success doing that with 'galv_spawn' thought), any solution for that? 

I use common event, then connect it to a 'var' and added a 'jump to label' commend with limit number of 1000, but even do the area of the region I spawn it to was less then 1000 tiles, it didn't cover the all area. 

Again when using galv spawn event this mothed did work when I use the following script: 

Galv.SPAWN.event($gameVariables.value(35),15,true);

I will assume using something similar with your spawn plugin will work but It didn't work when I try to use: 

Ritter.spawnEvent($gameVariables.value(35),15,true);

or Ritter.spawn.Event($gameVariables.value(35),15,true);

or Ritter.spawnEventRegion($gameVariables.value(26),14,true);

the map stop when entering like it can read it. 

Do you know which script I should use instead? I need it to work with 2000-3000 event tile area, but for start I'm checking it on 1000.

In short: what should I do to get a full area of region cover with the 'spawn event' using your plugin? Here is a screen shot when using normal script without connecting it with the script to the 'var' (it spawn more event but not the full amount set.


(when player attack the ground with 'x' tool he will get item the ground change as you see in the second picture).


and 'gif' show what's happen on the map, the base tile are 'grass'(green), and the event image are the yellow ground you see that spawn, I couldn't upload the all thing  but you can see the idea of what need to happened there.

The above show case are only when using  your ffical script as you see in the event picture, as I said when I try to use the 'var' script Ritter.spawnEvent($gameVariables.value(35),15,true);   and similar, the game stop when entering the map.


Note: 

I'm building a game that will include  'digging ground' event (like in zelda 2d) using ABS and 'Spawn Event'.

(2 edits)

I'm in the process of trouble shooting this issue, I'm able to fill an entire 2500 tile map in one second using my Ritter.spawnEvent script call but it takes considerably longer when using regions to spawn events. I'll update here when I solve what's going on with the delay when region spawning.

for (let w = 0; w < $dataMap.width; w++) { for (let h = 0; h < $dataMap.height; h++) { Ritter.spawnEvent(2, 1, w, h) } }

this script call worked smoothly to fill an entire map, but that just places an event on every single tile which isn't quite what you need.


I edited that script call a little to include region ids and it does exactly what it seems like you need.


for (let w = 0; w < $dataMap.width; w++) {

for (let h = 0; h < $dataMap.height; h++) {

if ($gameMap.regionId(w, h) == 1) {

Ritter.spawnEvent(2, Math.randomInt(27) + 1, w, h)

} } }

so what this does essentially is it loops through every single tile on the game map once and checks if its regionId is 1 ($gameMap.regionId(w,h) == 1)

then if the regionId is 1 it will execute the script call where 2 is the SpawnMap ID, Math.randomInt(27) + 1 will pick a random eventId on the spawn map from 1-27 and w,h is the x,y coordinates of the tile it found.

this will fill up an entire map almost instantly with events (tested on a 50x50 map). this spawner wasn't really created with the idea of filling an entire region with events but I can add in a script call to do so shortly if needed.

(3 edits)

Thanks for checking it out, I did notice the amount of time it takes to spawn big amount of events, solving that will help a lot. 

And you right, cover the full map with events will not work for this case, since there are walls, and places I will put other events, small and big event size (house...), that why control the area with Region are  the most affective way for my case but I still need it to cover the full region area. 

So If  you find a way to add the option to spawn full region area (%100 of the region ID) using a script call that will be very helpful, I checked many spawn events, and when is come to 'fps'  with big amount of event (like I need) your spawn win them all as you probably know (galv as I emanation have the option to cover 'full' region area with spawn, but the fps drop when I spawn 600-700 event   already so I can't use it). 

I included a script call in my last post which does what you need, but it will be a lot of events spawned at once and will likely cause the same fps issues you had with other spawners as MV has problems handling that many events at once.

In a game I'm making (which is on hold while I work on my biggest tool/plugin project yet) I got around that issue by creating the boundary system which I used to spawn and unspawn events outside of the players screen so that I could reuse unspawned events over again and get a result of having practically unlimited amount of events (as far as the player knows at least) without the fps drops.

My spawner works best when events are unspawned and respawned instead of spawning 1000+ events on the map at once.

(3 edits)

I see, that probably be the best way to go with then,  just got your 'boundary' plugin, I still need to learn how to do this right. and I think I didn't explain it right, I don't need it to spawn at once, just to spawn fast as passible like your original script for region already do, but instead of spawn to part of the region spawn it to the full area of the region.

And yes, I sew the script above but is for 'random' events from the map id,  and I need to spawn 'specific' event id on the full region area, Is that passible?  Also I don't need it to spawn in the same second, as long as it spawn fast enough to not fill like is take forever (7-10 seconds?). Do you know why the method with the 'var' doesn't work? It's work with 'galv spawn', and 'galv' is weaker then your spawn, so why something like 

Ritter.spawnEvent($gameVariables.value(35),15,true);

doesn't work with your plugin? is should make it spawn not at the same time but still fill the all region (with 'jump to label' I show in the  picture above.

Here is the same idea but with 'galv spawn' script the connect to a 'var', as you can see it's  fill the all region area, not at the same time but that works for me as long as is fill the all region area without to much fps dropping:




'68' are the event number from the spawn map Id, '34' are the 'var' ID, and '11' are the region it will spawn on, using 'if: Random = 500 jump to label' make the script to repeat itself until the all area full, however when trying this way with your spawn is only add some amount of repeating but doesn't get the all region area full , but when trying to use the same idea with RitterSpawn is not working at all, is like the main 'Ritter.spawnEvent' script can't be connect to the 'variable' for some reason, could you check it out? I have other problems with 'galv' so if I can do similar thing with your spawn I prefer to use yours. There is no rush or anything so if you need time to check it that ok.

And again It's not have to be spawn at the same time (I sew how is drop the 'fps' like you said), is just need to fill it up fast as you can get it to be. Thanks again for your time, I appreciate it!

I'm currently creating a demo project which will show various ways to utilize the spawner and boundary system. I'll upload it to the store page once it's finished.

This is probably the best route to showcase the features and make it easier to understand on the users end.

I believe I have a good idea of what you're trying to accomplish here and there is a good way to handle this task with my spawner + boundary system that will be explained in the demo. You'll be able to see it in action and if it's what you need you'll be able to inspect the events which handle it within the demo and see how it's done :)

I appreciate your patience and will get this done as soon as I can! Thank you!