I’m having a hell of a time destroying a placeable VFX! From what I understand, the object is supposed to be destroyed after the script is through running.
For OnUsed
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
// Apply a visual effect.
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect
( VFX_FNF_SOUND_BURST_SILENT ), GetNearestObjectByTag("SOUND_BURST"));
// Begin sound que.
AssignCommand(oPC, PlaySound("deep_horn"));
DelayCommand(4.5, AssignCommand(oPC, PlaySound("pulse_machine")));
DelayCommand(4.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "zep_lightshft045",
GetLocation(GetWaypointByTag("STASIS_FIELD"))));
DelayCommand(6.5, AssignCommand(oPC, PlaySound("sonar")));
DelayCommand(10.5, AssignCommand(oPC, PlaySound("steamburst_01")));
DelayCommand(12.0, AssignCommand(oPC, PlaySound("geiger")));
DelayCommand(14.0, AssignCommand(oPC, PlaySound("ct_scan")));
DelayCommand(16.5, AssignCommand(oPC, PlaySound("sonar")));
DestroyObject(GetNearestObjectByTag("ZEP_LIGHTSHFT001"), 22.0);
DelayCommand(21.5, AssignCommand(oPC, PlaySound("power_down_01")));
return;
}
Everything fires as it should except to destroy the lightshaft. Need to get this thing gone!
Edit:
New code:
#include "nw_i0_2q4luskan"
void PrepForDestruction(object oTarget)
{
SetPlotFlag(oTarget, FALSE);
SetImmortal(oTarget, FALSE);
AssignCommand(oTarget, SetIsDestroyable(TRUE, FALSE, FALSE));
}
void main()
{
object oPC = GetLastUsedBy();
if (!GetIsPC(oPC)) return;
object oTarget = GetNearestObjectByTag("ZEP_LIGHTSHFT001");
// Apply a visual effect.
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect
( VFX_FNF_SOUND_BURST_SILENT ), GetNearestObjectByTag("SOUND_BURST"));
// Begin sound que.
AssignCommand(oPC, PlaySound("deep_horn"));
DelayCommand(4.5, AssignCommand(oPC, PlaySound("pulse_machine")));
DelayCommand(4.5, CreateObjectVoid(OBJECT_TYPE_PLACEABLE, "zep_lightshft045",
GetLocation(GetWaypointByTag("STASIS_FIELD"))));
DelayCommand(6.5, AssignCommand(oPC, PlaySound("sonar")));
DelayCommand(10.5, AssignCommand(oPC, PlaySound("steamburst_01")));
DelayCommand(12.0, AssignCommand(oPC, PlaySound("geiger")));
DelayCommand(14.0, AssignCommand(oPC, PlaySound("ct_scan")));
DelayCommand(16.5, AssignCommand(oPC, PlaySound("sonar")));
PrepForDestruction(oTarget);
DestroyObject(oTarget, 22.0);
DelayCommand(21.5, AssignCommand(oPC, PlaySound("power_down_01")));
return;
}
Same result however. Do I have it set up right?