Player transfer to a random map

Status
Not open for further replies.

Bradybread

Villager
Member
Joined
Mar 14, 2012
Messages
14
Reaction score
0
First Language
English
Primarily Uses
Hey guys!

I was wondering if there is an easy way to set up a normal player transfer event but which would have a list of potential areas to teleport to at random. Say if you go through a magic door it could take you to 1 of 5 different maps which would be chosen entirely at random.

Any ideas?

Thanks!
 
Joined
Mar 14, 2012
Messages
146
Reaction score
34
First Language
English
Primarily Uses
I'll take a swing at this ~ the following method uses absolutely no scripting, eventing only.

For example, you have your random destinations as Map IDs 3, 4, 5, 6, 7.  You then create a transfer event, and do the following:

Create some variables.  If the entry points on the new maps will be in the exact same spot (will minimize your work), you only would need 3:  

Variable 0001: Random Destination

Variable 0002: X Map

Variable 0003: Y Map

Then, in the Contents of the Event, have these lines:

@>Control Variables: [0001: Random Destinaion] = Random No. (3...7)

@>Control Variables: [0002: X Map] = 10 {this is actually your x coordinate where you'll appear, so you'll have a different #}

@>Control Variables: [0003: Y Map] = 12 {same as above, just this is your y coordinate}

@>Transfer Player: Variable [0001][0002][0003], Left {or whichever direction}

It's very basic, but it should give you a base to work from.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Something like that would be easy, but it relies on your maps being ordered sequentially, with nothing else in between.

The other way you could do it, if your maps AREN'T sequential, is something like this (I'm not looking at the editor, so some of the terms may not be quite correct):

Code:
Control Variables [0001: Random Destination] = Random No (1...5)Conditional Branch: Variable [0001: Random Destination] == 1  Transfer Player to first map  Exit Event ProcessingBranch EndConditional Branch: Variable [0001: Random Destination] == 2  Transfer Player to second map  Exit Event ProcessingBranch EndConditional Branch: Variable [0001: Random Destination] == 3  Transfer Player to third map  Exit Event ProcessingBranch EndConditional Branch: Variable [0001: Random Destination] == 4  Transfer Player to fourth map  Exit Event ProcessingBranch EndConditional Branch: Variable [0001: Random Destination] == 5  Transfer Player to fifth map  Exit Event ProcessingBranch End
The bonus with this method is that you don't have to transfer them to the same place on each map, and they don't have to be numbered sequentially.
 

thinkpadius

Digital Antarctic Explorer
Member
Joined
Feb 4, 2014
Messages
19
Reaction score
0
First Language
English
Primarily Uses
I'd also add that for this to work best you need to add in the condition for if the wrong map is chosen.  So:

Let's say you have map 1 through 5 are dungeon maps, but map 3 is a boss dungeon so you don't want it to load.  

This solves the problem of [A] having maps in the wrong order and  making sure that the player actually transfers to a new map.

Label: Start # You need this so that the event can re-roll the random number.Control Variables [0001: Random Destination] = Random No (1...5)Conditional Branch: Variable [0001: Random Destination] == 3Jump to Label: Start # If you don't do this the player won't move to a new map. The random number needs to be re-rolledExit Event ProcessingBranch EndYou then create one of these for each of the maps you don't want to load.
 
Last edited by a moderator:

Mouser

Veteran
Veteran
Joined
Aug 19, 2012
Messages
1,245
Reaction score
264
First Language
English
Primarily Uses
@ think: If he uses Shaz' method he doesn't have to worry about the wrong map being chosen -

he won't list a 'wrong' map as one of the five (or ten or three) choices.
 
Last edited by a moderator:

thinkpadius

Digital Antarctic Explorer
Member
Joined
Feb 4, 2014
Messages
19
Reaction score
0
First Language
English
Primarily Uses
@ think: If he uses Shaz' method he doesn't have to worry about the wrong map being chosen -

he won't list a 'wrong' map as one of the five (or ten or three) choices.
So, if MAP 3 is the wrong map then all you need to do is not list it? But then what happens if the random number rolls a three, will the event retry or just basically fizzle out?

Alternatively, you could set it up that once it goes through the whole list and it didn't encounter any of the right maps, the event triggers a Jump To Label: Start that takes it back to Label: Start

The event will re-roll the numbers and run through the list of maps again and the developer doesn't have to list every single "wrong map"
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
thinkpadius, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Random number = 3 does not mean map 3. It means the third in the list of available maps.


If you only have 4 maps to choose from, then you would only generate a random number between (and including) 1 to 4, and you would have conditions for each of those numbers in that range, to transfer to the appropriate map.


You know, before you set up the event, how many maps there are going to be to transfer to, and you set up the event accordingly.


Anyway, this is a bit of an old thread, and I think it's safe to assume the OP got the result he wanted since he didn't come back asking for further information, so I'm going to go ahead and close this.
 
Last edited by a moderator:
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top