Page 1 of 3

*CUSTOM* Exploding Barrels

Posted: February 23rd, 2008, 12:28 am
by Lethal323
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

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 12:01 am
by steveuk
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

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 3:42 am
by steveuk
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

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 3:59 am
by Nightmare
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);
}
}
}
}

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 4:18 am
by steveuk
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

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 5:12 am
by Pedsdude
Images to come soon, presumably?

Nice tutorial 8)

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 6:59 am
by helium
Thanks!!

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 3:48 pm
by steveuk
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

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 5:18 pm
by Pedsdude
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?

Re: *CUSTOM* Exploding Barrels

Posted: February 25th, 2008, 5:35 pm
by steveuk
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

Re: *CUSTOM* Exploding Barrels

Posted: February 26th, 2008, 12:00 am
by Cpt.Cool
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

Re: *CUSTOM* Exploding Barrels

Posted: February 26th, 2008, 2:40 am
by Lethal323
Appriciate everyone who has helped this guy :P

I was away

Re: *CUSTOM* Exploding Barrels

Posted: February 26th, 2008, 3:27 am
by steveuk
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

Re: *CUSTOM* Exploding Barrels

Posted: February 26th, 2008, 10:58 am
by Drofder2004
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.

Re: *CUSTOM* Exploding Barrels

Posted: February 26th, 2008, 5:02 pm
by steveuk
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