Page 1 of 2

Trial Runs

Posted: September 22nd, 2011, 2:29 pm
by UCLA.RES.
Hello,

Can anyone tell me how to make trail runs as part of the PAS experience? I basically want to make it so that once the player reaches the end of my maze, they re-spawn to another random maze map that I have saved. So that it's just constantly changing randomly from map to map (all maps I make are mazes) and the player doesn't stop playing. Would this be with the use of the portal entity? Would I have to mod. it out?

Re: Trial Runs

Posted: September 22nd, 2011, 3:21 pm
by arcones
It's a simple map change code. There's several around the forum that are easily found, but here's the one I'd use.

Teleport Code

Re: Trial Runs

Posted: September 27th, 2011, 2:15 pm
by UCLA.RES.
Thank You Arcones, this is tremendously helpfull , but I was wondering if there was a code I can put that respawns it into another randomized map. Is there a code for that? or is there another way to make it randomized? After much though, I can't seem to make it random. The reason I need to do this is ecause i am usign the program on experimentation on mice, and there can't be a repeating pattern that the mouse can memorize. IS there anything you could do to help me in this regard?

Best,
Daniel

Re: Trial Runs

Posted: September 27th, 2011, 3:49 pm
by arcones
A randomized map change would be impossible due to the fact in the code you must specify the map you are teleporting to. Otherwise, it would simply load a newmap, or not work at all.

In order to have a randomized map change, you'll need to edit the source code. I'm afraid that's the only solution at this point.

Re: Trial Runs

Posted: September 27th, 2011, 7:22 pm
by chocolatepie33
Your best bet is to make either a really long maze map (or something similar), or make many maps which are each quite different. This way, you can specifically choose which map loads, and the more maps you have, the longer it'll take before they start to repeat.

Re: Trial Runs

Posted: September 28th, 2011, 9:02 am
by Leo_V117
Oh, actually... I beleive there is a way to make a random number generator. So if the number equals a specific one, level_trigger_x will load a random map that equals that number. I'll ask Hirato when I can, then trial a code. There shouldnt be any need to create long mazes. I'll let you know when I can.

- Leo

Re: Trial Runs

Posted: October 6th, 2011, 12:12 pm
by UCLA.RES.
Leo_v117, THAT WOULD BE AMAZING! Please let me know if you find the coding!

Re: Trial Runs

Posted: October 28th, 2011, 3:10 pm
by Mike
Leo hopefully this helps, need any more?
http://sauerbraten.org/docs/config.html#rnd

Take care.
-mike

Re: Trial Runs

Posted: October 28th, 2011, 11:42 pm
by Mike
hirato wrote the code in like five seconds, haha. So you'd have:

level_trigger_1 = [
listofmaps = [map1 map2]; map (at $listofmaps (rnd (listlen $listofmaps)))
]

map1, and map2 would represent whatever two maps you wanted in there, you'd need to write all the map names in those brackets that you'd want to randomize it for. Here is more info on the actual map change stuff, you can even make it say a message before the map changes:
http://www.sandboxgamemaker.com/wiki/in ... nother_map

Take care and thanks Hirato for you help!
-mike

Re: Trial Runs

Posted: October 29th, 2011, 4:41 am
by Leo_V117
Mike wrote:hirato wrote the code in like five seconds, haha. So you'd have:

level_trigger_1 = [
listofmaps = [map1 map2]; map (at $listofmaps (rnd (listlen $listofmaps)))
]

map1, and map2 would represent whatever two maps you wanted in there, you'd need to write all the map names in those brackets that you'd want to randomize it for. Here is more info on the actual map change stuff, you can even make it say a message before the map changes:
http://www.sandboxgamemaker.com/wiki/in ... nother_map

Take care and thanks Hirato for you help!
-mike
I wrote one too, mine seems a little more simple, but it might not work. I was ill when I wrote it, so... Trust Hirato's if you wish. However:

Code: Select all

mapnum = [rnd 20] // Basically, your total maps.

echo (format "Teleporting to maze %1" $mapnum) // Remove this if you want.

level_trigger_1 = [
    sp (format "map_%1" $mapnum)
]
// Ensure maps are named "map_1", "map_2"... "map_19", "map_20".