Hi all,
I am using visustella events movement core to spawn events in random locations marked with regions.
Is there any way once I have spawned an event to a random location I can spawn a 2nd event next to that event? Or how I workaround by moving an existing event next to the spawned one if that makes sense.
I am using location variables and get location info but can't get my head around how to set it up for other events.
Thanks
Hi, I have another slight problem with this. Whilst the the events spawn next to the event (as I needed) when I spawn the original event they spawn next to the original event not the spawned event...if that makes sense! How do I get the ID of the spawned event to assign the coordinates to as outlined above?
I think I understand now, so the issue is because you're transferring Event A from Map B to Map A, you can't get the coordinates of Event A.
As AquaEcho said, you could just have Event A store its own event ID into a variable beforehand, and then reference that variable for your spawn events on Map A. However, I'm not sure that will work if you're transferring an event between maps unless you ensure that there is no duplicate event id on Map A?
If you want to try it, I believe the code you would need would be:
$gameVariables.setValue([your variable number here no brackets], $gameMap.event([your event's id here no brackets]).eventId())
Here is an example without the extra words:
$gameVariables.setValue(1, $gameMap.event(1).eventId())
Autorun this on the first page of your event on Map B and it should store it's id into a variable. Remember to put a self switch after this script to move to a different page.
Personally, I would recommend you simply not transfer Event A between maps, and just create a new "Event A" on Map A that has the information you need it to have. What is special about the event on Map B that you cannot make an event on Map A with the same art that will fulfill the same function? You can use the code above to store that eventID and roll from there.
If you do it this way, you can easily access the ID of the event and not have to go through as much work to make events referencing it to function.