Page 1 of 1

Random Locatation, Intersection.

Posted: March 15th, 2006, 7:47 pm
by leveller
I think we all had it one time or an other, to many jump rooms in a map.

So i build my self a simple solution for this problem.

A Random Locatation, Intersection.

i build an intersection and added a Trigger, once i get into the trigger, the game it self, gets to pick, where i go from here.

This way i get to keep all my rooms, and the player can play the map multiple times,
ending up in a different room everytime.

Here's the code

in your map, make a trigger_multiple at the location from where you want to go dynamic with your players.
and give it these values.

Code: Select all

key "targetname"
value "transporter_intersection"
That's all for the map section

Find and write down the coordinate's in your map where you want to send your players to.

use this for scripting in your_map.gsc

Code: Select all

main()
{
		thread Transporter_intersection();
}

Transporter_intersection()
{
	while(1)
	{
	finishtrig = getent ("transporter_intersection","targetname");
	finishtrig waittill ("trigger",user);

	loc[0] = (-3048, 888, 800); // First Location
	loc[1] = (-588, -1088, 8);  // Second Location
	loc[2] = (-1120, -408,8);   // Third Location

	user setOrigin(loc[randomInt(loc.size)]); // Let the game pick a random Location

	wait .5;
	}
}
Thats all, have fun.

Posted: March 15th, 2006, 10:51 pm
by Nightmare
sweet, that script just gave me so many new ideas for jump maps! :twisted:

Posted: March 15th, 2006, 10:54 pm
by Lisa
Brilliant...I'm gonna have to try it in a map. :!: :!:

Posted: March 15th, 2006, 11:09 pm
by Soviet
excellently made, it turned me on :P :oops:

Posted: March 15th, 2006, 11:43 pm
by Drofder2004
Very clever code for a very clever idea... wp Leveller :)