Sounds/Music Folder

For questions about using Classic.

Post » Thu Jan 13, 2011 1:29 pm

How would I go about externally loading sounds that are in a folder separate from the .cap or .exe? As in...

Game>game.exe
Game>SFX>(numerous folders full of sounds)>sounds

I tried

+Start of layout
-(Xaudio2) cache directory AppPath

+Something happens
-(Xaudio2) Autoplay file AppPath&"Sound.wav"

Well that only plays the sound if it's in the folder the .cap or .exe is in. So I appended &"SFX" (Folder name is SFX) to the action in the first event, but that didn't work. I tried a few other combinations of AppPath and folders, but nothing worked.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Thu Jan 13, 2011 1:42 pm

i remember a Resources Plugin i think did that too.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Thu Jan 13, 2011 2:09 pm

That's easy. Type [code:19nhexrj]AppPath & "SFX\sound.wav"[/code:19nhexrj] in the parameter and you're done. No need to download any plugin :lol:
B
2
G
3
Posts: 12
Reputation: 874

Post » Thu Jan 13, 2011 2:18 pm

Oh, cool. Thanks man!
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Thu Jan 13, 2011 7:04 pm

Even though I've used sounds and music before, the AppPath thing still confuses me from time to time.

IE, i forget what it means.


Does AppPath mean something like:

Game\Music & "Cool Jams.wav"?
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Thu Jan 13, 2011 7:20 pm

[quote="Emperor Ing":ytag4ngl]Even though I've used sounds and music before, the AppPath thing still confuses me from time to time.

IE, i forget what it means.


Does AppPath mean something like:

Game\Music & "Cool Jams.wav"?[/quote:ytag4ngl]
AppPath is a text variable that stores the path to your game folder (the folder where your .exe or .cap is stored)
If you would have your game stored in a folder "mycoolgame" on C: then AppPath would have this content:
"C:\mycoolgame\"

EDIT: A look at "Verve!" might also help with this
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Fri Jan 14, 2011 6:47 pm

Should I always use AppPath? Because when I use relative path like "folder\file.txt" it still works with or without it.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Fri Jan 14, 2011 11:57 pm

Think about when your game is on someone elses computer, in a different folder, on a different drive.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Sat Jan 15, 2011 12:49 am

You should use it like:
[code:e7as03pc]AppPath + "folder\file.txt[/code:e7as03pc]
So this will get the folder where the game is, then go inside the "folder" folder, and find the file "file.txt". You can have as many folders as you want, and any kind of file you need

Btw you can set the file to a variable, eg:
[code:e7as03pc]AppPath + "save\" + global('player_name') + ".sav"[/code:e7as03pc]
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Sat Jan 15, 2011 1:13 am

I ran into bugs with this one on a project I finished during the summer time. Everything was fine with the .cap, but with the .exe things changed; some sounds and music played in the .exe but some didn't, even though the paths were right.

I hope for 1.0 this will be like MMF and embed in the file.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest