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
How to make a piano lid lift slowly
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#4
RE: How to make a piano lid lift slowly

Try this:
PHP Code: (Select All)
int pianoTick=0;
float fPianoStep=0.02f;
void PianoLift(string &in timer)
{
    
pianoTick++;
    if(
pianoTick 50) return;
    
SetLeverStuckState("pianonamehere"fPianoStep*pianoTickfalse);
    
AddTimer(""0.05f"PianoLift");


This loop repeats very quickly to constantly be adding a small upwards force to the lid. You'll definitely have to tweak values to get it right since I have no idea what force values you'll need. Initiate it by using a timer with a duration of 0.01f, so it basically triggers instantly. Also, replace pianonamehere with your piano's name. Don't change the _BodyLid suffix, that designates the entity body to apply the force to.



LATER EDIT: Well I was curious so I tried it out in-game. Doesn't work very well, even with a custom entity with modified properties. The reason being that the object has gravity so it just falls back down. It works for doors though. :3

I'll try more stuff later, I have a few ideas in mind. Ropes and stuff.

(This post was last modified: 12-18-2011, 02:03 AM by palistov.)
12-18-2011, 01:15 AM
Find


Messages In This Thread
How to make a piano lid lift slowly - by Cryaotic - 12-18-2011, 12:05 AM
RE: How to make a piano lid lift slowly - by palistov - 12-18-2011, 01:15 AM



Users browsing this thread: 1 Guest(s)