lllDash
Member
Posts: 108
Threads: 12
Joined: Apr 2012
Reputation:
3
|
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 |
|
Unearthlybrutal
Posting Freak
Posts: 775
Threads: 12
Joined: May 2011
Reputation:
26
|
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!
This should work
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);
}
}
|
|
10-27-2012, 11:52 AM |
|
lllDash
Member
Posts: 108
Threads: 12
Joined: Apr 2012
Reputation:
3
|
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!
(10-27-2012, 11:52 AM)Unearthlybrutal Wrote: This should work
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 . 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. Why is it even called Set EntityPlayerLookAtCallback 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 |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
lllDash
Member
Posts: 108
Threads: 12
Joined: Apr 2012
Reputation:
3
|
RE: SetEntityPlayerLookAtCallback HUGE PROBLEM!
Yea, took me a while to get the size of the area right.
|
|
10-27-2012, 09:42 PM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
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 |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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)
Aculy iz dolan.
|
|
10-27-2012, 10:19 PM |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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.
(This post was last modified: 10-27-2012, 11:36 PM by Ongka.)
|
|
10-27-2012, 11:36 PM |
|
The chaser
Posting Freak
Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation:
113
|
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)
Aculy iz dolan.
|
|
10-27-2012, 11:55 PM |
|
|