Frictional Games Forum (read-only)

Full Version: Certain Entities are unscriptable?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.



}
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.