Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quick question with script!
Author Message
SLAMnesia Offline
Member

Posts: 94
Joined: May 2011
Reputation: 0
Post: #1
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!
thanks
06-26-2011 01:23 AM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
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
Visit this user's website Find all posts by this user Quote this message in a reply
palistov Offline
Posting Freak

Posts: 1,186
Joined: Mar 2011
Reputation: 56
Post: #3
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
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)