Frictional Games Forum (read-only)
Only some of my scripts are working - 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: Only some of my scripts are working (/thread-26464.html)



Only some of my scripts are working - Spazatron - 09-29-2014

I have these scripts:

Code:
void OnStart()
{
    SetEntityActive("fall_box", false);
    SetEntityActive("fall_dust", false);
    PlaySoundAtEntity("clock_loop.ogg", "clock_loop.snt", "clock", 0, true); //play clock sound
    SetEntityInteractionDisabled("tar1", true); //disable tar pickups
    SetEntityInteractionDisabled("tar2", true); //
}

But only the
Code:
    SetEntityInteractionDisabled("tar1", true); //disable tar pickups
    SetEntityInteractionDisabled("tar2", true); //
works.

The fall_box and fall_dust are still active when the game starts and the sound doesn't play. Everything is written perfectly... :S


RE: Only some of my scripts are working - Mudbill - 09-29-2014

If the entities you are trying to interact with are set to the StaticProp type, it won't work. Those can't be disabled or interacted with. To avoid this, you can open those entities with the model editor and go to Edit > User Defined Variables and set the type to Object > Static instead. Resave as a custom entity and use that instead.