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
AddBodyForce Cabinet Doors Script Problem
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
RE: AddBodyForce Cabinet Doors Script Problem

(06-15-2013, 06:27 AM)DeAngelo Wrote: I've only been working with HPL for a few months and in that time I've had to learn the editor from scratch, scripting from scratch, and model editor from scratch (I was thinking about learning blender, but that's a can of worms I'm not gonna open till my first CS is done)

and the one thing I've learned about HPL, is no matter the scope of your custom story, you WILL run into a situation where the engine just can't do what you want. In these instances, you either cut your losses and move on, or you improvise.

For instance, I have a wedding flashback in my story, where I force the player to "walk down the aisle" but the normal "force player to walk" script I didn't like because of the head bobble. I could've cut my losses, but I had already spent about 4 hours building the church (4 hours on something the player will see for a 3 second flashback, story of the Amnesia CS creators life, am I right?) so what I did was took a painting, modified it to be a move object, turned it sideways and plopped the player on it. Now they glide beautifully during the scene. In essence I turned a work of art into a surf board. Amazing what you can do in HPL with some improvising. Smile
Lol, agreed.

06-15-2013, 05:15 PM
Mazl Offline
Junior Member

Posts: 5
Threads: 1
Joined: Jun 2013
Reputation: 0
RE: AddBodyForce Cabinet Doors Script Problem

(06-15-2013, 03:41 AM)Amn Wrote:
(06-13-2013, 02:30 PM)DeAngelo Wrote: This would be a bit roundabout, but you could try this: Make a new entity that is a move object, but is invisible. (You could just modify the blockbox and save it as a new entity)

Then place them in the level at the right angles so that when you move them (and move them rather fast but a short distance) they will "smack" the doors.

As I said, a bit roundabout but it should achieve what you want.
Actually that's an awesome idea.
I don't know if applying it here it's the best solution but it's great for more complex stuff. So i'll keep it in mind in case i ever need it. +rep DeAngelo.


I always use BodyImpulse and is working for me.
I just put the cabinet in my map, wrote this line and it opened one door as it should.

AddBodyImpulse( "cabinet_nice_1_Body_1", 5, 0, 5, "" );

Now when I Use this code:

AddBodyImpulse( "cabinet_nice_2_Body_1", 0, 0, -3, "" );
AddBodyImpulse( "cabinet_nice_2_Body_2", 0, 0, -3, "" );

than it is working.... this is strange for me, but now its working, thanks Smile

Edit: oh no, now i know why it dont worked. It was because i locked the door at the beginning, and unlocked it in the middle. But when i not lock it at the beginning, than it is working.... (i know, very bad english Big Grin)
(This post was last modified: 06-16-2013, 10:46 PM by Mazl.)
06-16-2013, 05:21 PM

Users browsing this thread: 1 Guest(s)