http://edthebat.com/doom/musicaliastest.pk3
In the attached example, D_RUNNIN is meant to be replaced with another file. But its name is longer than 8 characters, so the music does not play.
There is a commented line to perform the same action with a different (identical) music file, but since its name is under the 8 character limit, it works correctly when uncommented.
$musicalias fails with long filenames
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49225
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: $musicalias fails with long filenames
For long file names you have to include the extension.
Re: $musicalias fails with long filenames
Doing so in the example file does not seem to change anything.
Re: $musicalias fails with long filenames
I tried the following:
$musicalias D_RUNNIN This_is_a_hoedown_song_that_I_like_very_much.mid
$musicalias D_RUNNIN "This_is_a_hoedown_song_that_I_like_very_much.mid"
$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid
$musicalias D_RUNNIN "music/This_is_a_hoedown_song_that_I_like_very_much.mid"
None of the above did what was required, but there was a difference between them and the example. In the example, the music for MAP01 didn't work at all and the title music just kept playing after map01 had started. With the above, the original D_RUNNIN played during map01.
$musicalias D_RUNNIN This_is_a_hoedown_song_that_I_like_very_much.mid
$musicalias D_RUNNIN "This_is_a_hoedown_song_that_I_like_very_much.mid"
$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid
$musicalias D_RUNNIN "music/This_is_a_hoedown_song_that_I_like_very_much.mid"
None of the above did what was required, but there was a difference between them and the example. In the example, the music for MAP01 didn't work at all and the title music just kept playing after map01 had started. With the above, the original D_RUNNIN played during map01.
Re: $musicalias fails with long filenames
There is a discrepancy between SNDINFO parsing and alias resolving. Notice CheckNumForName() vs. CheckNumForFullName() calls in these code snippets.
Usage of the first function will make the sample work as expected. The second function will require not only an extension added to a file name, but a full path.
Usage of the first function will make the sample work as expected. The second function will require not only an extension added to a file name, but a full path.
Code: Select all
$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid
Re: $musicalias fails with long filenames
After looking at this again, it appeared that CheckNumForName() cannot be used with long filenames.
In this case, only the first 8 characters of the filename do matter for file lookup.
So, either short names, which would be This_is_ in the given sample, or full names, i.e. with paths and extensions, must be used for music aliases.
Inconsistent alias resolution is fixed in cad14d1.
In this case, only the first 8 characters of the filename do matter for file lookup.
So, either short names, which would be This_is_ in the given sample, or full names, i.e. with paths and extensions, must be used for music aliases.
Inconsistent alias resolution is fixed in cad14d1.