Darkaroth
Junior Member
Posts: 11
Threads: 2
Joined: Feb 2012
Reputation:
0
|
Sound when picking up an item
Hey all, i would like to know how you play the soundfile of the screaming man already got the sound file for it. ( already got the corpse male to appear when picking up the note too ). This is what i got so far:
////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "key1", "mansiondoor1", "open", true);
SetEntityCallbackFunc("offensiveletter", "OnPickup");
}
void open(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansiondoor1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansiondoor1", 0, false);
RemoveItem("key1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("man1", true);
PlaySoundAtEntity("", "15_the_big_scream1", "Player", 0, false);
}
(This post was last modified: 02-08-2012, 07:45 PM by Darkaroth.)
|
|
02-08-2012, 05:29 PM |
|
Ermu
Member
Posts: 86
Threads: 13
Joined: Jan 2012
Reputation:
2
|
RE: Sound when picking up an item
Try this putting .snt at the end of the sound file like this:
PlaySoundAtEntity("", "15_the_big_scream1.snt", "Player", 0, false);
I assume you have .snt file done already for the sound file (if it is custom sound)?
(This post was last modified: 02-08-2012, 07:48 PM by Ermu.)
|
|
02-08-2012, 07:47 PM |
|
Darkaroth
Junior Member
Posts: 11
Threads: 2
Joined: Feb 2012
Reputation:
0
|
RE: Sound when picking up an item
It's not a custom sound, it is some scream located in the sound map itself. and i will try that, thanks.
(02-08-2012, 07:47 PM)Ermu Wrote: Try this putting .snt at the end of the sound file like this:
PlaySoundAtEntity("", "15_the_big_scream1.snt", "Player", 0, false);
I assume you have .snt file done already for the sound file (if it is custom sound)? Still does not work. Have any other ideas?
(This post was last modified: 02-08-2012, 08:28 PM by Darkaroth.)
|
|
02-08-2012, 08:22 PM |
|
SilentStriker
Posting Freak
Posts: 950
Threads: 26
Joined: Jul 2011
Reputation:
43
|
RE: Sound when picking up an item
I guess it doesn't work because you are using the wrong callback
instead of SetEntityCallbackFunc use:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
and then change the syntax on OnPickup to only (string &in asEntity)
|
|
02-08-2012, 08:38 PM |
|
Darkaroth
Junior Member
Posts: 11
Threads: 2
Joined: Feb 2012
Reputation:
0
|
RE: Sound when picking up an item
(02-08-2012, 08:38 PM)SilentStriker Wrote: I guess it doesn't work because you are using the wrong callback
instead of SetEntityCallbackFunc use:
SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
and then change the syntax on OnPickup to only (string &in asEntity) Will try thanks !
|
|
02-08-2012, 08:57 PM |
|
|