Easy title, more difficult than I thought!
An NPC is spawned in using the below script:
void main()
{
SetIsDestroyable(FALSE, FALSE, FALSE);
ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(),OBJECT_SELF));
}
Works and is quite straight forward.
I'm unable to destroy the NPC in question using the following OnExit script:
void main()
{
object oPC = GetExitingObject();
object oNPC1=GetObjectByTag("AR510B2A_NPC1");
if (!GetIsPC(oPC)) return;
DestroyObject(oNPC1);
}
The TAG is correct.
I'd like to make sure that the script that kills the NPC keeps the NPC from fading BUT, I want to be able to remove the NPC from the area once the player has exited that area.
If I make it:
SetIsDestroyable(TRUE, FALSE, FALSE);
the NPC fades as a corpse normally would and doesn't stick around.
If I leave it:
SetIsDestroyable(FALSE, FALSE, FALSE);
the NPC remains but if the player exits and returns to the same area, there are now TWO NPCs that are in the area, one above the other. Rinse repeat for each time one returns to the area. NPCs are destroyed OnExit and respawned OnEnter.
Thoughts?
FP!
Modifié par Fester Pot, 17 septembre 2012 - 01:10 .