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
Multiple Issues Help Custom Sound & Switch Script
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
Custom Sound & Switch Script

I'm working on a Full Conversion.

Custom Sounds:
Spoiler below!

I have created 5 custom sounds.
breath_loop1.ogg
breath_loop2.ogg
breath_loop3.ogg
breath_loop4.ogg
breath_loop5.ogg

After that i created 5 .snt files which a almost the same, except for the names.

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="breath_loop1" />
</Main>
</SOUNDS>
<PROPERTIES Volume="0.5" MinDistance="1" MaxDistance="10" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="True" Use3D="True" Blockable="True" BlockVolumeMul="0.7" Priority="0" />
</SOUNDENTITY>

This is the "react_breath.snt" file which i have editted in 2 ways.
- I made it loop.
- I changed the name.

Both the .snt files and the .ogg files are in my "sounds" folder of my full conversion.

My "resources.cfg" also has this line:
<Directory Path="/Nightmare/sounds" AddSubDirs="true" />

Every time I open my Full Conversion with the .bat file, and every time none of the 5 custom sounds are working.

Got any idea why?


Switch Script
Spoiler below!

I tried a Switch script that looks like this:

if(asTimer == "PlayerAh")
{
int AhVariable = RandInt(1, 2)
switch(AhVariable)
{
case 1:
PlaySoundAtEntity("Aaaah1", "player_react_guardian1.snt", "Player", 0, false);
AddTimer("PlayerAh", RandInt(10, 20), "Ambience");
break;

case 2:
PlaySoundAtEntity("Aaaah2", "player_react_guardian2.snt", "Player", 0, false);
AddTimer("PlayerAh", RandInt(10, 20), "Ambience");
break;
}
}

(It's in the middle of a timer, that's why there is no "void" in the start, and it starts with an if-statement)

When I start my Full Conversion it says that it expects a ; at the bold text. That's right where the switch-line is.

Any help on this?


Trying is the first step to success.
04-23-2013, 08:12 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Custom Sound & Switch Script

nvm, that's not the problem.

PHP Code: (Select All)
int AhVariable RandInt(12

Try putting a semicolon there.

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 04-23-2013, 08:35 PM by Tomato Cat.)
04-23-2013, 08:25 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: Custom Sound & Switch Script

I don't see how this:
int AhVariable = RandInt(1, 2)

is different from this:
int rand = RandInt(10,20);

except for the semicolon at the end.

Trying is the first step to success.
(This post was last modified: 04-23-2013, 08:33 PM by FlawlessHappiness.)
04-23-2013, 08:33 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#4
RE: Custom Sound & Switch Script

(04-23-2013, 08:33 PM)BeeKayK Wrote: I don't see how this:
int AhVariable = RandInt(1, 2)

is different from this:
int rand = RandInt(10,20);

except for the semicolon at the end.

Variable declarations don't need a semicolon?

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
04-23-2013, 08:38 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Custom Sound & Switch Script

(04-23-2013, 08:25 PM)Mr Credits Wrote: nvm, that's not the problem.

PHP Code: (Select All)
int AhVariable RandInt(12

Try putting a semicolon there.

I tried putting a semicolon there. The map loads, but the sound does not play... Maybe I should just stick with a timer.

Trying is the first step to success.
04-23-2013, 08:42 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Custom Sound & Switch Script

Bump, because the sound problem is still a problem

Trying is the first step to success.
04-24-2013, 04:46 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#7
RE: Custom Sound & Switch Script

2 threads for this problem is a bad idea....

Are you sure the sounds work outside of this switch...case statement?
Try playing them when the map loads, so that you know the problem is with the code not the sounds themselves

04-24-2013, 05:07 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#8
RE: Custom Sound & Switch Script

I only created one thread. I found out i didn't just have a switch problem but also a sound problem
The sound problem is not in the switch problem.

you see the sound problem in my first post

Trying is the first step to success.
04-24-2013, 05:24 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#9
RE: Custom Sound & Switch Script

Oh sorry, it's just that you also posted about a problem with the script you were having in the thread over in the dev articles subforum.

Try playing the sound files with the PlayMusic function, as that doesn't require the .snt, that might help narrow down the cause of the issue

04-24-2013, 06:11 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: Custom Sound & Switch Script

Ok so that works... It's the .snt file then..
EDIT: Ok i made it work.. I don't know what i did but i just tweaked some of the properties.

NOw it's like this:

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="breath_loop1" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="1" MaxDistance="10" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="True" Use3D="False" Blockable="False" BlockVolumeMul="0.7" Priority="0" />
</SOUNDENTITY>

Trying is the first step to success.
(This post was last modified: 04-24-2013, 06:58 PM by FlawlessHappiness.)
04-24-2013, 06:50 PM
Find




Users browsing this thread: 1 Guest(s)