Frictional Games Forum (read-only)

Full Version: Quick question with script!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have an entity named 'bored1' (its a wooden plank lol). I want it to have 'StaticPhysics' but when you click on it, it becomes non-static. I just don't know the function for that so Big Grin it'd be appreciated to help!
thanks
void SetPropStaticPhysics(string& asName, bool abX);

Activates/deactivates the physics of a prop. Setting as true will make entities static in midair.

For this and more: http://wiki.frictionalgames.com/hpl2/amn..._functions
You can't interact with static objects, only entities. To get around this, create a script area that fits and wraps around the board. Name it "board_area". Under the Area tab, fill in the field 'PlayerInteractCallback' with "BoardPhysicsOn". Make sure PlayerInteractCallbackAutoRemove is checked.

In your script, put this function

void BoardPhysicsOn(string &in entity)
{
SetPropStaticPhysics("bored1", false);
SetEntityInteractionDisabled("board_area", true);
}