Frictional Games Forum (read-only)
[SCRIPT] Sounds and monster - 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] Sounds and monster (/thread-20744.html)

Pages: 1 2


Sounds and monster - Knusper. - 03-14-2013

Hey there,

I need help with some sounds and a monster.
Sounds:

On two parts of my map I need to play a sound.
First time:
void Break(string &in asParent, string &in asChild, int alState)
{
FadeInSound("break_wood_metal2.snt", 0, true);
GiveSanityDamage(5.0f, true);
SetEntityActive("enemy", true);
SetEntityActive("prison_section_3", false);
SetEntityActive("prison_section_5", true);
AddEnemyPatrolNode("enemy", "PathNodeArea_100", 0.001, "Idle");
AddEnemyPatrolNode("enemy", "PathNodeArea_101", 0.001, "Idle");
AddEnemyPatrolNode("enemy", "PathNodeArea_102", 0.001, "Idle");
AddEnemyPatrolNode("enemy", "PathNodeArea_103", 2, "Idle");
AddEnemyPatrolNode("enemy", "PathNodeArea_104", 0.001, "Idle");
AddEnemyPatrolNode("enemy", "PathNodeArea_105", 0.001, "Idle");
AddEnemyPatrolNode("enemy", "PathNodeArea_106", 0.001, "Idle");
}

I dont know if there I must write something else and not fade in...
Ingame no sound is coming.
And here is the problem with the enemy:
It becomes active, but it dont follows the path nodes.

Same prob. with the sound here:

void killall(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(5.0f, true);
FadeInSound("20_event_darkness.snt", 0, true);
}

I think fade in sound is wrong, but i dont know what to do.

Thx for reading


RE: Sounds and monster - tonitoni1998 - 03-14-2013

I would maybe try PlaySoundAtEntity or set fade in time to 0.001 . Because maybe the fadein needs a fade in time or something.


RE: Sounds and monster - Knusper. - 03-14-2013

thx for answer, but it dont works Sad


RE: Sounds and monster - NaxEla - 03-14-2013

break_wood_metal2.snt and 20_event_darkness.snt don't actually exist. Both those files have a .ogg extension. And also, as tonitoni1998 said, it's better to use PlaySoundAtEntity for playing sounds.

So for the sound, you would write:
PHP Code:
PlaySoundAtEntity("""break_wood_metal.snt""Player"0false); //"Player" is the entity it's played at 

For the event music, use PlayMusic:
PHP Code:
PlayMusic("20_event_darkness"false1010false); 



RE: Sounds and monster - Knusper. - 03-14-2013

thx very much.
the sound event_darkness works now.
still i dont hear the other one, and the monster isnt following too.

edit:
ah, i now solved the problem with the monster, it saw me through a wall...


RE: Sounds and monster - ingedoom - 03-15-2013

(03-14-2013, 10:24 PM)Knusper. Wrote: thx very much.
the sound event_darkness works now.
still i dont hear the other one, and the monster isnt following too.

edit:
ah, i now solved the problem with the monster, it saw me through a wall...

Hi. In the level edit or you can uncheck something at the monster entity so he won't react and start chasing you. So that you can inspect your map without worrying about being murdered....


RE: Sounds and monster - Knusper. - 03-15-2013

i said the monster problem is solved.
still the sound dont works


RE: Sounds and monster - Knusper. - 03-19-2013

strangely the monster doesn't work anymore and the sound isn't there, too.
I tried very much but it don't work.

Maybe you could try it, here is the map folder:
http://speedy.sh/UdJdV/tests.zip


I really can't find the mistake.

I need:
playing the sound at the area it should load and the monster should go like the path nodes show.


RE: Sounds and monster - ingedoom - 03-20-2013

which monster?? there are like 100...

enemy_suitor_5 right?

I have the answer dude.
PHP Code:
void follow(string &in asParentstring &in asChildint alState){    
SetEntityActive("enemy_suitor_5"true);    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_100"0.001"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_101"0.001"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_102"0.001"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_103"2"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_104"0.001"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_105"0.001"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_106"0.001"Idle");    
AddEnemyPatrolNode("servant_brute_5""PathNodeArea_110"0.001"Idle");} 


You wrote servant_brute_5. It's the enemy_suitor_5. Wink


RE: Sounds and monster - Knusper. - 03-20-2013

now it works, thx.
BUT the sound still doesnt work.