Frictional Games Forum (read-only)

Full Version: Floating :P
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I guess I need to ask help once in a while as well from scripting pros. I, myself tried many things but they didn't end up as I wanted.

So question is, is it possile to push player exactly that much up that he seems like floating or maybe going very slowly down.

Using AddPlayerBodyForce with timer, it may go almost really slowly but at one point it will be pushed back up into the skies.

It would be cool if we could create kind of script what will keep Player pretty much floating in the sky and as smoothly as possible Tongue...

That is, if it is possible Wink.
Do you mean float up? Or hover across the ground?
Use this loop. You'll need to experiment to find the proper values yourself. Just a word of warning, if you constantly apply vertical force to the player to make them float, it may make it extremely difficult for them to move around. You may need to experiment with also drastically increasing their movement speed to compensate for this unresponsiveness. Just make sure you turn it back down when you want them to stop floating Wink
PHP Code:
float fPause =  0.0166f;
void SomeRandomFXN(blahblahblah)
{
// run function instantly, name timer same as function name
PLAYER_FLOAT("PLAYER_FLOAT");
}

void PLAYER_FLOAT(string &in timer)
{
//add player vertical body force here
//loop it
AddTimer(timerfPausetimer);

(01-26-2012, 03:06 PM)palistov Wrote: [ -> ]Use this loop. You'll need to experiment to find the proper values yourself. Just a word of warning, if you constantly apply vertical force to the player to make them float, it may make it extremely difficult for them to move around. You may need to experiment with also drastically increasing their movement speed to compensate for this unresponsiveness. Just make sure you turn it back down when you want them to stop floating Wink
PHP Code:
float fPause =  0.0166f;
void SomeRandomFXN(blahblahblah)
{
// run function instantly, name timer same as function name
PLAYER_FLOAT("PLAYER_FLOAT");
}

void PLAYER_FLOAT(string &in timer)
{
//add player vertical body force here
//loop it
AddTimer(timerfPausetimer);

I didn't know you could make a void like that..(PLAYER_FLOAT("PLAYER_FLOAT")Wink

Also what does float fPause do?


@Shadowfied, fPause is just a variable.
(01-26-2012, 03:12 PM)palistov Wrote: [ -> ]@Shadowfied, fPause is just a variable.
Yeah didn't see the timer at the bottom, just by seeing that I think I understand it. Tongue

Just use block boxes.
(01-26-2012, 05:57 PM)Your Computer Wrote: [ -> ]Just use block boxes.
I was thinking that too, but what if you were walking and want the player to float up, as if someone going to heaven or something, you know?
(01-26-2012, 06:51 PM)Statyk Wrote: [ -> ]I was thinking that too, but what if you were walking and want the player to float up, as if someone going to heaven or something, you know?

Make stairs out of block boxes.
(01-26-2012, 06:56 PM)Your Computer Wrote: [ -> ]Make stairs out of block boxes.
But say you don't want the player to descend when going backwards. Then you know it's a "staircase" =\
Pages: 1 2