$musicalias fails with long filenames

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.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: $musicalias fails with long filenames

Re: $musicalias fails with long filenames

by _mental_ » Mon Jan 06, 2020 3:23 am

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.

Re: $musicalias fails with long filenames

by _mental_ » Thu Jan 02, 2020 7:03 am

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.

Code: Select all

$musicalias D_RUNNIN music/This_is_a_hoedown_song_that_I_like_very_much.mid

Re: $musicalias fails with long filenames

by Enjay » Tue Dec 31, 2019 1:40 pm

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.

Re: $musicalias fails with long filenames

by Guest » Tue Dec 31, 2019 11:41 am

Doing so in the example file does not seem to change anything.

Re: $musicalias fails with long filenames

by Graf Zahl » Tue Dec 31, 2019 11:26 am

For long file names you have to include the extension.

$musicalias fails with long filenames

by Guest » Tue Dec 31, 2019 10:47 am

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.

Top