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
Script Help Inverted Controls
MrBehemoth Offline
Senior Member

Posts: 408
Threads: 19
Joined: Feb 2014
Reputation: 40
#12
RE: Inverted Controls

Aww, shame, coz I just debugged it. Smile

If anyone is interested:
Spoiler below!
PHP Code: (Select All)
void DrunkMode_Start()
{
    
SetPlayerLookSpeedMul(-1);
    
FadePlayerFOVMulTo(1.25f, 2.5f);
    
FadeRadialBlurTo(0.05f, 0.01f);
    
PlayGuiSound("27_thump", 1.0f);
    
AddTimer("DrunkModeMoveTimer", RandFloat(1.0f, 2.0f), "DrunkMode_MoveReset");
    
AddTimer("DrunkModeViewTimer", RandFloat(0.5f, 2.5f), "DrunkMode_ViewAdjust");
}

void DrunkMode_Stop()
{
    
FadePlayerFOVMulTo(1.0f, 2.5f);
    
FadeRadialBlurTo(0.0f, 0.01f);
    
MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 1.0f, 0.25f);
    
FadePlayerRollTo(0.0f, 1.0f, 10.0f);
    
RemoveTimer("DrunkModeMoveTimer");
    
RemoveTimer("DrunkModeViewTimer");
}

void DrunkMode_MoveReset(string &in asTimer)
{
    
//AddDebugMessage("DrunkMode_Reset()", false);
    
SetGlobalVarFloat("PlayerPrevX", GetPlayerPosX());
    
SetGlobalVarFloat("PlayerPrevZ", GetPlayerPosZ());
    
AddTimer("DrunkModeMoveTimer", 0.1f, "DrunkMode_MoveDetect");
}

void DrunkMode_MoveDetect(string &in asTimer)
{
    if(
GetGlobalVarFloat("PlayerPrevX") - GetPlayerPosX() < -0.1f)
    {
        
AddPlayerBodyForce(RandFloat(-30000.0f, -20000.0f), 0.0f, 0.0f, false);
        
AddTimer("DrunkModeMoveTimer", RandFloat(3.0f, 4.0f), "DrunkMode_MoveReset");
    }
    else if(
GetGlobalVarFloat("PlayerPrevX") - GetPlayerPosX() > 0.1f)
    {
        
AddPlayerBodyForce(RandFloat(20000.0f, 30000.0f), 0.0f, 0.0f, false);
        
AddTimer("DrunkModeMoveTimer", RandFloat(3.0f, 4.0f), "DrunkMode_MoveReset");
    }
    
    if(
GetGlobalVarFloat("PlayerPrevZ") - GetPlayerPosZ() < -0.1f)
    {
        
AddPlayerBodyForce(0.0f, 0.0f, RandFloat(-30000.0f, -20000.0f), false);
        
AddTimer("DrunkModeMoveTimer", RandFloat(3.0f, 4.0f), "DrunkMode_MoveReset");
    }
    else if(
GetGlobalVarFloat("PlayerPrevZ") - GetPlayerPosZ() > 0.1f)
    {
        
AddPlayerBodyForce(0.0f, 0.0f, RandFloat(30000.0f, 20000.0f), false);
        
AddTimer("DrunkModeMoveTimer", RandFloat(3.0f, 4.0f), "DrunkMode_MoveReset");
    }
    else
    {
        
AddTimer("DrunkModeMoveTimer", RandFloat(1.0f, 2.0f), "DrunkMode_MoveReset");
    }
}

void DrunkMode_ViewAdjust(string &in asTimer)
{
    
FadeRadialBlurTo(RandFloat(0.01f, 0.05f), 0.01f);
    
MovePlayerHeadPos(RandFloat(-0.2f, 0.2f), RandFloat(-0.2f, 0.2f), RandFloat(-0.2f, 0.2f), RandFloat(0.05f, 0.1f), 0.05f);
    
FadePlayerRollTo(RandFloat(-10.0f, 10.0f), 1.0f, 10.0f);
    
AddTimer("DrunkModeViewTimer", RandFloat(0.5f, 2.5f), "DrunkMode_ViewAdjust");
} 


I'd recommend Flawless's idea - just give the player random pushes, with camera roll, and radial blur too, why not.

10-08-2014, 06:53 PM
Find


Messages In This Thread
Inverted Controls - by Neelke - 10-06-2014, 09:55 PM
RE: Inverted Controls - by Viper85626 - 10-06-2014, 10:31 PM
RE: Inverted Controls - by MrBehemoth - 10-07-2014, 01:17 AM
RE: Inverted Controls - by Neelke - 10-07-2014, 07:54 AM
RE: Inverted Controls - by Neelke - 10-07-2014, 07:51 PM
RE: Inverted Controls - by Mudbill - 10-07-2014, 10:44 PM
RE: Inverted Controls - by MrBehemoth - 10-08-2014, 07:33 AM
RE: Inverted Controls - by Neelke - 10-08-2014, 07:39 AM
RE: Inverted Controls - by Viper85626 - 10-08-2014, 03:44 PM
RE: Inverted Controls - by Neelke - 10-08-2014, 03:55 PM
RE: Inverted Controls - by FlawlessHappiness - 10-08-2014, 04:31 PM
RE: Inverted Controls - by MrBehemoth - 10-08-2014, 06:53 PM
RE: Inverted Controls - by Neelke - 10-08-2014, 09:12 PM



Users browsing this thread: 1 Guest(s)