Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Esquizo on Wed 12/05/2021 21:28:07

Title: Problem with using music
Post by: Esquizo on Wed 12/05/2021 21:28:07
Hi guys:

I'm trying to use music in my first game and did so adding the audio file through the graphic interface of the game and then calling when needed the aMusic.Play() subroutine when needed. However, once I start the executable I get the following error message.

QuoteError: Unable to create local script: Runtime error: Unresolved import 'aMusic'

I think it might have to do with the headers and that the object is not being imported correctly to the room module, but I really don't know what to do.

Thanks in advance. This program is truly amazing, I am still in awe about how easy to use is.
Title: Re: Problem with using music
Post by: Crimson Wizard on Wed 12/05/2021 21:34:01
Quote from: Esquizo on Wed 12/05/2021 21:28:07
I think it might have to do with the headers and that the object is not being imported correctly to the room module, but I really don't know what to do.

Normally you should not import audio clip names, because everything you add to the project (characters, music, etc) is declared and registered automatically.

Is your clip actually called "aMusic", or you tried to declare it by hand in scripts?

Title: Re: Problem with using music
Post by: Esquizo on Wed 12/05/2021 21:40:18
Thanks, you made me realize it was a problem with the file name, it had spaces in it. Sorry for bothering you.

This is SOLVED