Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Easy Interaction/Physics Question
Cyphermur9t Offline
Junior Member

Posts: 38
Threads: 17
Joined: Jan 2013
Reputation: 2
#1
Easy Interaction/Physics Question

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?
03-14-2013, 08:11 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Easy Interaction/Physics Question

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: (Select All)
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.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 03-14-2013, 08:39 AM by PutraenusAlivius.)
03-14-2013, 08:39 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: Easy Interaction/Physics Question

SetPropStaticPhysics("wood_beam.ent", false);

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

In Ruins [WIP]
03-14-2013, 08:47 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Easy Interaction/Physics Question

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

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-14-2013, 08:48 AM
Find
Cyphermur9t Offline
Junior Member

Posts: 38
Threads: 17
Joined: Jan 2013
Reputation: 2
#5
RE: Easy Interaction/Physics Question

Got it working. Thanks a bunch guys!
03-14-2013, 09:20 AM
Find




Users browsing this thread: 1 Guest(s)