Frictional Games Forum (read-only)
[SCRIPT] Some sounds aren't playing - 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] Some sounds aren't playing (/thread-18379.html)



Some sounds aren't playing - Ungotter - 09-16-2012

I'm back again >.> I'm now having a problem with my script which I can't seem to find a solution for by searching. I've placed various sounds throughout my map and I can't get 90% of them working. The only one that works is one I have attached to a door. Otherwise, I can't get them to work.

I've created a type of arrest scene towards the end. Which will be refined in greater detail when/if this problem is solved, but right now I'd rather pause on my progression until I can get these sounds to work

PHP Code:
void OnStart()
{
    
AddDebugMessage("OnStart!"false);
    
AddEntityCollideCallback("Player""BottleFallArea""BottleFall"true1);
    
AddEntityCollideCallback("Player""BodyAlley""BodyAlleyScare"true1);
    
SetEntityPlayerInteractCallback("castle_arched_no_grav01_1""ActivateMessage"false);
    
SetEntityPlayerInteractCallback("castle_arched_no_grav01_2""ActivateMessage1"false);
    
AddEntityCollideCallback("Player""ScriptDoorMessageArea_1""ActivateMessage2"true1);
    
AddEntityCollideCallback("Player""DirectionsArea""ActivateMessage3"true1);
    
AddEntityCollideCallback("Player""KnockoutTrigger""ActivateMessage4"true1);
}

void OnEnter()
{
    
AddDebugMessage("OnEnter!"false);
}

void OnLeave()
{
    
AddDebugMessage("OnLeave!"false);
}

void BottleFall(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("wine02_1"true); 
}

void BodyAlleyScare(string &in asParentstring &in asChildint alState)
{
    
StartPlayerLookAt("corpse_male_1"4.0f4.0f"");
    
PlaySoundAtEntity("Pant""react_breath2.ogg""Player"0.1ffalse);
    
GiveSanityDamage(5.0ftrue);
    
AddTimer("BodyAlleyTimer"2.0f"Timer_01");
}

void Timer_01(string &in asTimer)
{
    
StartPlayerLookAt("ScriptArea_Look"4.0f4.0f"");
    
PlaySoundAtEntity("PlatformDoor""29_exit_door.snt""castle_portcullis_3"0.1ffalse);
    
AddTimer("BodyAlleyTimer2"3.0f"Timer_02");
}

void Timer_02(string &in asTimer)
{
    
StopPlayerLookAt();
    
SetMessage("MessageOnScreen""BodyAlleyAdvice"6.0f);
}

void ActivateMessage(string &in asEntity)
{
    
SetMessage("MessageOnScreen""DoorMessage1"2.0f);
}

void ActivateMessage1(string &in asEntity)
{
    
SetMessage("MessageOnScreen""DoorMessage2"2.0f);
}

void ActivateMessage2(string &in asParentstring &in asChildint alState)
{
    
SetMessage("MessageOnScreen""DoorMessage3"4.0f);
}

void ActivateMessage3(string &in asParentstring &in asChildint alState)
{
    
SetMessage("MessageOnScreen""Directions"3.0f);
}

void ActivateMessage4(string &in asParentstring &in asChildint alState)
{
    
SetMessage("MessageOnScreen""Arrest"4.0f);
    
SetPlayerActive(false);
    
PlaySoundAtEntity("""react_breath3.ogg""Player"0.1ffalse);
    
AddTimer("ArrestTimer"4.0f"ArrestTimer_01");
}

void ArrestTimer_01(string &in asTimer)
{
    
SetMessage("MessageOnScreen""ArrestResponse"3.0f);
       
SetPlayerCrouching(true);
    
AddTimer("ArrestTimer2"2.0f"ArrestTimer_02");
}

void ArrestTimer_02(string &in asTimer)
{
    
PlaySoundAtEntity("""player_crouch2.ogg""Player"0.1ffalse);
    
AddTimer("ArrestTimer3"1.0f"ArrestTimer_03");
    
}
    
void ArrestTimer_03(string &in asTimer
{
    
PlaySoundAtEntity("""step_walk_rock_rev2.ogg""Player"0.1ffalse);
    
AddTimer("ArrestTimer4"1.0f"ArrestTimer_04");
}

void ArrestTimer_04(string &in asTimer)
{
    
PlaySoundAtEntity("""player_bodyfall5.ogg""Player"0.1ffalse);
    
FadeOut(2.0f);


The only sound that plays is PlaySoundAtEntity("PlatformDoor", "29_exit_door.snt", "castle_portcullis_3", 0.1f, false);

I read on the wiki you can set the entity to "Player" but it seems that isn't the case for me. Thanks again!


RE: Some sounds aren't playing - crisosphinx - 09-17-2012

Maybe it's just me (and I'm no good at programming), but I see tons of ("on enter/ on start", false)

Shouldn't the false be turned to true?

edit:

sorry I probably shouldn't have posted if it were the case, but I noticed that and thought maybe that was your problem?


RE: Some sounds aren't playing - i3670 - 09-17-2012

you got to have the .snt the .ogg won't work, that only works with PlayMusic.


RE: Some sounds aren't playing - Ungotter - 09-17-2012

(09-17-2012, 12:23 AM)crisosphinx Wrote: Maybe it's just me (and I'm no good at programming), but I see tons of ("on enter/ on start", false)

Shouldn't the false be turned to true?
Do you mean the debug messages? If so, they should be like that I believe. Additionally, if you mean the sounds I added false at the end because...that's what I read :p I've tried it both true and false, didn't change a thing Sad

(09-17-2012, 12:23 AM)i3670 Wrote: you got to have the .snt the .ogg won't work, that only works with PlayMusic.
Oh really? Christ why isn't that made more obvious (ah boi). Thank you so much!


RE: Some sounds aren't playing - i3670 - 09-17-2012

I think it's pretty obvious

asSoundFile - the sound to use + extension .snt

fresh from the wiki


RE: Some sounds aren't playing - Ungotter - 09-17-2012

(09-17-2012, 12:27 AM)i3670 Wrote: I think it's pretty obvious

asSoundFile - the sound to use + extension .snt

fresh from the wiki
I feel foolish, I didn't see that. Ah well, at least I know now, thanks for pointing it out Big Grin


RE: Some sounds aren't playing - i3670 - 09-17-2012

No problem, glad to help.