[ SOLVED] "unresolved import" for a sound (cause: name too long)

Started by Monsieur OUXX, Mon 23/10/2017 19:46:57

Previous topic - Next topic

Monsieur OUXX

Scenario :
- I import a sound into the game
- In my room_load (before fade-in), I call aMySound.Play(eAudioPriorityNormal, eRepeat);
- I am able to play that sound fine from the "sound" panel
- the game compiles properly. I then run it from within the Editor, with F5.
- when I enter the room, the game crashes with error "an internal error has occurred(...) Error: Unable to create local script (...) Unresolved import 'aMysound'"


Why?

Note: I've tried compiling it for real ("build EXE") beforehand, but it didn't help.
 

Monsieur OUXX

SOLVED: the sound's name was too long. A shorter name did the trick.
@Crimson Wizard, if you have time you might want to add some sort of safety check on that.
 

Laura Hunt

Apologies for resurrecting a 3-year old thread, but this just happened to me and I didn't think it was worth opening a whole new thread for the exact same issue. Shortening the sound name fixed the problem, but the error message didn't give me any clue as to what was happening.

Maybe auto-truncating file names on import or simply making the error message a bit more specific ("File name is too long") could be a good idea for a future patch?

morganw

Did you happen to try running the game directly instead of running from within the editor, to see if that made a difference? Running from the editor tries to use the audio files directly as a build shortcut, so potentially this triggers the issue.

Crimson Wizard

Quote from: morganw on Sun 30/08/2020 01:23:05
Did you happen to try running the game directly instead of running from within the editor, to see if that made a difference? Running from the editor tries to use the audio files directly as a build shortcut, so potentially this triggers the issue.

This error is because of clip's script name, not real file name. Regardless of how game is run it uses files from AudioCache so filenames are the same.

Laura Hunt

Quote from: Crimson Wizard on Sun 30/08/2020 01:36:21
Quote from: morganw on Sun 30/08/2020 01:23:05
Did you happen to try running the game directly instead of running from within the editor, to see if that made a difference? Running from the editor tries to use the audio files directly as a build shortcut, so potentially this triggers the issue.

This error is because of clip's script name, not real file name. Regardless of how game is run it uses files from AudioCache so filenames are the same.

Yes, exactly, maybe I should have been clearer regarding file name vs. clip script name.

Like it's already been mentioned, the fix on the user's side is trivial: just shorten the name of the clip and you're set. The problem is mainly that the error message is kind of generic and doesn't clue you in on what the problem is, so that's why I brought this up again. Maybe a simple check when importing a sound file and failing the import with a warning to the user ("File name is too long" like I suggested above or whatever) could make this a bit more user friendly, I don't know. Just a suggestion :)

SMF spam blocked by CleanTalk