It seems that CopyObject doesn’t work for me when used on placeable. At first I thought that there is some exception for npc lootable corpses, but neither it is working with chest placeable.
vector vPos = GetPosition(OBJECT_SELF); vPos.z+= 20.0; location lNew = Location(GetArea(OBJECT_SELF),vPos,GetFacing(OBJECT_SELF)); SendMessageToPC(oPC,APSLocationToString(lNew)); object oCopy = CopyObject(OBJECT_SELF,lNew,OBJECT_INVALID,"copy"); SendMessageToPC(oPC,"oCopy: "+ObjectToString(oCopy)); SetLocalObject(OBJECT_SELF,ObjectToString(oPC),oCopy);
OBJECT_SELF is placeable, script is called from OnUse event, the debug messages shows the location is/should be valid, yet oCopy is OBJECT_INVALID.
Despite the function header specifies only creature and item, Lexicon says it works with placeables as well. I cannot remember whether I copied any placeable before, but surely I had to, yet it doesn’t work now. What I am missing here?