The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Making two StartPlayerLookAt one after the other?
Ungotter Offline
Junior Member

Posts: 11
Threads: 3
Joined: Sep 2012
Reputation: 0
#1
Question  Making two StartPlayerLookAt one after the other?

I feel like I'm being a burden by using these forums almost frequently, but I'm really stuck right now.

My goal here is to have a player look at something, then after that is done, look behind him, so this happens pretty much immediately after the first look is done. Yes, I did post a thread asking how to do the whole thing this is based around, but this is a new problem completely.

What happens is that the player doesn't look a second time, the sound plays and everything works as should, except the second StartPlayLookAt. Can anyone explain why this doesn't work? Please I've been trying to get this to work for hours last night and hours today, I've gone through the script functions on the wiki and found nothing.
void OnStart()
{
    AddDebugMessage("OnStart!", false);
    AddEntityCollideCallback("Player", "BottleFallArea", "BottleFall", true, 1);
    AddEntityCollideCallback("Player", "BodyAlley", "BodyAlleyScare", true, 1);
}

void OnEnter()
{
    AddDebugMessage("OnEnter!", false);
}

void OnLeave()
{
    AddDebugMessage("OnLeave!", false);
}

void BottleFall(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("wine02_1", true);
}

void BodyAlleyScare(string &in asParent, string &in asChild, int alState)
{
    StartPlayerLookAt("corpse_male_1", 4.0f, 4.0f, "");
    GiveSanityDamage(5.0f, true);
    AddTimer("BodyAlleyTimer", 3.0f, "Timer_01");
}

void Timer_01(string &in asTimer)
{
    StopPlayerLookAt();
    StartPlayerLookAt("stairs_railing_worn_11", 4.0f, 4.0f, "");
    PlaySoundAtEntity("PlatformDoor", "16_bridge_unstuck", "castle_portcullis_3", 0.1f, false);
    AddTimer("BodyAlleyTimer2", 3.0f, "Timer_02");
}

void Timer_02(string &in asTimer)
{
    StopPlayerLookAt();
}
(This post was last modified: 09-16-2012, 04:51 PM by Ungotter.)
09-16-2012, 03:34 PM
Find


Messages In This Thread
Making two StartPlayerLookAt one after the other? - by Ungotter - 09-16-2012, 03:34 PM



Users browsing this thread: 1 Guest(s)