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
Iyiyt Offline
Junior Member

Posts: 13
Threads: 5
Joined: Jul 2012
Reputation: 0
#5
RE: Make a sound play when you pick up a note

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()
{
SetEntityPlayerInteractCallback("Chris", "SpawnGruntUno", true);
SetEntityCallbackFunc("Chris", "Commie", true);
}

void SpawnGruntUno(string &in asEntity)
{
SetEntityActive("GruntUno", true);
}

void Commie(string &in asEntity, string &in type)
{
PlaySoundAtEntity("", "amb_hunt.snt", "Player", 0, false);
}

Thanks for the speedy response, by the way. "Commie" is the name of the sound file I want to play (in the Level Editor). As you can probably tell, I'm really new to this. When I try to run it, it crashes and the fatal error says
"ERROR! Could not load script file blah blah blah!
main (6,1) :ERR : No matching signatures to 'SetEntitiyCallbackFunc(string@&, string@&, const bool)'"

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;
///////////////////////////
//Run when entering map
void OnStart()
{
SetEntityPlayerInteractCallback("Chris", "SpawnGruntUno", true);
}

void SpawnGruntUno(string &in asEntity)
{
SetEntityActive("GruntUno", true);
}

void playnotesound(string &in entity)
{
PlayGuiSound("Commie", 1.0f);
}
(This post was last modified: 07-22-2012, 06:37 AM by Iyiyt.)
07-22-2012, 04:35 AM
Find


Messages In This Thread
RE: Make a sound play when you pick up a note - by Iyiyt - 07-22-2012, 04:35 AM



Users browsing this thread: 1 Guest(s)