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
Gravity
Venom Fox Offline
Junior Member

Posts: 32
Threads: 9
Joined: Mar 2016
Reputation: 0
#3
RE: Gravity

(08-03-2016, 03:20 PM)Darkfire Wrote: Maybe Player_SetGravity(0.0f); ?

Here's the script I used for that effect:
Spoiler below!

PHP Code: (Select All)
void UnderWater(string &in asParentstring &in asChildint alState////this function was executed when entering an area, making the player float in low gravity
{
    
SetLanternActive(falsetrue);
    
SetLanternDisabled(true);
    
SetPlayerLookSpeedMul(0.85f);
    
SetPlayerRunSpeedMul(0.8f);
    
SetPlayerMoveSpeedMul(0.7f);
    
AddTimer("slow"0.01f"SlowJump");
}

void SlowJump(string &in asTimer)
{
    if(
asTimer == "slow")
    {
        
AddTimer("slow"0.01f"SlowJump"); ////this is the proper part that gives low gravity - it has to be a timer on a loop
        
if(GetPlayerYSpeed() > 0.01f)
        {
            
AddPlayerBodyForce(06000false);
        }
    }
    if(
asTimer == "normal")
    {
        
RemoveTimer("slow");
    }
    
}

void NoWater(string &in asParentstring &in asChildint alState/////andd this was executed when leaving the area, which resulted in normal gravity
{
    
SetLanternDisabled(false);
    
SetPlayerLookSpeedMul(1.0f);
    
SetPlayerRunSpeedMul(1.0f);
    
SetPlayerMoveSpeedMul(1.0f);
    
AddTimer("normal"0.01f"SlowJump");



Nah, won't work.. :/
08-03-2016, 03:47 PM
Find


Messages In This Thread
Gravity - by Venom Fox - 08-03-2016, 03:05 PM
RE: Gravity - by Darkfire - 08-03-2016, 03:20 PM
RE: Gravity - by Venom Fox - 08-03-2016, 03:47 PM
RE: Gravity - by Darkfire - 08-03-2016, 03:53 PM
RE: Gravity - by Romulator - 08-03-2016, 04:59 PM
RE: Gravity - by Venom Fox - 08-03-2016, 05:58 PM
RE: Gravity - by MrBehemoth - 08-03-2016, 06:34 PM
RE: Gravity - by Venom Fox - 08-03-2016, 06:38 PM
RE: Gravity - by Darkfire - 08-03-2016, 08:58 PM



Users browsing this thread: 1 Guest(s)