[SCRIPT] No sound playing in script 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 - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] No sound playing in script area (/thread-26621.html) |
No sound playing in script area - LDOriginal - 10-07-2014 Ok, so i've come to realise scripting isn't for the average idiot. I've been trying to figure out exactly what i'm doing wrong here but i just don't know what to do anymore. I know there's plenty of info on scripting but it's really not working. I think some examples would do me better. Would you please take a look at my script and see what's wrong? I would really appreciate it! void OnStart() { AddEntityCollideCallback("Player", "Ljud", "start", true, 1); AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true); AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true); AddUseItemCallback("", "Tillskåp", "Skåp", "UseKeyOnDoor", true); } void UseKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "Unlock_door.snt", asEntity, 10, false); RemoveItem(asItem); PlaySoundAtEntity("", "25_strain_wood.snt", "Player", 0.0f, false); } RE: No sound playing in script area - Neelke - 10-07-2014 You used a capital in the play sound. Change it to "unlock_door.snt" and you should be golden. RE: No sound playing in script area - LDOriginal - 10-07-2014 (10-07-2014, 07:43 PM)Neelke Wrote: You used a capital in the play sound. Change it to "unlock_door.snt" and you should be golden. Got fatal error by that: main (19,2) : ERR : No matching signatures to 'PlaysoundAtEntity(string@&, string@&, string@&, const float, const bool)' I don't have any problems with the doors and keys. It's just a certain area on the map wich i've placed a script area and it doesn't play the sound when i enter it. RE: No sound playing in script area - Neelke - 10-07-2014 Then you must have accidently deleted something. Mind showing me how it currently looks like? RE: No sound playing in script area - LDOriginal - 10-07-2014 (10-07-2014, 07:59 PM)Neelke Wrote: Then you must have accidently deleted something. Mind showing me how it currently looks like? Sure, how would we go about doing that? RE: No sound playing in script area - Neelke - 10-07-2014 There might just be a quote you accidently deleted while changing this. Just post the script after this change. RE: No sound playing in script area - LDOriginal - 10-07-2014 (10-07-2014, 08:10 PM)Neelke Wrote: There might just be a quote you accidently deleted while changing this. Just post the script after this change. void OnStart() { AddEntityCollideCallback("Player", "Ljud", "start", true, 1); AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true); AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true); AddUseItemCallback("", "Tillskåp", "Skåp", "UseKeyOnDoor", true); } void UseKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaysoundAtEntity("", "unlock_door.snt", asEntity, 10, false); RemoveItem(asItem); PlaysoundAtEntity("", "25_strain_wood.snt", "Player", 0.0f, false); } RE: No sound playing in script area - FlawlessHappiness - 10-07-2014 You still need a capital S in PlaySoundAtEntity. RE: No sound playing in script area - Radical Batz - 10-07-2014 The s in PlaySoundAtEntity should be with a capital as Flawless mentioned, fixed it for ya even tho it's easy to do XD PHP Code: void OnStart() RE: No sound playing in script area - LDOriginal - 10-07-2014 (10-07-2014, 08:35 PM)FlawlessHappiness Wrote: You still need a capital S in PlaySoundAtEntity. Figured that since it won't run without it. Is there anything besides that, that seem misplaced to you or out of the ordinary? |