Destroy Placeables
Zephirius
Member Posts: 419
I was wondering how you would assure that certain placeables are destroyed by an AOE spell cast by an antagonist?
I tried weakening them so they would explode whaen a fireball hit them, but they just sit there unscathed...
I don't want them to vanish, like when you use DestroyObject(), but rather I want them to explode.
I tried weakening them so they would explode whaen a fireball hit them, but they just sit there unscathed...
I don't want them to vanish, like when you use DestroyObject(), but rather I want them to explode.
0
Comments
you could set a script on the items that you want destroyed on the "on death" script and set it so it does the "explosion" animation
{
object oTarget;
effect eVFX;
// Get the creature who triggered this event.
object oPC = GetLastKiller();
// We are really interested in the ultimate master of the killer.
while ( GetMaster(oPC) != OBJECT_INVALID )
oPC = GetMaster(oPC);
// Destroy an object (not fully effective until this script ends).
eVFX = EffectVisualEffect(VFX_FNF_GAS_EXPLOSION_FIRE);
oTarget = GetObjectByTag("*place_object_tag_here*");
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget);
DestroyObject(oTarget, 3.0);
}
now when it comes to scripting i'm actually quite horrible at it, but with this one, if the you place it upon the "on death" script and if the PC destroys the object then it should explode
now if you are a bit more script savy, you can replace all the oPC stuff with the NPC you are trying to use and hopefully have the same effect
if not, worse case scenario that last bit with the;
// Destroy an object (not fully effective until this script ends).
should hopefully get you started in the right direction
Gotta have some cool splosions. That's for sure.