Earthquake machine >:)

Tutorials for Call of Duty 4 mapping

Moderator: Core Staff

Post Reply
Stealth
CJ Wannabe
CJ Wannabe
Posts: 9
Joined: March 17th, 2010, 12:20 am

Earthquake machine >:)

Post by Stealth » September 16th, 2010, 8:14 pm

earthquake machine :) its pretty simple but im sure some less advanced mappers / scripters will like it :D

firstly, to make it look good put a model in your map such as icbm_electronic_cabinet7, where you
want the earthquake machine to go and put a "clip" brush around it to make it solid.

then you need to creat a trigger around it. so create a trigger brush and then with the trigger selected
right click on your 2d grid >>> trigger >>> use_touch

then with the trigger brush still selected, press N to bring up the following values and enter these:

key: Targetname
value: earthquake

key: hintstring
value: ^2Press ^3&&1 ^2to cause an earthquake

like this Image

now you just need to place 2 origins in your map, one is going to be for the sound, and one is going to
be for where the earthquake is actually gonna come from :)

so right click on your 2d grid >>> script >>> origin and place it roughly in the center of your map
and enter this value:

key: targetname
value: quake

and now create another origin and place it next to the previous one and enter these values:

key: targetname
value: sound

should look like this:

Image

Ok thats the mapping side of it done :) now for the scripting >:)

the scripting for this if im honest is pretty easy. here is an example gsc with the scriptin it, i will
also explain the script and what vairables you can change :)

Code: Select all

main()
{
	maps\mp\_load::main();
	
	ambientPlay("ambient_backlot_ext");
	
	game["allies"] = "sas";
	game["axis"] = "opfor";
	game["attackers"] = "axis";
	game["defenders"] = "allies";
	game["allies_soldiertype"] = "woodland";
	game["axis_soldiertype"] = "woodland";
	
	setdvar( "r_specularcolorscale", "1" );
	
	setdvar("r_glowbloomintensity0",".25");
	setdvar("r_glowbloomintensity1",".25");
	setdvar("r_glowskybleedintensity0",".3");
	setdvar("compassmaxrange","1800");
				  
	thread quake();
}



quake()

{
trigger = getent("earthquake","targetname"); // this finds the entity you created (the trigger)
quake = getent("quake","targetname");		// this finds the entity you created (the origin named quke)
sound = getent("sound","targetname");		// this finds the entity you created (the origin named sound)
while (1)

   {
   trigger waittill ("trigger",user);
   wait 1;
   iprintlnbold( "EAARRTHHHQUUAAKKE!!!");	 //prints inbold "EAARRTHHHQUUAAKKE!!!" to all the users on the map, feel free to change the text :)
   sound PlaySound( "elm_quake_sub_rumble");  //plays the sound of an earthquake at the origin "sound"
   Earthquake( 0.7, 8, quake.origin, 10000 ); // (magnitude of the earthquake, length, at what origin, and the radius) these values can be changed apart from the origin
   wait 2;
   }
}

compile, buildd fast files and earthquake away!!

here is a quick video of the finished product (from an old testmap)

http://www.xfire.com/video/2c2cb5/

Stealth
CJ Wannabe
CJ Wannabe
Posts: 9
Joined: March 17th, 2010, 12:20 am

Re: Earthwuake machine >:)

Post by Stealth » September 16th, 2010, 8:16 pm

Just realised typo in the title :( is it possable for that to be edited?

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

Re: Earthquake machine >:)

Post by Drofder2004 » September 16th, 2010, 8:19 pm

Stealth wrote:Just realised typo in the title :( is it possable for that to be edited?
Fixed and nice script, :)
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

User avatar
Hoogie
Core Staff
Core Staff
Posts: 3977
Joined: September 2nd, 2008, 10:22 am
Location: Holland

Re: Earthwuake machine >:)

Post by Hoogie » September 16th, 2010, 9:57 pm

Stealth wrote:Just realised typo in the title :( is it possable for that to be edited?
You could have edited the title yourself as you made the topic.

Click edit and change the title in the top bar.
-=[[CoDJumper.com Movies]]=-
[[Ambush]] || [[Backlot]] || [[Bloc]] || [[Bog]] || [[Broadcast]] || [[Chinatown]] || [[Countdown]]
[[Crash]] || [[Creek]] || [[Crossfire]] || [[District]] || [[Downpour]] || [[Killhouse]] || [[Overgrown]]
[[Pipeline]] || [[Shipment & Wetwork]] || [[Showdown]] || [[Strike]] || [[Vacant]]


A woman can fake an orgasm, but a man can fake an entire relationship

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests