Frictional Games Forum (read-only)
Easy Interaction/Physics Question - 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: Easy Interaction/Physics Question (/thread-20736.html)



Easy Interaction/Physics Question - Cyphermur9t - 03-14-2013

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?


RE: Easy Interaction/Physics Question - PutraenusAlivius - 03-14-2013

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.


RE: Easy Interaction/Physics Question - NaxEla - 03-14-2013

SetPropStaticPhysics("wood_beam.ent", false);

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


RE: Easy Interaction/Physics Question - PutraenusAlivius - 03-14-2013

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


RE: Easy Interaction/Physics Question - Cyphermur9t - 03-14-2013

Got it working. Thanks a bunch guys!