Frictional Games Forum (read-only)
Play Sound on area - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Play Sound on area (/thread-5694.html)



Play Sound on area - gericecold - 12-12-2010

Hello, i have made a script, for playing a sound at a piano, when i walk into an area.
But when i try it the game crashes..

what have i done wrong?
heres the script :

// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "bitch", true, 1);
}


void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);
{
PlaySoundAtEntity("knuppel", "general_piano03.snt", "piano_1", 2.0f, false);
StopSound("knubbel", 5.0f);
}

i hope for help Huh


RE: Play Sound on area - Gamemakingdude - 12-12-2010

Error information please!


RE: Play Sound on area - jens - 12-12-2010

void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

should be

void bitch(string &in asParent, string &in asChild, int alState)

then it might work


RE: Play Sound on area - gericecold - 12-12-2010

(12-12-2010, 12:28 PM)jens Wrote: void bitch(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

should be

void bitch(string &in asParent, string &in asChild, int alState)

then it might work

cool, thank you for fast answer. it works great Smile
but why was my void wrong?


RE: Play Sound on area - Frontcannon - 12-12-2010

You used the wrong syntax for CollideCallbacks.