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
Script Help Lever opening bookshelf?
Author Message
Biscuitbarrel Offline
Junior Member

Posts: 4
Joined: Apr 2012
Reputation: 0
Post: #1
Lever opening bookshelf?
Hey, I'm working on my first custom story mod. It's more of a practice thing for myself, because I'm just learning scripting for HPL2 and want to understand all the mechanics I can before going into my big project idea.

I've got a hunk of code to fix. I'm trying to make a lever move a bookshelf.

void OnStart()
{
    SetEntityConnectionStateChangeCallback("lever_1, "PullLever");
}

void PullLever(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    AddBodyForce("secret_shelf_1", 0, 0, -3, "world");
    }
}

Can someone tell me exactly what's up? Should I be using AddBodyForce, AddBodyImpulse, AddPropForce, or AddPropImpulse? And what's the difference? Remember, I'm brand-spanking-new to this. Mostly. I have also made a readable note and an unlock-able door.
(This post was last modified: 04-27-2012 11:41 PM by Biscuitbarrel.)
04-27-2012 11:40 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Lever opening bookshelf? - Biscuitbarrel - 04-27-2012 11:40 PM
RE: Lever opening bookshelf? - Adrianis - 05-11-2012, 02:06 PM



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