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
Wind to blow out candles, and lever to open secret passage?
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#1
Wind to blow out candles, and lever to open secret passage?

So this post of mine has two scripting questions... As you can see from the topic, I need to know just what kind of script I use to make that ghostly wind blow out all the candles in a certain area when I collide with an area trigger...
And I would also like to know how to script a lever to be pulled so a secret passage behind a bookshelf will be revealed by the bookshelf moving out of the way (like in the very beginning of the game)?

Thanks for any help provided

Check out my custom stories(1)(2)!
09-19-2010, 09:12 PM
Find
gosseyn Offline
Member

Posts: 63
Threads: 7
Joined: Sep 2010
Reputation: 1
#2
RE: Wind to blow out candles, and lever to open secret passage?

i think you just have to cast a particle effect or two well placed, and use SetLampLit to unlit the candles. For the lever you can use SetLeverStuckState and use an interaction callback to link it to the shelf. Moving the shelf is still blur to me, but i would use two shelves : one that is unmovable by the player and is active by the start of the map (use model editor to make it unmovable) and another shelf that is movable but inactive at map start. When the lever is pulled, make the unmovable shelf disappear (SetEntityActive) and the movable shelf appear, then use an impulse to move the shelf.
09-20-2010, 01:48 AM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#3
RE: Wind to blow out candles, and lever to open secret passage?

Still not sure how to get the lever that makes the secret shelf/wall work. Help?

Check out my custom stories(1)(2)!
09-20-2010, 08:09 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#4
RE: Wind to blow out candles, and lever to open secret passage?

Maybe look at how it works in the second level of the game? There is a lever that opens a shelf and a secret passage.
09-20-2010, 08:43 AM
Website Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#5
RE: Wind to blow out candles, and lever to open secret passage?

Use this to make your shelf move:
OnStart
{
SetEntityConnectionStateChangeCallback("lever_simple01_1", "StateChangeLever");
}

void StateChangeLever(string &in asEntity, int alState)
{
if(alState == 1){
SetLeverStuckState(asEntity, 1, true);
SetMoveObjectState("shelf_secret_door_1", 1.0f);
}
}

09-20-2010, 11:25 AM
Find
Enquea Offline
Junior Member

Posts: 2
Threads: 0
Joined: Sep 2010
Reputation: 0
#6
RE: Wind to blow out candles, and lever to open secret passage?

I'm trying to mimic the coding in the Old Archives hps file, but I'm having trouble with the actual rotate function. My code is give below...

void OnStart()
{

ConnectEntities("shelf_connection", "secret_lever", "secret_shelf", false, 1, "");
SetMoveObjectAngularOffsetArea("secret_shelf", "area_rotate");

}

I'll give the fatal error as well...

FATAL ERROR:
No matching signatures to 'SetMoveObjectAngularOffset(string@&, string@&)'
Ok, update time, I've gotten the shelf to move when I pull the lever...

However, rather than rotating like the shelf in the Old Archives it moves backwards...

void OnStart()
{

ConnectEntities("shelf_connection", "secret_lever", "secret_shelf", false, 1, "");

//SetMoveObjectAngularOffsetArea("secret_shelf", "area_rotate");

}

This is the code I used, I didn't use double slashes in the code before because I thought that it would comment out my SetMoveObject function...

I'll keep playing with it and see if I can get it to rotate rather than translate
(This post was last modified: 09-20-2010, 06:37 PM by Enquea.)
09-20-2010, 06:07 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#7
RE: Wind to blow out candles, and lever to open secret passage?

In the level editor, select the shelf, and there is a field where you can enter the name of an area to be used as the center of rotation. Then also, if I recall correctly, the entity in itself is specified to what sort of move it has. I think there are two type of "secret shelfs" one that slides and one that rotates.
09-20-2010, 07:01 PM
Website Find
Enquea Offline
Junior Member

Posts: 2
Threads: 0
Joined: Sep 2010
Reputation: 0
#8
Thumbs Up  RE: Wind to blow out candles, and lever to open secret passage?

(09-20-2010, 07:01 PM)jens Wrote: In the level editor, select the shelf, and there is a field where you can enter the name of an area to be used as the center of rotation. Then also, if I recall correctly, the entity in itself is specified to what sort of move it has. I think there are two type of "secret shelfs" one that slides and one that rotates.

Thanks for the info on the second door, it works like a charm..
09-20-2010, 07:17 PM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#9
RE: Wind to blow out candles, and lever to open secret passage?

Ok so I got the lever and secret shelf to work, but the lever is always in a position where it's not completely attached to the wall piece and therefore is very very hard to pull downwards to open the secret passage... The only way I got it to actually move downwards was to jump on top of it, why would the lever be so hard to move? I copied the exact stats from the one on the Old Archives level - I noticed that the lever is sitting about an inch off of the wall piece that is attached to the wall itself and sort of glitches around in its physics as if it's somehow stuck, but trying to move at the same time... Any help?

Check out my custom stories(1)(2)!
09-20-2010, 09:34 PM
Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#10
RE: Wind to blow out candles, and lever to open secret passage?

Does anyone know what I can do to fix my lever issue? I really need to get it fixed, it's one of the very last things before my map is finished! Can someone tell me just what stats (boxes to check in, etc) for the lever I need to input? Thanks...

Check out my custom stories(1)(2)!
09-20-2010, 11:36 PM
Find




Users browsing this thread: 3 Guest(s)