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
Script Help Some sounds aren't playing
Ungotter Offline
Junior Member

Posts: 11
Threads: 3
Joined: Sep 2012
Reputation: 0
#1
Some sounds aren't playing

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: (Select All)
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!
09-16-2012, 11:58 PM
Find
crisosphinx Offline
Senior Member

Posts: 501
Threads: 5
Joined: Apr 2012
Reputation: 24
#2
RE: Some sounds aren't playing

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?

Animation and Rig questions -> crisosphinx@yahoo.com

3D Generalist. Notable work on FG Forums - The Great Work, Five Magics and Cowards Debt.
(This post was last modified: 09-17-2012, 12:24 AM by crisosphinx.)
09-17-2012, 12:23 AM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#3
RE: Some sounds aren't playing

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

"What you think is irrelevant" - A character of our time

A Christmas Hunt
09-17-2012, 12:23 AM
Find
Ungotter Offline
Junior Member

Posts: 11
Threads: 3
Joined: Sep 2012
Reputation: 0
#4
RE: Some sounds aren't playing

(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!
(This post was last modified: 09-17-2012, 12:33 AM by Ungotter.)
09-17-2012, 12:25 AM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#5
RE: Some sounds aren't playing

I think it's pretty obvious

asSoundFile - the sound to use + extension .snt

fresh from the wiki

"What you think is irrelevant" - A character of our time

A Christmas Hunt
09-17-2012, 12:27 AM
Find
Ungotter Offline
Junior Member

Posts: 11
Threads: 3
Joined: Sep 2012
Reputation: 0
#6
RE: Some sounds aren't playing

(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
09-17-2012, 12:30 AM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#7
RE: Some sounds aren't playing

No problem, glad to help.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
09-17-2012, 12:43 AM
Find




Users browsing this thread: 3 Guest(s)