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
Script Help Sound when picking up an item
Darkaroth Offline
Junior Member

Posts: 11
Threads: 2
Joined: Feb 2012
Reputation: 0
#1
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
Find
Ermu Offline
Member

Posts: 86
Threads: 13
Joined: Jan 2012
Reputation: 2
#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
Find
Darkaroth Offline
Junior Member

Posts: 11
Threads: 2
Joined: Feb 2012
Reputation: 0
#3
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
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
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
Find
Darkaroth Offline
Junior Member

Posts: 11
Threads: 2
Joined: Feb 2012
Reputation: 0
#5
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
Find




Users browsing this thread: 3 Guest(s)