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
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#11
RE: Inverted Controls

If it's not possible, and if you just want to disorientate the player, how about giving the player pushes?

Different amounts, smaller or bigger, forward, backward, left, right, with random timers.
This could definitely work for a drunken feeling.
Also remember to spin the player-camera for extra effect.

Trying is the first step to success.
10-08-2014, 04:31 PM
Find
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.25f2.5f);
    
FadeRadialBlurTo(0.05f0.01f);
    
PlayGuiSound("27_thump"1.0f);
    
AddTimer("DrunkModeMoveTimer"RandFloat(1.0f2.0f), "DrunkMode_MoveReset");
    
AddTimer("DrunkModeViewTimer"RandFloat(0.5f2.5f), "DrunkMode_ViewAdjust");
}

void DrunkMode_Stop()
{
    
FadePlayerFOVMulTo(1.0f2.5f);
    
FadeRadialBlurTo(0.0f0.01f);
    
MovePlayerHeadPos(0.0f0.0f0.0f1.0f0.25f);
    
FadePlayerRollTo(0.0f1.0f10.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.0f0.0ffalse);
        
AddTimer("DrunkModeMoveTimer"RandFloat(3.0f4.0f), "DrunkMode_MoveReset");
    }
    else if(
GetGlobalVarFloat("PlayerPrevX") - GetPlayerPosX() > 0.1f)
    {
        
AddPlayerBodyForce(RandFloat(20000.0f30000.0f), 0.0f0.0ffalse);
        
AddTimer("DrunkModeMoveTimer"RandFloat(3.0f4.0f), "DrunkMode_MoveReset");
    }
    
    if(
GetGlobalVarFloat("PlayerPrevZ") - GetPlayerPosZ() < -0.1f)
    {
        
AddPlayerBodyForce(0.0f0.0fRandFloat(-30000.0f, -20000.0f), false);
        
AddTimer("DrunkModeMoveTimer"RandFloat(3.0f4.0f), "DrunkMode_MoveReset");
    }
    else if(
GetGlobalVarFloat("PlayerPrevZ") - GetPlayerPosZ() > 0.1f)
    {
        
AddPlayerBodyForce(0.0f0.0fRandFloat(30000.0f20000.0f), false);
        
AddTimer("DrunkModeMoveTimer"RandFloat(3.0f4.0f), "DrunkMode_MoveReset");
    }
    else
    {
        
AddTimer("DrunkModeMoveTimer"RandFloat(1.0f2.0f), "DrunkMode_MoveReset");
    }
}

void DrunkMode_ViewAdjust(string &in asTimer)
{
    
FadeRadialBlurTo(RandFloat(0.01f0.05f), 0.01f);
    
MovePlayerHeadPos(RandFloat(-0.2f0.2f), RandFloat(-0.2f0.2f), RandFloat(-0.2f0.2f), RandFloat(0.05f0.1f), 0.05f);
    
FadePlayerRollTo(RandFloat(-10.0f10.0f), 1.0f10.0f);
    
AddTimer("DrunkModeViewTimer"RandFloat(0.5f2.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
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#13
RE: Inverted Controls

Thanks guys. I'll test around a bit with this.

Derp.
10-08-2014, 09:12 PM
Find




Users browsing this thread: 2 Guest(s)