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
Quick question with script!
SLAMnesia Offline

Posts: 99
Threads: 39
Joined: May 2011
Reputation: 0
Quick question with script!

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!
06-26-2011, 01:23 AM
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
RE: Quick question with script!

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

06-26-2011, 01:39 AM
Website Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
RE: Quick question with script!

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);

(This post was last modified: 06-26-2011, 01:52 AM by palistov.)
06-26-2011, 01:52 AM

Users browsing this thread: 1 Guest(s)