Random map selection script which does not use the same map twice

prince of mars

Veteran
Veteran
Joined
Dec 12, 2012
Messages
111
Reaction score
16
First Language
English
Primarily Uses
Post: #1

(RPGMXP) Random map selection script which does not use the same map twice   

hello everyone does anyone know of a way to have multiple maps picked at random when you use a door entity and then make sure you do not select a map which you have been on before I have been trying to program that all morning here is what i have so far 

the idea is it randomly chooses a number which picks a map but if that maps has already been used it will call the random map common event which the exact same event as this one but saved in the common event that way it will pick another number and you will go to another map well in theory I used the common event because I could not figure out another way to reset the event apologize if there is a really easy way to do that I am very VERY new to this
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,275
Reaction score
1,439
First Language
English
Primarily Uses
RMXP
You need to store which maps are cleared and change the random selection based on that.

Let me show you the principle of how you can get this to work:



Whenever you clear a room I would set the specific room switch while sharing the room cleared variabled adding in a common event.



Good luck setting it up. Have fun while doing it.

*hugs*

 - Zeriab
 

prince of mars

Veteran
Veteran
Joined
Dec 12, 2012
Messages
111
Reaction score
16
First Language
English
Primarily Uses
thank you so much for taking the time to respond unfortunately i have no idea what your saying is there any chance you can do a step by step explaining each part as if you were talking to a child  thanks again :)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,787
Reaction score
14,016
First Language
English
Primarily Uses
RMMV
Do you WANT to use a script for this? It can be done with events.
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,275
Reaction score
1,439
First Language
English
Primarily Uses
RMXP
Try implementing exactly what I have created. The same event commands and all.

Then play around with it. See how it works. Prod it here and there. How does it change. How does it work.

And of course, try to have fun while doing it.

@Shaz:

Scripting this is easier and more natural when you can both event and script. Eventing it is however much more fun.

*hugs*

 - Zeriab
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
40,787
Reaction score
14,016
First Language
English
Primarily Uses
RMMV
lol! In this case, I would use eventing, with numerous Script snippets thrown into the mix :)


Gah! I suddenly had flashbacks to maps with sheep ... or pigs. You've ruined me, Zeriab!
 
Last edited by a moderator:

prince of mars

Veteran
Veteran
Joined
Dec 12, 2012
Messages
111
Reaction score
16
First Language
English
Primarily Uses
hmm I typed it in exactly but I am getting a syntax error is there any chance you could write the script part here so I can copy and paste it 
 

prince of mars

Veteran
Veteran
Joined
Dec 12, 2012
Messages
111
Reaction score
16
First Language
English
Primarily Uses
I asked the same question on another forum and i got this responce

This problem is actually two problems! The first one is visiting rooms in a certain order from a door, but never the same room twice. The second one is the actual randomizing.

The first can be solved like this; Take a number of variables equal to the number of rooms you want to visit, say, Variable 2 to 5. The first time you use the door, it checks with a conditional branch if Variable 2 is bigger than 0. If so it teleports the player to the Map Id stored in stored in Variable 2 AND (here's the important part) sets Variable 2 to 0 so we know the player has been there before.

The next time you try to open the door, it will check that Variable 2 is zero, and go to check Variable 3 next. If it is not 0, it will teleport the player to the Mapid stored in Variable 3 and set it to 0. And so on until you've worked through all of the possible maps.

the second problem is randomizing which variables lead to which map ids. we can do that with the 'Script' event! Put this into the box that comes up when you click on "Script...";

rooms = [12, 24, 78, 36] #map IDs

rooms.sort_by { rand }

$game_variables[2] = rooms[0]
$game_variables[3] = rooms[1]
$game_variables[4] = rooms[2]
$game_variables[4] = rooms[3]

​do you think this idea will work? do I have to replace the map ids with the names of the maps? I apologize if I keep asking stupid questions but I am really am quite clueless    
 

Latest Threads

Latest Profile Posts

Ami


Imagine you (as Miner) Sleep in the Cave,the other side is a Bunch of Golds,how d'you feel?
finally got footage of my main character running around his corrupted street...
I finally got the ships and water to flow like I wanted to~ the canals are a success. Now to loop the animation for the kites. So many kites.
Bendyizzt wrote on staggqueen's profile.
Hello Newcomer...

Forum statistics

Threads
107,698
Messages
1,031,507
Members
139,829
Latest member
GarcezPedro
Top