Another actually simple script showing weird behaviour. It is an OnEnterArea-Script. It should destroy two creatures and two placeables and then spawn in a different placeable.
Creatures get destroyed (good), placeables don’t react (bad).
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
object oSpawn;
location lTarget;
SendMessageToPC(oPC, "Entering Area"); //Debug Feedback
int nInt;
nInt=GetLocalInt(oPC, "OrcAttack");
if (!(nInt == 1))
return;
nInt=GetLocalInt(oPC, "nHamDestroy");
if (nInt == 0)
{
SendMessageToPC(oPC, "Destroying"); //Debug Feedback
oTarget = GetObjectByTag("ct_Hamfast");
DestroyObject(oTarget, 0.0);
oTarget = GetObjectByTag("pt_HamHouse");
DestroyObject(oTarget, 0.0);
oTarget = GetObjectByTag("pt_StatueDefaced");
DestroyObject(oTarget, 0.0);
oTarget = GetObjectByTag("ct_Guard");
DestroyObject(oTarget, 0.0);
SendMessageToPC(oPC, "Creating"); // Debug Feedback
oTarget = GetWaypointByTag("wt_Ruin");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "ZEP_RUIN_Building_DAG", lTarget);
object oEncounter1 = GetObjectByTag("et_OrcInvasion20");
SetEncounterActive(TRUE, oEncounter1);
SetLocalInt(oPC, "nHamDestroy", 1);
}
}