Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
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
void OnStart() { AddDebugMessage("OnStart!", false); AddEntityCollideCallback("Player", "BottleFallArea", "BottleFall", true, 1); AddEntityCollideCallback("Player", "BodyAlley", "BodyAlleyScare", true, 1); SetEntityPlayerInteractCallback("castle_arched_no_grav01_1", "ActivateMessage", false); SetEntityPlayerInteractCallback("castle_arched_no_grav01_2", "ActivateMessage1", false); AddEntityCollideCallback("Player", "ScriptDoorMessageArea_1", "ActivateMessage2", true, 1); AddEntityCollideCallback("Player", "DirectionsArea", "ActivateMessage3", true, 1); AddEntityCollideCallback("Player", "KnockoutTrigger", "ActivateMessage4", true, 1); }
void OnEnter() { AddDebugMessage("OnEnter!", false); }
void OnLeave() { AddDebugMessage("OnLeave!", false); }
void BottleFall(string &in asParent, string &in asChild, int alState) { SetEntityActive("wine02_1", true); }
void BodyAlleyScare(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("corpse_male_1", 4.0f, 4.0f, ""); PlaySoundAtEntity("Pant", "react_breath2.ogg", "Player", 0.1f, false); GiveSanityDamage(5.0f, true); AddTimer("BodyAlleyTimer", 2.0f, "Timer_01"); }
void Timer_01(string &in asTimer) { StartPlayerLookAt("ScriptArea_Look", 4.0f, 4.0f, ""); PlaySoundAtEntity("PlatformDoor", "29_exit_door.snt", "castle_portcullis_3", 0.1f, false); 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 asParent, string &in asChild, int alState) { SetMessage("MessageOnScreen", "DoorMessage3", 4.0f); }
void ActivateMessage3(string &in asParent, string &in asChild, int alState) { SetMessage("MessageOnScreen", "Directions", 3.0f); }
void ActivateMessage4(string &in asParent, string &in asChild, int alState) { SetMessage("MessageOnScreen", "Arrest", 4.0f); SetPlayerActive(false); PlaySoundAtEntity("", "react_breath3.ogg", "Player", 0.1f, false); 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.1f, false); AddTimer("ArrestTimer3", 1.0f, "ArrestTimer_03"); } void ArrestTimer_03(string &in asTimer) { PlaySoundAtEntity("", "step_walk_rock_rev2.ogg", "Player", 0.1f, false); AddTimer("ArrestTimer4", 1.0f, "ArrestTimer_04"); }
void ArrestTimer_04(string &in asTimer) { PlaySoundAtEntity("", "player_bodyfall5.ogg", "Player", 0.1f, false); 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 |
|
crisosphinx
Senior Member
Posts: 501
Threads: 5
Joined: Apr 2012
Reputation:
24
|
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 |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: Some sounds aren't playing
you got to have the .snt the .ogg won't work, that only works with PlayMusic.
|
|
09-17-2012, 12:23 AM |
|
Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
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
(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 |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: Some sounds aren't playing
I think it's pretty obvious
asSoundFile - the sound to use + extension .snt
fresh from the wiki
|
|
09-17-2012, 12:27 AM |
|
Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
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
|
|
09-17-2012, 12:30 AM |
|
i3670
Posting Freak
Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation:
36
|
RE: Some sounds aren't playing
No problem, glad to help.
|
|
09-17-2012, 12:43 AM |
|
|