Probiere mal das:
Scripting
1. Add this line, " #include maps\mp\_utility; " to the very top of your map's script -- if not there already.
2. In the main thread add this line, " thread exploding_barrels(); ".
3. Then add the following code to the bottom of the script.
exploding_barrels() // by Bodger2
{
level._effect["barrel_explode"] = loadfx ("fx/props/barrelExp.efx");
level._effect["barrel_burn_start"] = loadfx ("fx/props/barrel_ignite.efx");
level._effect["barrel_burn"] = loadfx ("fx/props/barrel_fire2.efx"); // or ("fx/fire/building_fire_large.efx") or ("fx/props/barrel_fire.efx")
dtrig = getentarray ("barrel_trigger","targetname");
for (t=0; t<dtrig.size; t++) dtrig[t] thread barrel_think();
}
barrel_think()
{
self waittill ("trigger");
//iprintlnbold ("barrel explosion!"); // for debug
barrel = getentarray(self.target,"targetname");
for (b=0; b<barrel.size; b++) barrel[b] thread barrel_exploded();
wait.5;
self delete();
}
barrel_exploded()
{
clip = getent(self.target, "targetname");
playfx (level._effect["barrel_burn_start"],self.origin);
wait .5;
playfx (level._effect["barrel_burn"], ((self.origin) + (0,0,10)));
wait randomint((1) + 1);
self playsound ("explo_metal_rand");
playfx (level._effect["barrel_explode"], ((self.origin) + (0,0,45)));
radiusDamage (self.origin + (0,0,56), 320, 150, 20); //(origin, range, max_damage, min_damage)
earthquake(0.3, 3, self.origin, 2096); //(scale, duration, source, radius)
wait .25;
self delete();
clip delete();
}
Mapping
1. Add a script_model barrel ( xmodel/prop_barrel_benzin will do) to your map -- no targetname.
2. Make a metal clip textured brush. Turn it into a script_brushmodel -- no targetname.
3. Make a trigger brush, slightly larger than the barrel. Turn it into a trigger_damage, and targetname it " barrel_trigger ".
4. Add spawnflags to the trigger to prevent melee, explosion, and splash damage.
5. Select the trigger and then the barrel, hit key W -- you should see a red line connect the two.
6. Select the barrel and then the clip brush, hit key W -- should see a blue line.
7. It is easier to clone the barrel set now -- before you assemble, save, and compile.