Frictional Games Forum (read-only)

Full Version: Easy Interaction/Physics Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm making a new custom story (MUCH better than my first one, wayyy better) and ran into a small scripting question that should be extremely simple but for the life of me can't figure out.

I have an entity (wood_beam.ent) with StaticPhysics check marked in the editor. My question is how can I make the object a physics object again so it falls and can interact with the player when the player touches a certain ScriptArea? I know how to make the player interact with the area already so no need to explain that part. In my functions though what command would I write? I tried this one:

SetEntityInteractionDisabled("wood_beam_29", false);

But to no avail. Any ideas?
You shouldn't check the StaticPhysics thing. Make a script area at the player's start area named "StaticEntity". Name your another script area named "DynamicEntity". This is the ScriptArea that will make the beam to be able to interact again . Here is the script.
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""StaticEntity""SetEntityNoInteract"true1);           
AddEntityCollideCallback("Player""DynamicEntity""SetEntityInteract"true1);
}

void SetEntityNoInteract(string &in asParentstring &in asChildint alState)
{
    
SetEntityInteractionDisabled("wood_beam_29"true);
}

void SetEntityInteract(string &in asParentstring &in asChildint alState)
{
    
SetEntityInteractionDisabled("wood_beam_29"false);

Hope this helps.
SetPropStaticPhysics("wood_beam.ent", false);

Don't forget to look at the wiki first before posting. Every script function is there Smile
(03-14-2013, 08:47 AM)NaxEla Wrote: [ -> ]SetPropStaticPhysics("wood_beam.ent", false);

Don't forget to look at the wiki first before posting. Every script function is there Smile

Is my script can be used? Please tell meh.
Got it working. Thanks a bunch guys!