ok correct me if i am wrong. I'm not good at scripting but i added threads onto the script like so...
Code:
// Special effects script used with a trigger_damage
// By Grassy
// Edited by KKFPlayername for 4 different tanks
main()
{
//Load effects needed
level._effect["tankmetalexp"] = loadfx ("fx/weapon/explosions/tank_metal.efx");
level._effect["smallfire"] = loadfx ("fx/fire/tinybon.efx");
level._effect["ashsmoke"] = loadfx ("fx/smoke/ash_smoke.efx");
level._effect["impact_sparks"] = loadfx ("fx/weapon/impacts/impact_smg_metal.efx");
level._effect["steam"] = loadfx ("fx/pi_fx/factory_steam.efx");
thread tank_effects();
thread tank_effects2();
thread tank_effects3();
thread tank_effects4();
}
tank_effects()
{
//If any of these entities are missing exit safely from the script
//Trigger_damage on the tank; targetname is "tank_trig"
trig = getent ("tank_trig", "targetname");
if(!isDefined(trig))
return;
//Undamaged tank model, make script_model, targetname "tank"
goodmodel = getent("tank", "targetname");
if(!isDefined(goodmodel))
return;
//Destroyed tank model, aslo script_model, targetname "tank_d"
destroyedmodel = getent("tank_d", "targetname");
if(!isDefined(destroyedmodel))
return;
//Script origin, place where fx will show on tank, targetname "fx_org"
fxpos = getent("fx_org", "targetname");
if(!isDefined(fxpos))
return;
//Hide the destroyed model
destroyedmodel hide();
//Get the fx origin to play effects on
fxpos_org = fxpos getorigin();
//Define a few variables used to keep track of damage levels
//and to play or not play the effects
hit_count = 0;
level.fx = true;
//Loop until damage level reaches 90 then exit loop
while(1)
{
//waits here for each hit on the trigger
trig waittill("trigger");
//Increment the variable hit_count by 30
//this is for panerfaust hits as they will cause a lot of damage each hit
//and three hits should be enough to kill a tank
hit_count += 30;
//When the hit_count reaches 30 play these effects
if(hit_count == 30)
{
thread loopfx("impact_sparks", fxpos_org, 1, 1);
thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
}
//When hit_count reaches 60 set the level wide variable level.fx to false
//so the routine "loopfx" below will stop playing them, wait .5 then reset
//the variable so the new effects will play
if(hit_count == 60)
{
level.fx = false;
wait(0.5);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
thread loopfx("smallfire", fxpos_org, 0.3, 1);
}
//When we get to 90 stop all effects looping and play a nice BOOM!
//then delete the goodmodel and show the damaged one
//and exit the main loop, trigger is still there but dosn't do anything
if(hit_count == 90)
{
level.fx = false;
wait(2);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
playfx(level._effect["tankmetalexp"], (fxpos_org));
goodmodel delete();
destroyedmodel show();
break;
}
}
}
loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
return;
if(!isDefined(waitime))
waitime = 1;
while (level.fx) {
playfx(level._effect[fxId], fxPos);
wait (waitime);
}
tank_effects2()
{
//If any of these entities are missing exit safely from the script
//Trigger_damage on the tank; targetname is "tank_trig"
trig = getent ("tank_trig2", "targetname");
if(!isDefined(trig))
return;
//Undamaged tank model, make script_model, targetname "tank2"
goodmodel = getent("tank2", "targetname");
if(!isDefined(goodmodel))
return;
//Destroyed tank model, aslo script_model, targetname "tank_d"
destroyedmodel = getent("tank_d2", "targetname");
if(!isDefined(destroyedmodel))
return;
//Script origin, place where fx will show on tank, targetname "fx_org"
fxpos = getent("fx_org2", "targetname");
if(!isDefined(fxpos))
return;
//Hide the destroyed model
destroyedmodel hide();
//Get the fx origin to play effects on
fxpos_org = fxpos getorigin();
//Define a few variables used to keep track of damage levels
//and to play or not play the effects
hit_count = 0;
level.fx = true;
//Loop until damage level reaches 90 then exit loop
while(1)
{
//waits here for each hit on the trigger
trig waittill("trigger");
//Increment the variable hit_count by 30
//this is for panerfaust hits as they will cause a lot of damage each hit
//and three hits should be enough to kill a tank
hit_count += 30;
//When the hit_count reaches 30 play these effects
if(hit_count == 30)
{
thread loopfx("impact_sparks", fxpos_org, 1, 1);
thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
}
//When hit_count reaches 60 set the level wide variable level.fx to false
//so the routine "loopfx" below will stop playing them, wait .5 then reset
//the variable so the new effects will play
if(hit_count == 60)
{
level.fx = false;
wait(0.5);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
thread loopfx("smallfire", fxpos_org, 0.3, 1);
}
//When we get to 90 stop all effects looping and play a nice BOOM!
//then delete the goodmodel and show the damaged one
//and exit the main loop, trigger is still there but dosn't do anything
if(hit_count == 90)
{
level.fx = false;
wait(2);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
playfx(level._effect["tankmetalexp"], (fxpos_org2));
goodmodel delete();
destroyedmodel show();
break;
}
}
}
loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
return;
if(!isDefined(waitime))
waitime = 1;
while (level.fx) {
playfx(level._effect[fxId], fxPos);
wait (waitime);
}
tank_effects3()
{
//If any of these entities are missing exit safely from the script
//Trigger_damage on the tank; targetname is "tank_trig"
trig = getent ("tank_trig3", "targetname");
if(!isDefined(trig))
return;
//Undamaged tank model, make script_model, targetname "tank2"
goodmodel = getent("tank3", "targetname");
if(!isDefined(goodmodel))
return;
//Destroyed tank model, aslo script_model, targetname "tank_d"
destroyedmodel = getent("tank_d3", "targetname");
if(!isDefined(destroyedmodel))
return;
//Script origin, place where fx will show on tank, targetname "fx_org"
fxpos = getent("fx_org3", "targetname");
if(!isDefined(fxpos))
return;
//Hide the destroyed model
destroyedmodel hide();
//Get the fx origin to play effects on
fxpos_org = fxpos getorigin();
//Define a few variables used to keep track of damage levels
//and to play or not play the effects
hit_count = 0;
level.fx = true;
//Loop until damage level reaches 90 then exit loop
while(1)
{
//waits here for each hit on the trigger
trig waittill("trigger");
//Increment the variable hit_count by 30
//this is for panerfaust hits as they will cause a lot of damage each hit
//and three hits should be enough to kill a tank
hit_count += 30;
//When the hit_count reaches 30 play these effects
if(hit_count == 30)
{
thread loopfx("impact_sparks", fxpos_org, 1, 1);
thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
}
//When hit_count reaches 60 set the level wide variable level.fx to false
//so the routine "loopfx" below will stop playing them, wait .5 then reset
//the variable so the new effects will play
if(hit_count == 60)
{
level.fx = false;
wait(0.5);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
thread loopfx("smallfire", fxpos_org, 0.3, 1);
}
//When we get to 90 stop all effects looping and play a nice BOOM!
//then delete the goodmodel and show the damaged one
//and exit the main loop, trigger is still there but dosn't do anything
if(hit_count == 90)
{
level.fx = false;
wait(2);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
playfx(level._effect["tankmetalexp"], (fxpos_org3));
goodmodel delete();
destroyedmodel show();
break;
}
}
}
loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
return;
if(!isDefined(waitime))
waitime = 1;
while (level.fx) {
playfx(level._effect[fxId], fxPos);
wait (waitime);
}
tank_effects4()
{
//If any of these entities are missing exit safely from the script
//Trigger_damage on the tank; targetname is "tank_trig"
trig = getent ("tank_trig4", "targetname");
if(!isDefined(trig))
return;
//Undamaged tank model, make script_model, targetname "tank2"
goodmodel = getent("tank4", "targetname");
if(!isDefined(goodmodel))
return;
//Destroyed tank model, aslo script_model, targetname "tank_d"
destroyedmodel = getent("tank_d3", "targetname");
if(!isDefined(destroyedmodel))
return;
//Script origin, place where fx will show on tank, targetname "fx_org"
fxpos = getent("fx_org4", "targetname");
if(!isDefined(fxpos))
return;
//Hide the destroyed model
destroyedmodel hide();
//Get the fx origin to play effects on
fxpos_org = fxpos getorigin();
//Define a few variables used to keep track of damage levels
//and to play or not play the effects
hit_count = 0;
level.fx = true;
//Loop until damage level reaches 90 then exit loop
while(1)
{
//waits here for each hit on the trigger
trig waittill("trigger");
//Increment the variable hit_count by 30
//this is for panerfaust hits as they will cause a lot of damage each hit
//and three hits should be enough to kill a tank
hit_count += 30;
//When the hit_count reaches 30 play these effects
if(hit_count == 30)
{
thread loopfx("impact_sparks", fxpos_org, 1, 1);
thread loopfx("ashsmoke", fxpos_org, 0.5, 1);
}
//When hit_count reaches 60 set the level wide variable level.fx to false
//so the routine "loopfx" below will stop playing them, wait .5 then reset
//the variable so the new effects will play
if(hit_count == 60)
{
level.fx = false;
wait(0.5);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
thread loopfx("smallfire", fxpos_org, 0.3, 1);
}
//When we get to 90 stop all effects looping and play a nice BOOM!
//then delete the goodmodel and show the damaged one
//and exit the main loop, trigger is still there but dosn't do anything
if(hit_count == 90)
{
level.fx = false;
wait(2);
level.fx = true;
thread loopfx("steam", fxpos_org, 0.5, 1);
playfx(level._effect["tankmetalexp"], (fxpos_org4));
goodmodel delete();
destroyedmodel show();
break;
}
}
}
loopfx(fxId, fxPos, waitime) {
if( (!isDefined(fxPos)) || (!isDefined(fxId)) )
return;
if(!isDefined(waitime))
waitime = 1;
while (level.fx) {
playfx(level._effect[fxId], fxPos);
wait (waitime);
}
}
try that, but i slaped it together and didn't test it so corrections would be nice b/c I would like to fix my scripting errors for letter use. Thanks