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 Make a sound play when you pick up a note
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#6
RE: Make a sound play when you pick up a note

(07-22-2012, 04:35 AM)Iyiyt Wrote: Sorry, I probably screwed something up, because it isn't working. Here's what my script says (I just started this);

///////////////////////////
//Run when entering map
void OnStart()
{
SetEntityCallbackFunc("Chris", "Commie", true);
}

On a side note, I tried it the other way too. I got hopeful when it didn't crash, but it just played the sound at the beginning, and not when I interacted with the note. Again, probably my fault. Here's the coding I used;

///////////////////////////
//

void playnotesound(string &in entity)
{
PlayGuiSound("Commie", 1.0f);
}
.
I have marked everything red that I think you will have to change. SetEntityCallbackFunc does not have a
bool abRemoveOnInteraction, it just have string& asName and string& asCallback. So use this instead:

SetEntityCallbackFunc("Chris", "Commie");


The function "playnotesound" probably has the wrong callback syntax, as far as I remember, you should use:
(string &in entity, string &in type)
Try:

void playnotesound(string &in entity, string &in type)
{
PlayGuiSound("Commie", 1.0f);
}
(This post was last modified: 07-22-2012, 11:49 AM by Mackiiboy.)
07-22-2012, 11:47 AM
Website Find


Messages In This Thread
RE: Make a sound play when you pick up a note - by Mackiiboy - 07-22-2012, 11:47 AM



Users browsing this thread: 1 Guest(s)