Variables to select maps?

Skytor

Veteran
Veteran
Joined
Jul 13, 2017
Messages
33
Reaction score
1
First Language
English
Primarily Uses
N/A
So I have a few different maps created and I was wondering if it is possible to use a random number generator to select up to 5 of them and change the entrances and exits with variables so they lead to each other,

say I have:
Map 1
Map 2
Map 3 etc.
and the rng chose map 5, 7, 9 and 10 would it be possible to change the entrances and exits of them all so they lead to each other?

p.s.
I don't mind scripts or plugins

Also as you can transfer player by using variable id can you use that to take you to a random map?
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,787
Reaction score
7,876
First Language
German
Primarily Uses
RMMV
of course - and transfer player command is the way to go, no need for a plugin.

if the transfer player command uses the variable option, then the number in the variable to be used for map is the ID of that map - the number you see in the bottom left.

However, because that number needs to be the map ID, you need to use control variable in a way to get the correct numbers.
The easiest way is if the target maps are a sequence of numbers - for example if you want to end up on a map between map ID 8 and 12, then you use a single control variable to get a random number in that range and then use the transfer command.

If the map numbers are not a sequence, you need a series of conditional branches to convert a random number into the map ID.
In your example above, that would be first a control variable random 1-4 (because you have four maps), then four conditional branches "if variable = 1 then set variable to 5, if 2 then set to 7 and so on - followed by the transfer command.
 

Skytor

Veteran
Veteran
Joined
Jul 13, 2017
Messages
33
Reaction score
1
First Language
English
Primarily Uses
N/A

Latest Threads

Latest Posts

Latest Profile Posts

I haven't make anything new yet, but I'm back addicted to writing some MZ plugins. Man, I wish I have more free time like I did 5 years ago.
Holy cow... work is demanding and I'm back in college. I'm kind of scared of my dad right now after the incident, but at least I don't live with him all the time. Anyway, working on Fandom Scouts and my FNAF character set. The FNAF sprites are actually going to be used in the game... unfortunately the enemy sprites are FNAF World traces, so no sharing those.
The honeymoon period is over with Cyberpunk 2077, It sadly doesnt live up to the hype, pretty graphics arent everything (especially when I cant even do something as simple as changing the radio station over!). Replaying Breath of the wild has reminded me what a good game really looks like, plus that one has good glitches!....

Forum statistics

Threads
107,689
Messages
1,031,472
Members
139,810
Latest member
Big_Hoss86
Top