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
94
Reaction score
32
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
658
Reaction score
283
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
94
Reaction score
32
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
557
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,298
Reaction score
14,276
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 Posts

Latest Profile Posts

SF_People1_3 added!
index.php

I haven't been on here in forever wow(missed my forum birthday T-T). Anyways, I'm dabbling in BGMs, here's something I'm actually willing to share.

Binge-watched 6 episodes of the Erased anime... And that means I've watched half of it?! Sigh...
I'm bad at base-building games (looking at other players created an aesthetically beautiful base compared to me), but IDK why I keep playing the game and seek more of it.

Forum statistics

Threads
109,199
Messages
1,042,983
Members
141,703
Latest member
davidusa121
Top