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