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
PlayerLookAtEntiy error?
X4anco Offline
Member

Posts: 157
Threads: 66
Joined: Apr 2011
Reputation: 0
#1
PlayerLookAtEntiy error?

Hellos people N00B here:
SetEntityPlayerLookAtCallback("sofa_2", "scare1", true);
void scare1(string &in entity, int alState)
{
    PlayGuiSound("react/react_scare6.ogg", 1);
    GiveSanityDamage(20, true);
}

I'm trying to make the player react when he looks at something
but nothing happens Sad

Thx

...
05-12-2011, 07:27 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: PlayerLookAtEntiy error?

I don't know exactly how to use the callback from the LookAt function, but you create:
SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt);
at the same time as the LookAt is triggered.
05-12-2011, 07:43 PM
Find
Acies Offline
Posting Freak

Posts: 1,643
Threads: 60
Joined: Feb 2011
Reputation: 73
#3
RE: PlayerLookAtEntiy error?

void scare1(string &in entity, int alState)
{
if(alState == -1) AddDebugMessage("DebugMessage", false);
else if (alState == 1)
{
PlayGuiSound("react/react_scare6.ogg", 1);
GiveSanityDamage(20, true);
return;
}
}

alstate = -1 not looking
alstate = 1 looking

[Image: mZiYnxe.png]


05-12-2011, 08:00 PM
Find




Users browsing this thread: 1 Guest(s)