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
Cant get this function to work (sound)
Fralexxelarf Offline
Junior Member

Posts: 24
Threads: 5
Joined: Jan 2012
Reputation: 0
#1
Cant get this function to work (sound)

Quote:void OnStart()
{
SetEntityPlayerInteractCallback("Key_1", "Scary_3_1", true);

}

void Scary_3_1(string &in entity)
{
SetEntityActive("Skull_1", true);
PlaySoundAtEntity("", "21_scream7.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
AddTimer("CabinetTimer",0.7, "Scary_3_2");

}
This is so weird cause all the other functions work but not the "PlaySoundAtEntity" , and I have used that script before, in the same map. Does anyone have an idea why it doesnt work?
(This post was last modified: 01-03-2012, 03:29 PM by Fralexxelarf.)
01-03-2012, 03:27 PM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Cant get this function to work (sound)

(01-03-2012, 03:27 PM)Fralexxelarf Wrote:
Quote:void OnStart()
{
SetEntityPlayerInteractCallback("Key_1", "Scary_3_1", true);

}

void Scary_3_1(string &in entity)
{
SetEntityActive("Skull_1", true);
PlaySoundAtEntity("", "21_scream7.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
AddTimer("CabinetTimer",0.7, "Scary_3_2");

}
This is so weird cause all the other functions work but not the "PlaySoundAtEntity" , and I have used that script before, in the same map. Does anyone have an idea why it doesnt work?
Did you restart the CS and try again?


01-03-2012, 03:43 PM
Find
Fralexxelarf Offline
Junior Member

Posts: 24
Threads: 5
Joined: Jan 2012
Reputation: 0
#3
RE: Cant get this function to work (sound)

yep, and i have no music in the background, this works though, after entering an area;
Quote: PlaySoundAtEntity("", "12_girl_scream.snt", "Player", 0, false);
but if i replace it with 21_scream7 in my
Quote:PlaySoundAtEntity("", "21_scream7.snt", "Player", 0, false);
it still doesnt sound when i pick up the key, is there something wrong with
Quote:void Scary_3_1(string &in entity)?


here's an other sound script, the function works but the sound wont play;
Quote:
void OnStart()
{
AddEntityCollideCallback("Player", "Scary_Area_1", "Scary_1", true, 1);

}

void Scary_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Scary_1", "lurker_hit_wood1.snt", "player", 0, false);
AddPropImpulse("armour_nice_complete_1", 0, 0, 2, "world");

}

nevermind, the snt's were corrupt
(This post was last modified: 01-03-2012, 04:40 PM by Fralexxelarf.)
01-03-2012, 04:05 PM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#4
RE: Cant get this function to work (sound)

I've been having the same issue with:

PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
The file is located in redist/sounds/Custom, and is not corrupted.

Its hard to see the truth when you've been blinded by lies.
01-03-2012, 05:51 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#5
RE: Cant get this function to work (sound)

(01-03-2012, 05:51 PM)eagledude4 Wrote: I've been having the same issue with:

PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
The file is located in redist/sounds/Custom, and is not corrupted.
The game will find the filename, no need to give it information about the folder location.
PlaySoundAtEntity("big_clock_chime", "big_clock_chime.snt", "clock_grandfather_1", 0, false);

01-03-2012, 06:17 PM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#6
RE: Cant get this function to work (sound)

(01-03-2012, 06:17 PM)Khyrpa Wrote:
(01-03-2012, 05:51 PM)eagledude4 Wrote: I've been having the same issue with:

PlaySoundAtEntity("big_clock_chime", "Custom\big_clock_chime.snt", "clock_grandfather_1", 0, false);
The file is located in redist/sounds/Custom, and is not corrupted.
The game will find the filename, no need to give it information about the folder location.
PlaySoundAtEntity("big_clock_chime", "big_clock_chime.snt", "clock_grandfather_1", 0, false);

Using your code, the sound still doesn't load.



Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-03-2012, 08:28 PM by eagledude4.)
01-03-2012, 08:28 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#7
RE: Cant get this function to work (sound)

also, the syntax was incorrect.

void Scary_3_1(string &in entity)


Should be:

void Scary_3_1(string &in asEntity)



Perhaps that will solve another issue that comes up.
01-03-2012, 09:12 PM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#8
RE: Cant get this function to work (sound)

My sound issue hasn't been resolved yet.

Its hard to see the truth when you've been blinded by lies.
01-05-2012, 02:27 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#9
RE: Cant get this function to work (sound)

(01-05-2012, 02:27 AM)eagledude4 Wrote: My sound issue hasn't been resolved yet.
Have you torrented your amnesia or something? Be honest.
01-05-2012, 02:29 AM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#10
RE: Cant get this function to work (sound)

(01-05-2012, 02:29 AM)Statyk Wrote:
(01-05-2012, 02:27 AM)eagledude4 Wrote: My sound issue hasn't been resolved yet.
Have you torrented your amnesia or something? Be honest.

Yes Sad I'd buy it if steam would let me use my debit card. I can get custom sounds to work through the level editor, just not through my script.



Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-05-2012, 02:34 AM by eagledude4.)
01-05-2012, 02:30 AM
Find




Users browsing this thread: 1 Guest(s)