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
Glitchy/Jittery Sleep?
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#1
Glitchy/Jittery Sleep?

I copied another poster's code to make the player spawn in as if asleep, but when lying on his side, my character's view jitters back and forth rapidly - it's not staying still while on it's side like it should be...

The code I used was:
void wakeUp () {
    FadeOut(0);     // Instantly fades the screen out. (Good for starting the game)
    FadeIn(20);      // Amount of seconds the fade in takes
    FadeImageTrailTo(2, 2);
    FadeSepiaColorTo(100, 4);
    SetPlayerActive(false);    
    FadePlayerRollTo(50, 220, 220);                 // "Tilts" the players head
    FadeRadialBlurTo(0.15, 2);
    SetPlayerCrouching(true);              // Simulates being on the ground
    AddTimer("trig1", 11.0f, "beginStory");            // Change '11.0f' to however long you want the 'unconciousness' to last
}

void beginStory(string &in asTimer){
    ChangePlayerStateToNormal();
    SetPlayerActive(true);
    FadePlayerRollTo(0, 33, 33);        // Change all settings to defaults
    FadeRadialBlurTo(0.0, 1);
    FadeSepiaColorTo(0, 4);
    SetPlayerCrouching(false);
    FadeImageTrailTo(0,1);
}

But I have since edited it and integrated it into Pandemoneus' StartPlayerLookAt Intro, and it still jitters about both before and after... Any ideas why it is like this?

Check out my custom stories(1)(2)!
09-22-2010, 02:23 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: Glitchy/Jittery Sleep?

It's better you post the code you have instead of one of the example you used. I am guessing it is the startplayerlookat that has too high values or a bit of a conflict in script making it hard to it to make up its mind, so the camera stutters.
09-22-2010, 05:11 AM
Website Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#3
RE: Glitchy/Jittery Sleep?

That's my point though, even before I integrated the StartPlayerLookAt into the WakeUp script, it still stuttered. But if it helps, I'll post my code below:

void Intro()
{
    AddDebugMessage("Begin Intro", false);
    SetPlayerCrouching(true);
    SetPlayerActive(false);
    FadeOut(0.0f);
    FadeIn(12.0f);
    FadeImageTrailTo(2, 2);
    FadePlayerRollTo(50, 220, 220);                 // "Tilts" the players head
    AddTimer("1", 2, "IntroTimer");
    AddTimer("2", 2.5f, "IntroTimer");
    AddTimer("3", 3, "IntroTimer");
    AddTimer("4", 4, "IntroTimer");
    AddTimer("5", 6, "IntroTimer");
}

void IntroTimer(string &in asTimer)
{
    if(asTimer == "1"){
        PlayGuiSound("player_cough.snt", 0.7f);
    }
    else if(asTimer == "2"){
        SetPlayerCrouching(false);
    }
    else if(asTimer == "3"){
        StartPlayerLookAt("candlestick_tri_1", 2.0f, 1.0f, "");
    }
    else if(asTimer == "4"){
        StopPlayerLookAt();
        StartPlayerLookAt("DoorScript", 3.0f, 3.0f, "");
        PlayGuiSound("react_breath_slow", 0.7f);
    }
    else if(asTimer == "5"){
        StopPlayerLookAt();
        FadeImageTrailTo(0, 1.0f);
        FadePlayerRollTo(0, 33, 33);        // Change all settings to defaults
        FadeSepiaColorTo(0, 4);
        PlayGuiSound("react_breath_slow", 0.5f);
        SetPlayerActive(true);
        SetMessage("Message", "Hint0", 0);
        AddDebugMessage("End Intro", false);
    }
}

Check out my custom stories(1)(2)!
09-22-2010, 05:23 AM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#4
RE: Glitchy/Jittery Sleep?

Ah sorry read too fast the second part.

Have you tried to disable FadeImageTrailTo in the script? That can look a bit stuttering if having strange values. Maybe lower the values in FadePlayerRollTo? perhaps change 220 to as low as 10 and go from there up.
09-22-2010, 05:43 AM
Website Find
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#5
RE: Glitchy/Jittery Sleep?

I'll try that, thanks. - EDIT: Ok so I reduced the 220 to 150 and it works like a charm now, thanks!
Question: Why do most people put in an F after their numerical values in their scripts? I don't and everything seems to still work fine.

Check out my custom stories(1)(2)!
(This post was last modified: 09-22-2010, 05:50 AM by theDARKW0LF.)
09-22-2010, 05:47 AM
Find
DamnNoHtml Offline
Senior Member

Posts: 469
Threads: 34
Joined: Sep 2010
Reputation: 16
#6
RE: Glitchy/Jittery Sleep?

I should probably edit that in my post :O

The higher value didn't cause this error for me though, weird.

Creator of Wake, Through the Portal, Insomnia, and Cycles What to do with HPL3....
09-22-2010, 10:31 PM
Find




Users browsing this thread: 1 Guest(s)