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
SetEntityPlayerLookAtCallback HUGE PROBLEM!
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#1
Sad  SetEntityPlayerLookAtCallback HUGE PROBLEM!

Let me cut to the chase. This is what I did


void OnEnter()
{
SetEntityPlayerLookAtCallback("ritual_prisoner_1", "bodysound", true);
}

void bodysound(string &in asEntity, int alState)
{
SetEntityActive("ritual_prisoner_1", false);
PlaySoundAtEntity("", "scare_male_terrified5.snt", "ScriptArea_26", 0, false);
}



Nothing happens. I did a search on google for: "SetEntityPlayerLookAtCallback" And I found many post on this same problem: Nothing happens.

Does SetEntityPlayerLookAtCallback even work? Or is it a just dud? Am I doing anything wrong? Help would be appreciated
(This post was last modified: 10-27-2012, 11:45 AM by lllDash.)
10-27-2012, 11:43 AM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

This should work Smile

void OnEnter()

{
SetEntityPlayerLookAtCallback("ritual_prisoner_1", "bodysound", true);
}

void bodysound(string &in asEntity, int alState)
{

if(alState == 1)
{

SetEntityActive("ritual_prisoner_1", false);
PlaySoundAtEntity("", "scare_male_terrified5.snt", "ScriptArea_26", 0, false);
}

}

When Life No Longer Exists
Full-conversion mod
10-27-2012, 11:52 AM
Website Find
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#3
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

(10-27-2012, 11:52 AM)Unearthlybrutal Wrote: This should work Smile

void OnEnter()

{
SetEntityPlayerLookAtCallback("ritual_prisoner_1", "bodysound", true);
}

void bodysound(string &in asEntity, int alState)
{

if(alState == 1)
{

SetEntityActive("ritual_prisoner_1", false);
PlaySoundAtEntity("", "scare_male_terrified5.snt", "ScriptArea_26", 0, false);
}

}
(FacePalm) Oh, thanks. I'm an idiot Rolleyes . But it still didn't work! However I eventually did get it to work. Looking at ritual_prisoner_1 does nothing, but looking at a scriptarea does. Dodgy Why is it even called SetEntityPlayerLookAtCallback if it doesn't even work with entities?!

Although I'm still soooooo angry that this problem had wasted so much of my time, I am still grateful for your help. thanx
10-27-2012, 12:40 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

I guess the scripts area has something that the prisoner doesn't have... Like when grunts doesn't have bodies...

Though, just cover the prisoner in a script area. Also remember that the callback only triggers if the CROSSHAIR is on the area. Therefor the player can still see the prisoner, but without triggering the event, except if you make the area big enough so that the prisoner is only just inside the screen, when the crosshair touches the area

Trying is the first step to success.
10-27-2012, 01:22 PM
Find
lllDash Offline
Member

Posts: 108
Threads: 12
Joined: Apr 2012
Reputation: 3
#5
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

Yea, took me a while to get the size of the area right.
10-27-2012, 09:42 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

(10-27-2012, 09:42 PM)lllDash Wrote: Yea, took me a while to get the size of the area right.
But when you got it, it's goooold!

Trying is the first step to success.
10-27-2012, 10:17 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

(10-27-2012, 01:22 PM)beecake Wrote: I guess the scripts area has something that the prisoner doesn't have... Like when grunts doesn't have bodies...
The script area has a center, while the prisoner doesn't have it. When you choose an area, you click the name, right? The prisoner doesn't have anything special, while the area was especifically designed to be that way.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-27-2012, 10:19 PM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#8
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

(10-27-2012, 10:19 PM)The chaser Wrote:
(10-27-2012, 01:22 PM)beecake Wrote: I guess the scripts area has something that the prisoner doesn't have... Like when grunts doesn't have bodies...
The script area has a center, while the prisoner doesn't have it. When you choose an area, you click the name, right? The prisoner doesn't have anything special, while the area was especifically designed to be that way.
Actually, every entity has a center. That's where the arrows in the level editor are placed.

[Image: 18694.png]
(This post was last modified: 10-27-2012, 11:36 PM by Ongka.)
10-27-2012, 11:36 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#9
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!

(10-27-2012, 11:36 PM)Ongka Wrote:
(10-27-2012, 10:19 PM)The chaser Wrote:
(10-27-2012, 01:22 PM)beecake Wrote: I guess the scripts area has something that the prisoner doesn't have... Like when grunts doesn't have bodies...
The script area has a center, while the prisoner doesn't have it. When you choose an area, you click the name, right? The prisoner doesn't have anything special, while the area was especifically designed to be that way.
Actually, every entity has a center. That's where the arrows in the level editor are placed.
I meant that the engine turns mad when having to look at there. Areas were designed for that.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-27-2012, 11:55 PM
Find




Users browsing this thread: 1 Guest(s)