Urgent question about sound, files, and exe's

For questions about using Classic.

Post » Sat Aug 21, 2010 7:13 pm

I'm about to send a project over to an interested party today, and I need to know:

When I put a sound file link into Construct and I can see that it's playing when I run the layout, is that all I have to do to make sure the music and/or sound is in the game? Or do I have to insert the actual files into the sounds or music folder so that the sounds or music will be play on the recipients computer?
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Sat Aug 21, 2010 7:50 pm

It's gotta be in a subfolder of your project and go with it to the recipient.
B
2
S
1
G
2
Posts: 35
Reputation: 870

Post » Sat Aug 21, 2010 8:02 pm

You can either:

1. Embed the music/sound in the exe as a resource

2. Put the music/sound in subfolder, reference it in your .cap with "app path" and send with the game.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sat Aug 21, 2010 8:06 pm

When you export to a exe all the files in the "files" folder are embedded into the exe. The files are then accessible from the play from resource actions of xaudio2 or by using the resource plugin.
B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Sat Aug 21, 2010 9:05 pm

Handy... didn't even know that was possible. All the projects I've downloaded had all the external files in the folder structure.
B
2
S
1
G
2
Posts: 35
Reputation: 870

Post » Sat Aug 21, 2010 11:12 pm

Thanks guys, but I have a big problem now...

I've tried one method of naming the file path for each music and sound file in Construct to a music and sound folder called "MyNewGameSounds" inside the .zip I've created. For example, I'd change "C:\Users\Miller\Desktop\MyNewGameSounds\LetsRock.wav" to "MyNewGameSounds\LetsRock.wav".

Here's the thing, when I fire the game up it works fine and the sounds play in the first layout, and plays through the second, but when it goes to the third layout I get this error message:

"You can't have a layout object set to view its own layout!"

This has only happened while running the .exe after having changed the music file paths. I made an .exe yesterday without changing the paths and it worked fine with no crash. It also runs fine as a .cap as I have used "Run layout" from the cap many times and it never crashes. I haven't made any major changes to the program today.

I do have a layout object within the third layout, but that shouldn't be causing a problem, and to reiterate it's never crashed at any time prior to me changing the music file paths. I didn't save it after the changes, so I've run the file again with the original music file paths intact and it runs fine... I can't figure out what the heck is happening...? And what a horrible time for it to be happening!!! Noooo!!! LOL!
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Sat Aug 21, 2010 11:19 pm

Try "apppath & "MyNewGameSounds\LetsRock.wav""
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun Aug 22, 2010 1:10 am

[quote="Arima":33j3qb2w]Try "apppath & "MyNewGameSounds\LetsRock.wav""[/quote:33j3qb2w]

No luck. I still get: "You can't have a layout object set to view its own layout!"

:(
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Sun Aug 22, 2010 1:35 am

That's why I tell people to steer clear of the layout object. Too buggy. :(

Perhaps try going back to the version that was working, and try step by step? Or embed the sounds in the exe instead?

Also check each layout object for what layout it's set to. Try changing it something else, run it, then back again.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Sun Aug 22, 2010 1:38 am

Okay, so here is what I've determined regarding the "You can't have a layout object set to view its own layout!" problem:

*I went ahead and erased all 4 of the layout objects from the layouts. I then packaged the .exe and the game now runs perfectly.

I can't explain why the .exe I ran yesterday played fine. The only difference between the file I ran yesterday and the one today, is that yesterdays was just a raw .exe while today's was an .exe within a zip file. I don't see how it could make a dramatic difference to how it operates, but that's the only contrast that there's been when comparing both days.

As a sidenote, I should mention that apppath & "MyNewGameSounds\LetsRock.wav" only produced silence in my project.
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 5 guests