Frictional Games Forum (read-only)
Certain Entities are unscriptable? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Certain Entities are unscriptable? (/thread-56757.html)



Certain Entities are unscriptable? - gbstrcl - 04-09-2020

I do an interact callback between an in-game area script and a function that sets invisible the mesh of a book pile. thats what its supposed to do at least. But nothing happens, and there are no errors telling me what I could've done wrong. Ive quadruple checked all names and everything is consistent. Just the entity doesn't go anywhere, dissapear, or anything. Only the sound plays.

Code:
void OnStart()
{  
    SetEntityPlayerInteractCallback("ScriptInteract", "OnInteract", true);
}

void OnInteract(string &in asEntity)
{
    PlaySoundAtEntity("", "BookSlide.snt", "Player", 0, false);
    SetEntityPos("BookPile1", 3000, 3000, 3000);

//set entity pos was after I tried set mesh invisble and deactivate entity. Still nothing.



}



RE: Certain Entities are unscriptable? - Mudbill - 04-09-2020

Certain entities cannot be modified like this unfortunately. If you open them in the Model Editor, you can check their type under Settings > User Defined Variables. If this is set to StaticProp, it will be limited. You can fix it by changing it to Object (Static) instead, but you must save it as a custom entity and use that instead.

If you just want to make it disappear, you can try SetPropActiveAndFade. I think it works on StaticProp type entities, unless I'm misremembering.