Send player to the location of a specific spawned event (MV, Yanfly Event Spawner) [RESOLVED]

Status
Not open for further replies.

marbeltoast

Your future fish empress
Veteran
Joined
Nov 11, 2018
Messages
91
Reaction score
31
First Language
English
Primarily Uses
RMMV
Hey folks,

I am able to spawn an event (I will refer to this event as "Pinpoint" for clarity later) onto a map (with Yanfly's event spawner plugin) into one of several locations in a region. I need to be able to then transfer the player to that event's location.

The event "Pinpoint" is static; it will always have the same name and the same ID; there will only ever be one of it on a map. The map is variable; I will be using multiple different maps. The player is on the map where the event has been spawned; they have been put in the top left corner for the sake of being on the same map.

I would like to be able to do this using code in a common event, but if that is not possible, I can do this using a different event in the map to which the player is being sent. I'm thinking a potential solution is using the map specific event to identify the map ID and use some code (the main part I need help with) to get the X and Y of "Pinpoint" on the map, then use that information to transfer the player to where they need to go, but I am not sure how to write code to acquire the X and Y of a specific event on a non-specific map when that event did not start on the map.

If anybody on here can provide assistance, I would appreciate it. I am happy to provide further information if it is required.

Regards,

marbeltoast.
 

Tiamat-86

old jrpg gamer
Veteran
Joined
Dec 5, 2017
Messages
645
Reaction score
278
First Language
english
Primarily Uses
RMMV
probably a better way but i can think of a trick for this.
make the spawned event spawn as an autorun event. this event will...
control variable : game data : character : this event : map X
control variable : game data : character : this event : map Y
control variable : other : map ID
and of course turn on switch or something to stop the autorun
then just use those 3 variables for the transfer
 

marbeltoast

Your future fish empress
Veteran
Joined
Nov 11, 2018
Messages
91
Reaction score
31
First Language
English
Primarily Uses
RMMV
It could work. I'll give it a go and report back.

EDIT: This worked perfectly. Cheers, pal. I'll call for this to closed now.
 
Last edited:

KillerGin

Freddie
Veteran
Joined
Dec 18, 2015
Messages
556
Reaction score
509
First Language
English
Primarily Uses
N/A
Since you are using Yanfly Spawn, the event ID will change. (I had an issue with this when trying to do creative spawning mechanics via ID, I believe every new event spawned, the ID goes up by one, no it doesnt matter if an old ID is reclaimable)

Simply write a bit of code that would detect where the event is based on name, and store the events x and y in a variable and then transport the player to that location. It can all be in a common event (best place)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,150
Reaction score
14,206
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

elex 50s face.png

Experimenting with an old 50's style face set. I have done about a dozen variations of face sets for my characters, but am never happy with the results for very long. Different attempts. Second one is the same character as the first image. The third is Ivan, another character entirely.
treele.jpg
A them/they in a forest... a still for the game I'm working on.
Making a blue-magic-heavy game is very fun but there's a lot of extra hassle as well. Balancing skills for both enemy and player usage isn't easy.

Forum statistics

Threads
108,842
Messages
1,039,978
Members
141,305
Latest member
controlita
Top