Frictional Games Forum (read-only)
[SCRIPT] Piano? - Printable Version

+- Frictional Games Forum (read-only) (
+-- Forum: Amnesia: The Dark Descent (
+--- Forum: Custom Stories, TCs & Mods - Development (
+---- Forum: Development Support (
+---- Thread: [SCRIPT] Piano? (/thread-15860.html)

Piano? - EmmetVG - 06-05-2012

So im doing this scare, when the player touches the piano notes the piano lid will smash shut and make a loud bang, but i cant find any script that's working for moving the lid?
I've tried: get Lever state, Swing door, prop impulse.

What is the correct script for this?


RE: Piano? - Adny - 06-05-2012

I believe you need a combination of "SetLeverStuckState" and "AddPropImpulse".

I've taken the liberty to find the script FG used in the Archives map, which seems to be what you're looking for (I've removed all scripts irrelevant to the desired function):

void CollideCloseLid(string &in asParent, string &in asChild, int alState)
SetLeverStuckState("piano_1", 0, false);
AddPropImpulse("piano_1", 0,0,10, "world");

GiveSanityDamage(10, true);

Since your event takes place when the player interacts directly with the piano rather than colliding with an area, you can use the following callback syntax:

void pianofunction(string &in asEntity)

I hope that helped!

RE: Piano? - EmmetVG - 06-06-2012

Thanks for the help. I solved the problem myself... I was scripting on Map1.hps when the piano event were on Map2 xD I'm stupid sometimes ;D