Frictional Games Forum (read-only)
Lowering a metal_bridge_vert with a lever? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Lowering a metal_bridge_vert with a lever? (/thread-6427.html)



Lowering a metal_bridge_vert with a lever? - Beatlebattle - 01-30-2011

I've tried to use the script from the campaign but it's way to difficult for me to understand. I've tried some other things like replace the upper bridge with a lower bridge but visually it looks like crap. I wonder how to lower the bridge after you've pulled all the 3 levers with a simple as possible script. Does anyone have any experience with this?


RE: Lowering a metal_bridge_vert with a lever? - Beatlebattle - 01-31-2011

It seems this might be too difficult. I guess I could try to use only 1 lever for the bridge to lower but I still don't know how. I would really like to have the script because when I got this my story is finished Smile


RE: Lowering a metal_bridge_vert with a lever? - Vradcly - 02-01-2011

Ill let you know if i do anything similar, but right now I cant help you...


RE: Lowering a metal_bridge_vert with a lever? - Beatlebattle - 02-01-2011

(02-01-2011, 12:06 AM)Vradcly Wrote: Ill let you know if i do anything similar, but right now I cant help you...

I just figured it out how to do it. I copied it somewhere else. Here's the script:

void InteractBridgeLever1(string &in asEntity, int alState)
{
if(alState == 0) return;
string sBridge = asEntity=="" ? "" : "bridge_metal_vert_1";

if(alState == -1)
{
if(GetLocalVarInt(asEntity) == -1) return; //Fix behaviour error if pulling lever double direction.
SetMoveObjectState(sBridge, 2.66);
PlaySoundAtEntity("soundclank_"+sBridge, "14_elevator_clank", "Player", 0.5f, false);
StartScreenShake(0.05f, 0.5f, 0.2f, 0.6f);
}

SetLeverStuckState(asEntity, alState, true);
AddDebugMessage(asEntity + " State: "+alState, true);
}
void OnStart()
{

You have to fill InteractBridgeLever1 in the levers ConnectStateChangeCallback