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
Amnesia Sound Trigger Script Help
NuggetBlubber Offline
Junior Member

Posts: 13
Threads: 7
Joined: Nov 2011
Reputation: 2
#1
Amnesia Sound Trigger Script Help

Ok so im brand new to amnesias custom story creator and so far I have made the first part of my map. What I want to do is create an area so when the player walks through it a sound will play. So far I havent been able to figure it out. This is the script code I have been using

PlaySoundAtEntity("", "enabled.snt", "guardian_area1", 6.0f, false);

and I put this script in the void OnEnter() section. I cant get it to play when I walk through the area I set it to activate on, but it will just randomly go off while im playing. Please help I am not all good when it comes to scripting thanks.

(This post was last modified: 11-28-2011, 03:46 PM by NuggetBlubber.)
11-28-2011, 03:44 PM
Find
Unearthlybrutal Offline
Posting Freak

Posts: 775
Threads: 12
Joined: May 2011
Reputation: 26
#2
RE: Amnesia Sound Trigger Script Help

(11-28-2011, 03:44 PM)NuggetBlubber Wrote: Ok so im brand new to amnesias custom story creator and so far I have made the first part of my map. What I want to do is create an area so when the player walks through it a sound will play. So far I havent been able to figure it out. This is the script code I have been using

PlaySoundAtEntity("", "enabled.snt", "guardian_area1", 6.0f, false);

and I put this script in the void OnEnter() section. I cant get it to play when I walk through the area I set it to activate on, but it will just randomly go off while im playing. Please help I am not all good when it comes to scripting thanks.
Use this:

Spoiler below!



void OnStart()
{
PreloadSound("enabled.snt");
AddEntityCollideCallback("Player", "guardian_area1", "Sound", true, 1);
}


void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("sound", "enabled.snt", "guardian_area1", 0.0, false);
}



You should check out some tutorials of scriptingSmile
They are really helpful sometimes

When Life No Longer Exists
Full-conversion mod
(This post was last modified: 11-28-2011, 04:19 PM by Unearthlybrutal.)
11-28-2011, 04:18 PM
Website Find




Users browsing this thread: 2 Guest(s)