Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Piano?
EmmetVG Offline
Junior Member

Posts: 47
Threads: 7
Joined: Nov 2011
Reputation: 2
#1
Piano?

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?

Help?

06-05-2012, 09:44 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Piano?

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!

I rate it 3 memes.
06-05-2012, 10:07 AM
Find
EmmetVG Offline
Junior Member

Posts: 47
Threads: 7
Joined: Nov 2011
Reputation: 2
#3
RE: Piano?

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

06-06-2012, 05:53 PM
Find




Users browsing this thread: 1 Guest(s)