*CUSTOM* Exploding Barrels

Tutorials for Call of Duty 4 mapping

Moderator: Core Staff

User avatar
Lethal323
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: February 22nd, 2008, 11:47 pm
Location: Colorado
Contact:

*CUSTOM* Exploding Barrels

Post by Lethal323 » February 23rd, 2008, 12:28 am

Start by creating a Script_Model

Give it these values:

Key: Model
Value: xmodel/barrel_black1


Image

Give it the following values:

Key: Targetname
Value: Barrel


Now create a Script_orgin

Give it the following Values:

Key: Targetname
Value: Barrel_so


Place the script orgin inside the barrel

Image


Now make a Textures>common>trigger around the barrel

Make it a Trigger_Damage

Give it the following values:

Key: Targetname
Value: Barrel_Trigger


Image


Thats it for the mapping, now onto scripting...
Create a new text document name it (map name).gsc

Put the following in the .gsc file:

Code: Select all

main()
{
barrel();
}
barrel()
{
trig = getent("Barrel_Trigger","targetname");
block = getentarray ("Barrel_","targetname");
so = getent ("Barrel_so","targetname");

boom = loadfx("fx/explosions/hunted_gasstation_explosion.efx");
while (1)
{
trig waittill ("damage", idamage);
if(idamage > 50)
{
playfx(boom, so.origin);
for(int i=1;i<block.size;i++)
{
block[i] moveZ (400, 1, 0, 1);
wait 0.05;
block[i] moveZ (-400, 1, 1, 0);
}
}
}
}


Special thanks to CooL for finding the EFX file for the explosion
And Nightmare for the entire tut
Last edited by Lethal323 on February 26th, 2008, 3:30 am, edited 3 times in total.
Image

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 25th, 2008, 12:01 am

What barrel do we use for this, where and what the barrel name please, i like to try it out, or will it work on any barrel.?

Steve

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 25th, 2008, 3:42 am

Hay lethal323,
what would i need to put for a MASS explosion of barrels, say like i have 15 barrels, and i just shoot one barrel, how would you go about makeing them all explode in 1 go.?? Any idears, as this would be a wicked explosion view, instead of shooting barrel after barrel.?

Is it possible, can ya be a sport and see if you can make one with the script,ect please. i want in in my map.

Steve

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

Re: *CUSTOM* Exploding Barrels

Post by Nightmare » February 25th, 2008, 3:59 am

Here try this.

Code: Select all

main()
{
barrel();
}
barrel()
{
trig = getent("Barrel_Trigger","targetname");
block = getentarray ("Barrel_","targetname");
so = getent ("Barrel_so","targetname");

boom = loadfx("fx/explosions/mp_bomb.efx");
while (1)
{
trig waittill ("damage", idamage);
if(idamage > 50)
{
playfx(boom, so.origin);
for(int i=1;i<block.size;i++)
{
block[i] moveZ (400, 1, 0, 1);
wait 0.05;
block[i] moveZ (-400, 1, 1, 0);
}
}
}
}
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]

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 25th, 2008, 4:18 am

thanks will try them al ltomorrow, as ive been doing my Containerpark B1(beta1) today again adding and moveing shit all around, there still stuff need sorting but i thought wht the fuck let people try it as it is then i cann do those required bit as well for B2

As you all know im no good at adding techincal shit like this, it trials and error like my terrinan i did lol

Will see how it goes i eithr add it if it works or dump it if it dont.

Steve

Pedsdude
Site Admin
Site Admin
Posts: 15906
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: *CUSTOM* Exploding Barrels

Post by Pedsdude » February 25th, 2008, 5:12 am

Images to come soon, presumably?

Nice tutorial 8)
Image
Image

User avatar
helium
CJ Spammer!
CJ Spammer!
Posts: 718
Joined: December 31st, 2007, 9:04 am
Location: Sweden

Re: *CUSTOM* Exploding Barrels

Post by helium » February 25th, 2008, 6:59 am

Thanks!!
Image

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 25th, 2008, 3:48 pm

Lethal323 wrote:Start by creating a Script_Model

Give it these values:

Key: Model
Value: xmodel/barrel_black1


Image

Give it the following values:

Key: Targetname
Value: Barrel


Now create a Script_orgin

Give it the following Values:

Key: Targetname
Value: Barrel_so


Place the script orgin inside the barrel

Image


Now make a Textures>common>trigger around the barrel

Make it a Trigger_Damage

Give it the following values:

Key: Targetname
Value: Barrel_Trigger


Image


Thats it for the mapping, now onto scripting...
Create a new text document name it (map name).gsc

Put the following in the .gsc file:

Code: Select all

main()
{
barrel();
}
barrel()
{
trig = getent("Barrel_Trigger","targetname");
block = getent ("Barrel","targetname");
so = getent ("Barrel_so","targetname");

boom = loadfx("fx/explosions/mp_bomb.efx");
while (1)
{
trig waittill ("damage", idamage);
if(idamage > 50)
{
playfx(boom, so.origin);
block moveZ (400, 1, 0, 1);
block waittill ("movedone");
wait 0.05;
block moveZ (-400, 1, 1, 0);
block waittill ("movedone");
block movez (8, .05, 0, 0);
block waittill ("movedone");
block movez (-8, .05, 0, 0);
block waittill ("movedone");
}
}
}


SPECIAL THANKS TO NIGHTMARE
"]Start by creating a Script_Model

Give it these values:

Key: Model
Value: xmodel/barrel_black1


Image

Give it the following values:

Key: Targetname
Value: Barrel
DID THIS
Key: Targetname
Value: Barrel_so


Place the script orgin inside the barrel

Image


Now make a Textures>common>trigger around the barrel
What do you mean by target name/and value?
Do you mean make target name like Target Barrel 1 Value:20 ???somethink like this.?
Make it a Trigger_Damage

Give it the following values:

Key: Targetname
Value: Barrel_Trigger

Trigger Added ,still dont knwow what you mean by saying give Target name? Explain and write down please.

what ive done.

Image

Image

Image

Thats what i dont added, compiled and not exploding when i shot or nade.lol

Think i be more easier for ya to write the script and paot a demp.map of the barrels for us.lol,then we can just mess around adding or changeing the barrels around. ect

Steve

Pedsdude
Site Admin
Site Admin
Posts: 15906
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: *CUSTOM* Exploding Barrels

Post by Pedsdude » February 25th, 2008, 5:18 pm

steveuk wrote:Trigger Added ,still dont knwow what you mean by saying give Target name? Explain and write down please.
You select the entity, then you press 'n' to bring up the Entities window. You'll see a 'key' and a 'value' box. In the 'key' box, you put 'Targetname', in the 'value' box you put the value, in this case 'Barrel'. The scripting then uses this information so that it knows what entity in the map it's referring to. Understand?
Image
Image

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 25th, 2008, 5:35 pm

Pedsdude wrote:
steveuk wrote:Trigger Added ,still dont knwow what you mean by saying give Target name? Explain and write down please.
You select the entity, then you press 'n' to bring up the Entities window. You'll see a 'key' and a 'value' box. In the 'key' box, you put 'Targetname', in the 'value' box you put the value, in this case 'Barrel'. The scripting then uses this information so that it knows what entity in the map it's referring to. Understand?

what i mean is this is the Target name the Barrel name(barrel_black1_ or do you just put Target name see be low.

KEY: targename
Value:Barrel

or
Key: Barrel_black1
Value: barrel

or

Key: Barrel_black1
Value 20

Ect that what i need to know What is the TargetName?? is the target name Barrel or Barrel_black1 or do i just put it a ~targetname~ lol
A target is a item, being target name BrickWall./??

Edited is a CSV file require.?? if so what do i put in it.?


Steve

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

Re: *CUSTOM* Exploding Barrels

Post by Cpt.Cool » February 26th, 2008, 12:00 am

it doesnt work because you didnt enter in your values correctly, it will have its own separate section to enter in values, yours is mixed in with the worldspawn
Image
Image
YaNo wrote:I use Cool as my UO compiler :) Try it, it works!

User avatar
Lethal323
CJ Wannabe
CJ Wannabe
Posts: 5
Joined: February 22nd, 2008, 11:47 pm
Location: Colorado
Contact:

Re: *CUSTOM* Exploding Barrels

Post by Lethal323 » February 26th, 2008, 2:40 am

Appriciate everyone who has helped this guy :P

I was away
Image

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 26th, 2008, 3:27 am

Lethal323 wrote:Appriciate everyone who has helped this guy :P

I was away
It dont work m8, cool said somethnk about it may have a wrong FX in the script file or somethink. Can ya check and update please, i want this in my updated container map.lol
Thanks, i know ya trying, and mistakes can happen.lol

Cheers..
Steve

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

Re: *CUSTOM* Exploding Barrels

Post by Drofder2004 » February 26th, 2008, 10:58 am

If you select and object and then click N the entities window appears.

If when opened the selected entity is "worldspawn", then the selected item is not configured correctly and is not an entity.

Your values are in the "worldspawn" settings, so ofcourse it wont work.
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

steveuk
CJ G0D!
CJ G0D!
Posts: 1330
Joined: November 21st, 2006, 12:51 pm

Re: *CUSTOM* Exploding Barrels

Post by steveuk » February 26th, 2008, 5:02 pm

Ok i not got this working at all yet, but i was given otherhelp and to follow this guys opteions. and it works.

Hellrazor will show you how to make exploding barrels in Call of Duty 4.

http://www.modsonline.com/Tutorials-read-461.html

Check it out, it realy does work.

Steve

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests