Random Locatation, Intersection.

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

Post Reply
leveller
CJ Fan
CJ Fan
Posts: 156
Joined: June 25th, 2005, 12:24 pm

Random Locatation, Intersection.

Post by leveller » March 15th, 2006, 7:47 pm

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.

User avatar
Nightmare
Core Staff
Core Staff
Posts: 2688
Joined: January 12th, 2006, 10:09 pm
Contact:

Post by Nightmare » March 15th, 2006, 10:51 pm

sweet, that script just gave me so many new ideas for jump maps! :twisted:
Coding is Poetry. Mapping is Art.
"Cause im the sexiest mapper ever...except for nm, that sexy man" - Soviet

-=[CoDJumper.com Movies]=-
[Ambush] || [Backlot] || [Bloc] || [Bog] || [Broadcast] || [Chinatown] || [Countdown]
[Crash] || [Creek] || [Crossfire] || [District] || [Downpour] || [Killhouse] || [Overgrown]
[Pipeline] || [Shipment & Wetwork] || [Showdown] || [Strike] || [Vacant]

Lisa
CJ Worshipper
CJ Worshipper
Posts: 442
Joined: December 24th, 2005, 1:22 am
Location: US of A

Post by Lisa » March 15th, 2006, 10:54 pm

Brilliant...I'm gonna have to try it in a map. :!: :!:
Image
~Materazzi~
Image

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » March 15th, 2006, 11:09 pm

excellently made, it turned me on :P :oops:

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » March 15th, 2006, 11:43 pm

Very clever code for a very clever idea... wp Leveller :)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests