Suggestion: Replace audio

Discussion and feedback on Construct 2

Post » Thu May 22, 2014 4:29 pm

I recently found out that it is possible to replace audio being used in a Construct project without losing any event associations, but to do so currently you have to manually replace the .m4a and .ogg files in your computer's file explorer. If you try to import a file with the same name as an existing audio file, it just renames it, giving you two audio files, the newer of which wouldn't be associated with any existing audio events.
It's not a huge deal to replace them manually, but it would be nice if when importing an audio file with the same name as another already in the project, that Construct would ask if you would like to replace the originals instead of just renaming it.
B
6
S
1
Posts: 38
Reputation: 683

Post » Thu May 22, 2014 7:24 pm

Yes this is true, if you want to replace the sound you must upload it with another name and change the name on the audio event then delete the old file.
Deleting the old files before change the event with the new sound will delete all the event and you will lose your db numbers and tags.

Also another request is to allow to delete more than one file on the project bar, if i want to delete 10 sound files or sprites i must delete it one by one, and this is waste of time.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,165

Post » Thu May 22, 2014 7:30 pm

Would be convient to have this.

in the mean time. Play audio by name. This is a manual text string of the file(without the extension). That way if you replace in the project you won't lose the action. then you can rename the files as needed.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Thu May 22, 2014 7:47 pm

Ah, thanks @jayderyu. For some reason I hadn't thought of that. Probably cuz I'm still pretty new at this. :-)
Of course, that means if you ever need to rename the audio file, you'd need to change all the events, so each approach has its pros and cons I suppose.
B
6
S
1
Posts: 38
Reputation: 683

Post » Thu May 22, 2014 7:51 pm

true. you can go the extra step too.
create an object(or use globas) with variables to the name of the file. Then reference the variable. So if the file name changes. you can just change the file name in the variable.

Object.darkcastle = "ballad of darkness"
Object.travalling0 = "travel1"

Play(Object,travalling0)

I prefer using this form of mapping model for large games. For small quick games I tend to do just play the sound.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Thu May 22, 2014 9:29 pm

A good convention to follow. I'll have to keep that in mind. Thanks again for the tips. ;)
B
6
S
1
Posts: 38
Reputation: 683


Return to Construct 2 General

Who is online

Users browsing this forum: MadSpy and 5 guests