Scare Sound? - 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: Scare Sound? (/thread-17078.html) |
RE: Scare Sound? - zergling50 - 07-19-2012 (07-18-2012, 11:51 PM)zergling50 Wrote:Everything works now guys thanks! just one little problem and then I should be good. My scare was supposed to have noises play as a closet bursts open revealing another note emanating a red light after you read a note by a bedside. Everything works except I want the light to turn off once the note its in is read, and I want the note to not be there until you read the other note. When I play the game, despite unchecking the active box for the light, the light remains on when you enter the room and never goes off. Second, the note isnt there, but when you read the trigge note, the note appears but its invisible. If you look in the right spot an outline appears of a note and you can pick it up, but you cant see it? how can I fix these. I unchecked both their active boxes. Heres my code:(07-18-2012, 10:22 PM)andyrockin123 Wrote: You can use a .ogg file. but it has to have an accompanying .snt file. I'd suggest (for troubleshooting purposes) to only use the name of the .snt file and not the individual .ogg names.It works now, but whats the point in having an ogg file if you cant use it? I prefer some of the ogg files but ill hav to settle with the snt. //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } void ActivateMonster(string &in asItem) { } void KeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "unlock_door", asEntity, 0.0f, false); RemoveItem(asItem); } void ScareNoise1(string &in asEntity) { PlaySoundAtEntity("", "scare_steps_big", "Player", 0, false); PlaySoundAtEntity("", "insanity_baby_cry", "Player", 0, false); PlaySoundAtEntity("", "insanity_imageflash01", "Player", 0, false); PlaySoundAtEntity("", "insanity_whisper", "Player", 0, false); PlaySoundAtEntity("", "scare_male_terrified", "Player", 0, false); PlaySoundAtEntity("", "scare_door_slam", "Player", 0, false); AddPropImpulse("cabinet_nice_3", 0, 0, 45, "world"); SetEntityActive("note_paper01_4", true); SetEntityActive("SpotLight_3", true); } void DisableLight(string &in asEntity) { SetEntityActive("SpotLight_3", false); } RE: Scare Sound? - Adny - 07-19-2012 Lights cannot be deactivated via the level editor, but only through scripting. Here is the function you will need: SetLightVisible(string& asLightName, bool abVisible); asLightName = Name of the light in the editor abVisible = is it visible? (true/false) RE: Scare Sound? - Streetboat - 07-19-2012 .snt is the file used by HPL2 engine to determine what sounds to use in-game. You have to make a .snt file with the same name as the sound you want played, and open it in notepad++. Then you can point it to the right .ogg file, mess with the volume, radius, etc. [EDIT: Oops, totally didn't see andyrockin's post on the last page. My bad!] RE: Scare Sound? - zergling50 - 07-19-2012 (07-19-2012, 12:31 AM)andyrockin123 Wrote: Lights cannot be deactivated via the level editor, but only through scripting. Here is the function you will need:what about the note? RE: Scare Sound? - Adny - 07-19-2012 The note issue can be easily resolved by using the function SetEntityActive. In the level editor, make sure the second note that appears after the first is read is inactive in the level editor (make sure the "Active" box is not checked). Add an interact callback for the first note, and have that set the second note active. RE: Scare Sound? - zergling50 - 07-19-2012 (07-19-2012, 12:45 AM)andyrockin123 Wrote: The note issue can be easily resolved by using the function SetEntityActive. In the level editor, make sure the second note that appears after the first is read is inactive in the level editor (make sure the "Active" box is not checked).Thats exactly what I do, but as I said its invisible for some reason. You can only see its outline if you look in the exact spot but you cant see the note. If you look at mycode it has a callback and a setentity active for that note as well as the active box being unchecked in the editor. any ideas? RE: Scare Sound? - zergling50 - 07-19-2012 My note is still doing the invisible thing, and for some reason I cant get the whole sound playing when a player enters an area thing to work. Heres my code: //////////////////////////// // Run when starting map void OnStart() { AddUseItemCallback("", "key_study_1", "mansion_3", "KeyOnDoor2", true); AddUseItemCallback("", "key_tower_1", "mansion_5", "KeyOnDoor2", true); AddUseItemCallback("", "key_torture_chamber_1", "level_hub_1", "KeyOnDoorlvl1", true); SetEntityPlayerInteractCallback("note_paper01_3", "ScareNoise1", true); SetEntityPlayerInteractCallback("note_paper01_4", "DisableLight", true); SetEntityPlayerInteractCallback("key_tower_1", "ScareNoise2", true); SetLightVisible("SpotLight_3", false); AddEntityCollideCallback("Player", "ScriptArea_2", "ScareNoise3", true, 1); } //////////////////////////// // Run when entering map void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } void ActivateMonster(string &in asItem) { } void KeyOnDoor2(string &in asItem, string &in asEntity) { SetSwingDoorLocked(asEntity, false, true); PlaySoundAtEntity("", "unlock_door", asEntity, 0.0f, false); RemoveItem(asItem); } void KeyOnDoorlvl1(string &in asItem, string &in asEntity) { SetLevelDoorLocked(asEntity, false); PlaySoundAtEntity("", "unlock_door", asEntity, 0.0f, false); RemoveItem(asItem); GiveSanityBoostSmall(); } void ScareNoise1(string &in asEntity) { PlaySoundAtEntity("", "scare_steps_big_custom", "Player", 0, false); PlaySoundAtEntity("", "insanity_baby_cry_custom", "Player", 0, false); PlaySoundAtEntity("", "insanity_imageflash01_custom", "Player", 0, false); PlaySoundAtEntity("", "insanity_whisper_custom", "Player", 0, false); PlaySoundAtEntity("", "scare_male_terrified_custom", "Player", 0, false); PlaySoundAtEntity("", "scare_slam_door_custom_soft", "Player", 0, false); AddPropImpulse("cabinet_nice_3", 0, 0, 45, "world"); SetLightVisible("SpotLight_3", true); SetEntityActive("note_paper01_4", true); GiveSanityDamage(35, true); } void DisableLight(string &in asEntity) { SetLightVisible("SpotLight_3", false); } void ScareNoise2(string &in asEntity) { PlaySoundAtEntity("", "scare_wall_crawl_custom", "ScriptArea_1", 0, false); SetEntityActive("human_bone_1", true); SetEntityActive("human_bone_2", true); SetEntityActive("human_bone_3", true); SetLampLit("candlestick_floor_9", false, true); SetLampLit("candlestick_floor_8", false, true); SetLampLit("candlestick_floor_7", false, true); SetLampLit("candlestick_floor_6", false, true); SetLampLit("candlestick_floor_5", false, true); SetLampLit("candlestick_floor_4", false, true); SetLampLit("candlestick_floor_3", false, true); GiveSanityDamage(15, true); } void ScareNoise3(string &in parent, string &in child, string &in alstate) { PlaySoundAtEntity("", "scare_slam_door_custom", "Player", 0, false); } These two questions are the last two questions I will ask on this thread, and if I have any more I will post a new thread and stop bugging you guys. Sorry, just for some reason I am problem prone with this thing. And just in case you guys were wondering, these custom sound files are in a sounds folder in my custom story folder. The rest of the custom sounds work, so im pretty sure its a problem with the collision detector or something. Thanks! RE: Scare Sound? - zergling50 - 07-20-2012 I havent heard from anyone in a while. Wasnt sure if I needed to restate my question to clear up any confusion? RE: Scare Sound? - Kazakarumariou - 07-20-2012 The note is a glitch. It sometimes falls through the ground. Click the note > Click Entity tab > Check off Static physics. RE: Scare Sound? - zergling50 - 07-20-2012 (07-20-2012, 08:38 PM)Harthex Wrote: The note is a glitch. It sometimes falls through the ground. Click the note > Click Entity tab > Check off Static physics.K, and finally what about the player entering an area and sound playing thing? After that I should be good. Thanks for all your help guys, ill make sure to include all your names from all my threads in the credits! |