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
Scare Sound?
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#11
RE: Scare Sound?

(07-18-2012, 11:51 PM)zergling50 Wrote:
(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.

void ScareNoise1(string &in asEntity)
{
PlaySoundAtEntity("", "scare_baby_cry", "Player", 0, false);
PlaySoundAtEntity("", "scare_steps_big", "Player", 0, false);
PlaySoundAtEntity("", "scare_tingeling_rev2", "Player", 0, false);
}
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.
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:
////////////////////////////
// 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);
}
07-19-2012, 12:25 AM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#12
RE: Scare Sound?

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)

I rate it 3 memes.
07-19-2012, 12:31 AM
Find Reply
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#13
RE: Scare Sound?

.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!]

[Image: signature-2.png]
(This post was last modified: 07-19-2012, 12:32 AM by Streetboat.)
07-19-2012, 12:32 AM
Find Reply
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#14
RE: Scare Sound?

(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:

SetLightVisible(string& asLightName, bool abVisible);


asLightName = Name of the light in the editor
abVisible = is it visible? (true/false)
what about the note?
07-19-2012, 12:40 AM
Find Reply
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#15
RE: Scare Sound?

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.

I rate it 3 memes.
07-19-2012, 12:45 AM
Find Reply
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#16
RE: Scare Sound?

(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).

Add an interact callback for the first note, and have that set the second note active.
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?
07-19-2012, 01:05 AM
Find Reply
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#17
RE: Scare Sound?

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!
07-19-2012, 04:47 PM
Find Reply
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#18
RE: Scare Sound?

I havent heard from anyone in a while. Wasnt sure if I needed to restate my question to clear up any confusion?
07-20-2012, 08:07 PM
Find Reply
Kazakarumariou Away
An angry man.

Posts: 283
Threads: 8
Joined: Jul 2012
Reputation: 14
#19
RE: Scare Sound?

The note is a glitch. It sometimes falls through the ground. Click the note > Click Entity tab > Check off Static physics.
07-20-2012, 08:38 PM
Find Reply
zergling50 Offline
Member

Posts: 74
Threads: 9
Joined: Jul 2012
Reputation: 1
#20
RE: Scare Sound?

(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!
07-20-2012, 10:04 PM
Find Reply




Users browsing this thread: 1 Guest(s)