Adding bombs (non-SD)

Tutorials for Call of Duty mapping

Moderator: Core Staff

Pwn-Rikku
CJ Spammer!
CJ Spammer!
Posts: 679
Joined: August 15th, 2005, 7:58 pm

Adding bombs (non-SD)

Post by Pwn-Rikku » November 17th, 2005, 8:09 pm

Right lets get started
basicly what we are going to create is a bomb that you can plant to blow something up? Intrested? if not dont read well you should be lets get down to business:
Mapping:
1. Create the area you want to test the bomb on.. (Do not add the blown up wall or the wall before)
2. First create the blown up wall as a "Script_Brushmodel" (Its easier to do this first. because you can select them more easyer)
3. Select all the brushes click "n"

Code: Select all

Key: targetname
Value: wallafter
4. Right now that walls ok create the perfect wall over it.. as a "Script_Brushmodel"
5."n" again

Code: Select all

key:targetname
value:wallbefore
6. Create a model with

Code: Select all

key:model
value:xmodel/bomb_objective_incomplete
7.Give it the

Code: Select all

key:targetname
Value:wallbomb
8. Create a trigger around this a Trigger_use
Thats it for the mapping wasnt that hard was it?

Scripting

Code: Select all

main()
{
	maps\mp\_load::main();
	
	// Precache the model we will use once the bomb is planted on the wall
	precacheModel("xmodel/bomb");
	// Set up the effects used for wall explosion
	level._effect["wallexplosion"] = loadfx("fx/explosions/mp_bomb.efx");
	level._effect["wallexplosion2"] = loadfx("fx/explosions/explosion1_heavy.efx");
	
	game["allies"] = "american";
	game["axis"] = "german";

	game["american_soldiertype"] = "airborne";
	game["american_soldiervariation"] = "normal";
	game["german_soldiertype"] = "fallschirmjagergrey";
	game["german_soldiervariation"] = "normal";

	game["attackers"] = "allies";
	game["defenders"] = "axis";
	
	// Run the function that does the wall explosion
	level wallbomb();
}

wallbomb()
{
	// Get all of the wall parts, the bomb, and the bomb trigger
	bomb = getent ("wallbomb","targetname");
	bomb.trigger = getent (bomb.target,"targetname");
	wallbefore = getent ("wallbefore","targetname");
	wallafter = getent ("wallafter","targetname");
	
	// Hide the destroyed version of the wall until it's blown up
	wallafter hide();
	
	// Wait until the bomb is triggered and is triggered by the right team
	// Can change the team to "axis" if you want Axis to blow up the wall instead
	while (1)
	{
		bomb.trigger waittill ("trigger",other);
		if ((isplayer (other)) && (other.pers["team"] == "allies"))
			break;
	}
	
	// The bomb was planted by the right team so play a bomb planting sound
	bomb playsound ("MP_bomb_plant");
	
	// Delete the bombs trigger since it's not needed anymore
	bomb.trigger delete();
	
	// Change the bomb model from the flashing bomb to the solid bomb model
	bomb setmodel ("xmodel/bomb");
	
	// Wait .5 seconds for the bomb planting sound to finish
	wait .5;
	
	// Now play a looping tick sound on the bomb
	bomb playLoopSound("bomb_tick");
	
	// Wait 15 seconds for the bomb to blow up, can change this to something else if you want
	wait 15;
	
	// Bomb will explode now so stop the ticking sound
	bomb stopLoopSound("bomb_tick");
	
	// Set the origin for the explosion and radius damage
	origin = bomb getorigin();
	
	// Delete the exploded bomb
	bomb delete();
	
	// Play the explosion effects
	playfx(level._effect["wallexplosion"], origin);
	playfx(level._effect["wallexplosion2"], origin);
	
	// Do radius damage to kill players in the area, perameters are (origin, range, maxdistance, mindistance)
	radiusDamage(origin, 500, 2000, 1000);
	
	// Show the destroyed version of the wall
	wallafter show();
	
	// Delete the whole version of the wall
	wallbefore delete();
}
I added some things to show what happens and so you hopefully can learn from it :)
Thanks to drofder for basics of scripting from his scripts :)
Rikku - Old skool
Image
Image

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

Post by Drofder2004 » November 18th, 2005, 12:34 am

Nice. Stickied.

Also added a few code tags to neaten up the tut.
And I also removed the "setcullfog" from the main. This is not required and should be edited differently per map ;)
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

Pwn-Rikku
CJ Spammer!
CJ Spammer!
Posts: 679
Joined: August 15th, 2005, 7:58 pm

Post by Pwn-Rikku » November 18th, 2005, 5:14 pm

Thank you :) next im making a flak gun fire at a wall to break it
and plus stickied! what more could i ask thnx drofder
Rikku - Old skool
Image
Image

User avatar
Cpt.Cool
CJ Worshipper
CJ Worshipper
Posts: 204
Joined: May 31st, 2007, 2:27 am
Contact:

Post by Cpt.Cool » August 31st, 2007, 2:40 pm

wow, this is cool
Image
Image
YaNo wrote:I use Cool as my UO compiler :) Try it, it works!

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

Post by Nightmare » August 31st, 2007, 8:38 pm

wow, this is old.
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]

User avatar
YaNo
CJ Worshipper
CJ Worshipper
Posts: 460
Joined: May 5th, 2005, 9:34 pm
Location: Azeroth
Contact:

Post by YaNo » September 1st, 2007, 3:19 pm

but cool though :)

Lennard
CJ Wannabe
CJ Wannabe
Posts: 24
Joined: July 22nd, 2009, 3:27 pm

Re: Adding bombs (non-SD)

Post by Lennard » October 20th, 2009, 1:26 pm

this shit is not working i cant load my map with your script and i can without the script..

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

Re: Adding bombs (non-SD)

Post by Drofder2004 » October 20th, 2009, 5:44 pm

Post your script. (Nice ressurection btw :)
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

Lennard
CJ Wannabe
CJ Wannabe
Posts: 24
Joined: July 22nd, 2009, 3:27 pm

Re: Adding bombs (non-SD)

Post by Lennard » October 21st, 2009, 2:29 pm

It's the same script as the poster of this topic has used.
I also made a topic where I explain my error and stuff.
It's quite unnecessary to copy and paste the whole topic again so here's the link:

http://codjumper.com/forums/viewtopic.php?f=11&t=1068

Thanks for helping anyway :)

Shazamm
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: January 15th, 2010, 3:53 pm

Re: Adding bombs (non-SD)

Post by Shazamm » January 15th, 2010, 3:57 pm

Yea i get a script error when i try this exploding bomb.
With the (bomb.target,"targetname");
People should make sure the shit works before they post a tut on it. lol
I followed it to a T and im no noob when it comes to radiant. (thats why i cant get it to work)lol
I used the same script that the poster posted in my map.gsc file.

Any Help?

Pwn-Rikku
CJ Spammer!
CJ Spammer!
Posts: 679
Joined: August 15th, 2005, 7:58 pm

Re: Adding bombs (non-SD)

Post by Pwn-Rikku » January 15th, 2010, 6:18 pm

Lennard wrote:It's the same script as the poster of this topic has used.
I also made a topic where I explain my error and stuff.
It's quite unnecessary to copy and paste the whole topic again so here's the link:

http://codjumper.com/forums/viewtopic.php?f=11&t=1068

Thanks for helping anyway :)
It does work, but I have NO idea on it now :) hence this was back when Call of Duty 1 was new.
Rikku - Old skool
Image
Image

Shazamm
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: January 15th, 2010, 3:53 pm

Re: Adding bombs (non-SD)

Post by Shazamm » January 15th, 2010, 7:26 pm

lol well it doesnt work for me at all or the other dude.

Pwn-Rikku
CJ Spammer!
CJ Spammer!
Posts: 679
Joined: August 15th, 2005, 7:58 pm

Re: Adding bombs (non-SD)

Post by Pwn-Rikku » January 15th, 2010, 7:28 pm

Pwn-Rikku wrote:
Lennard wrote:It's the same script as the poster of this topic has used.
I also made a topic where I explain my error and stuff.
It's quite unnecessary to copy and paste the whole topic again so here's the link:

http://codjumper.com/forums/viewtopic.php?f=11&t=1068

Thanks for helping anyway :)
It does work, but I have NO idea on it now :) hence this was back when Call of Duty 1 was new.
Then you have no idea on how to work radiant :)
Just wait for someone that actually knows how this works still.
Rikku - Old skool
Image
Image

Shazamm
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: January 15th, 2010, 3:53 pm

Re: Adding bombs (non-SD)

Post by Shazamm » January 15th, 2010, 11:50 pm

Are you talkin to me or Leonard? Cause you keep quoting him. But i dont see him around..lol

Pwn-Rikku
CJ Spammer!
CJ Spammer!
Posts: 679
Joined: August 15th, 2005, 7:58 pm

Re: Adding bombs (non-SD)

Post by Pwn-Rikku » January 15th, 2010, 11:51 pm

Shazamm wrote:Are you talkin to me or Leonard? Cause you keep quoting him. But i dont see him around..lol
Wrong quote button... embarrassing -.-
Rikku - Old skool
Image
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests