!!

Welcome to Save Point!

Established and re-Branded in November, 2010, Save-Point is a game creational forum that aids users in creating games using software like RPG Maker or Game Maker. Support is also available today for members and members can also upload and download resources and scripts to use in their games. If you are new or experienced we welcome you to register.


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[XP Script] Random map selection script which does not use the same map twice
#1
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
http://i229.photobucket.com/albums/ee233...cbdefc.jpg

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
Reply }
Thanks given by:
#2
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...";
Code:
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]
If you want to know what this Ruby code is doing I'd be happy to explain.
Reply }
Thanks given by:
#3
a thousand apologies for the delayed response I had a bit of a personal crisis to attend to anyway I am back now and thank you so much for taking the time to respond but I got to admit my understanding of scripts is pretty much nothing
now when I write the script do i replace the numbers with the map names?

right I just tried entering the script and replacing the numbers with the names of my maps but when you go to use the variable in the transfer player box how can you choose were on the map the player start for player x and y you can only choose variables also when i go to use the door a get a syntax error here is a screenshot to help
http://i229.photobucket.com/albums/ee233...7d05f6.png
Reply }
Thanks given by:
#4
Almost. You need the Map IDs of the map, which is the number they are saved as, eg, map001's map ID is 1. You and find out what a map's ID is by checking the bottom middle-right of the window. For example, in that picture, you can see 033:testroom2{FPLE] so 33 is the map ID.

Like this. [Image: 288qov7.jpg]
Reply }
Thanks given by:
#5
I did everything you said but for some reason I am getting syntex errors could you post the script in the chat so i can copy and paste it in fact what would really help is if you could make a very small game exe which does the random map selection and uploading it so i can go through the game and see exactly how it works if you do that I would be forever in your debt
Reply }
Thanks given by:
#6
Sure! Here you go http://www.2shared.com/file/g4aswn9u/Gam...Floor.html
Reply }
Thanks given by:
#7
THANK YOU THANK YOU THANK YOU THANK YOU I just could not get my head around it until I saw it in rpgmaker you sir are a saint
Reply }
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
   Looking for script call swickster 12 2,644 05-21-2019, 04:40 AM
Last Post: swickster
   Script that allow skills to hit an arbitrary number of targets. Steel Beast 6Beets 2 995 05-12-2019, 04:05 AM
Last Post: Steel Beast 6Beets
   request: textbox position script rikert 2 2,058 11-27-2017, 12:24 PM
Last Post: rikert
   dancing minigame script Siletrea 163 51,500 09-28-2017, 05:37 AM
Last Post: Siletrea
   Script that removes junk symbol (squares like that [] ) Whisper 7 4,194 01-28-2017, 01:29 PM
Last Post: Whisper
   Looking for a sensing aura script Djigit 16 8,228 09-23-2016, 05:16 AM
Last Post: DerVVulfman
   Script Mix :) Whisper 2 3,277 09-07-2016, 08:22 AM
Last Post: Whisper
   MR Like Battle Script Dr. Ermine 8 6,563 06-27-2016, 07:05 AM
Last Post: Dr. Ermine
   Theo - Animated Message Portrait, looking for conversion or similar script LunarBerry 2 3,114 06-18-2016, 01:23 AM
Last Post: LunarBerry
   A script for flying Melana 2 2,324 12-16-2015, 03:30 PM
Last Post: Melana



Users browsing this thread: