Page 1 of 1

Earthquake machine >:)

Posted: September 16th, 2010, 8:14 pm
by Stealth
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/

Re: Earthwuake machine >:)

Posted: September 16th, 2010, 8:16 pm
by Stealth
Just realised typo in the title :( is it possable for that to be edited?

Re: Earthquake machine >:)

Posted: September 16th, 2010, 8:19 pm
by Drofder2004
Stealth wrote:Just realised typo in the title :( is it possable for that to be edited?
Fixed and nice script, :)

Re: Earthwuake machine >:)

Posted: September 16th, 2010, 9:57 pm
by Hoogie
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.