Reproduce Event Crash

I'm using Eshra's Reproduce Event script found here.
My problem is, when I use the script call in an event that is set to parallel process, the game crashes when I play it.
The script call I use is: "EventSpawn.spawn_event(2,1,1, 1, false,2)"
When the game crashes, it says this:
Spoiler
Untitled.png
Another note: When I play the event in parallel process, I end it with a self switch so that I doesn't play over and over again.
I think the error means you can't do it inside a parallel process event..

Basing from it (the error message), it seems like you're trying to add a new event which means adding a new entry to the Event hash but parallel process events are ran while iterating that hash so you cannot run actions that will modify that hash inside the parallel event..
I think the error means you can't do it inside a parallel process event..

Basing from it (the error message), it seems like you're trying to add a new event which means adding a new entry to the Event hash but parallel process events are ran while iterating that hash so you cannot run actions that will modify that hash inside the parallel event..
Ahh i see. Thanks for the info. Well, I wanna use Yanfly’s Event Spawn script instead but I have a few questions.
Maybe I’m using the script wrong but I noticed Yanfly’s Event Spawn script replaces the last event created in the map with the new event that is spawning.
So for example, event ID20 would be created but if an event spawns into that map, the new event will replace event ID20. I was wondering if there were a way so that spawned events DON’T replace anything.

Also again, maybe I’m using the script wrong, but i noticed you can only have one spawned event in a map only at once. There’s no way to have more than one event spawn. I’m sure I used the script call correctly, so I’m not sure if I’m doing anything wrong.

You can find the script here: https://github.com/Archeia/YEARepo/blob/master/Utility/Spawn_Event.rb
Replace this line:
Code:
key_id = @events.keys.max || -1 + 1
With this one:
Code:
key_id = (@events.keys.max || 0) + 1
In Yanfly's script.

You didn't do anything wrong, the script itself is bugged, both of your issues came from that line I mentioned above.
Replace this line:
Code:
key_id = @events.keys.max || -1 + 1
With this one:
Code:
key_id = (@events.keys.max || 0) + 1
In Yanfly's script.

You didn't do anything wrong, the script itself is bugged, both of your issues came from that line I mentioned above.
Thank you so much! I figured that was the problem but I wasn't 100% sure. Thanks again!
Replace this line:
Code:
key_id = @events.keys.max || -1 + 1
With this one:
Code:
key_id = (@events.keys.max || 0) + 1
In Yanfly's script.

You didn't do anything wrong, the script itself is bugged, both of your issues came from that line I mentioned above.
Hello, I know this thread is technically done but I am using Eshra and not planning to switch to a different one. You mention that both issues came from the same line did you mean the same line in Yanflys or in both scripts. I did find a similar code in Eshra's but no clue if it's what am looking for to fix the parallel process.
Replace this line:
Code:
key_id = @events.keys.max || -1 + 1
With this one:
Code:
key_id = (@events.keys.max || 0) + 1
In Yanfly's script.

You didn't do anything wrong, the script itself is bugged, both of your issues came from that line I mentioned above.
Hello, I know this thread is technically done but when I edit the script the same as yours, this error happen
[IMG]https://i.ibb.co/Yc5YRHf/Untitled.png[/IMG]
Do you know how to fix(The same error as above, when I use Yanfly Spawn Event with Parallel Process)
in yanfly's script? do you have any other scripts doing spawn event on map?

Can you show a screenshot of the code you changed
in yanfly's script? do you have any other scripts doing spawn event on map?

Can you show a screenshot of the code you changed
I changed like this below
Code:
key_id = (@events.keys.max || 0) + 1
Necro-post notice: @DateMajima

Next time please start your own thread. If you have tried the solutions above and the problem still occurs, then you are having issues that the OP didn't have, and should start your own thread for the troubleshooting.

Original thread: https://forums.rpgmakerweb.com/threads/reproduce-event-crash.107450/