Frictional Games Forum (read-only)
Whats wrong with this script - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Whats wrong with this script (/thread-7188.html)



Whats wrong with this script - Itskody - 04-03-2011

I wanted to have my character get scared when looking at something, but it doesnt seem to work, tell me whats wrong with this.
PHP Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
    
SetEntityPlayerLookAtCallback(pigScarePigfalse);
}

void ScarePig(string &in entityint alState)
{
    
GiveSanityDamage(10.0ftrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);




RE: Whats wrong with this script - Russ Money - 04-03-2011

You're missing some quotes

SetEntityPlayerLookAtCallback("pig", "ScarePig", false);

Also, with it set false, the player will get scared each time they look at it.


RE: Whats wrong with this script - Itskody - 04-03-2011

(04-03-2011, 09:35 PM)Russ Money Wrote: You're missing some quotes

SetEntityPlayerLookAtCallback("pig", "ScarePig", false);

wow thanks i feel dumb now haha


RE: Whats wrong with this script - Russ Money - 04-03-2011

Believe me, I do it all the time.


RE: Whats wrong with this script - Itskody - 04-03-2011

haha, i fixed it, but my guy doesnt get scared when he looks at the entity?, do i need to script my guy to look at the entity or what?


RE: Whats wrong with this script - Russ Money - 04-03-2011

(04-03-2011, 09:38 PM)Itskody Wrote: haha, i fixed it, but my guy doesnt get scared when he looks at the entity?, do i need to script my guy to look at the entity or what?

I'm not really sure, I used the same effect but I used script areas instead of entities.


RE: Whats wrong with this script - Itskody - 04-03-2011

oh, nvm i got it, thanks tho