Frictional Games Forum (read-only)

Full Version: Wind to blow out candles, and lever to open secret passage?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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
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.
Still not sure how to get the lever that makes the secret shelf/wall work. Help?
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.
Use this to make your shelf move:
Code:
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);
}
}
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
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)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..
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?
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...
Pages: 1 2