[EO]Load img from ini

I’m giving in and going to learn how EO works. My first edit is having a background image displayed. So here are the edits I’ve done so far all client sided

in modTypes in private Type OptionsRec

Background as String 'Displays background image

Then in mod Database I added a few lines.

In the Public sub SaveOptions i put

Call PutVar(FileName, "Options", "Background", Trim$(Options.Background))

In LoadOptions I put

Options.Background = vbNullString

in the else part of the if statement

Options.Background = GetVar(FileName, "Options", "Background")

In frmMenu I added a imagebox and then in the form load I put the following

pic_BG = LoadPicture(Options.Background)

Lastly in the config.ini at the very bottom i put

Background= 1.bmp

My problem is when i try to compile it, I get an error saying that “1.bmp” cannot be found. But if i change this

Options.Background = vbNullString

to

Options.Background = App.Path & "\Data Files\graphics\Menu\1.bmp

It works no problem. So I was wondering how the MenuMusic.mid is being found since in the config.ini its just the files name.

pic_BG.Picture = LoadPicture(Options.Background)

I changed it. Still getting Runtime error’53’ File not found: ‘1.bmp’

1.bmp is located in \data files\graphics\Menu

@crzyone9584:

I changed it. Still getting Runtime error’53’ File not found: ‘1.bmp’

1.bmp is located in \data files\graphics\Menu

pic_BG.Picture = LoadPicture(App.Path & "\data files\graphics\Menu\" & Options.Background)

Try that out.

Thanks Lightning. It worked like a charm. Is there a place in the source where its the same for the MenuMusic? Or is that just really special and able to just have the name in the config.ini?

Yes I’ve searched for all the MenuMusic in the solutions and didn’t find anything like that.

@crzyone9584:

Thanks Lightning. It worked like a charm. Is there a place in the source where its the same for the MenuMusic? Or is that just really special and able to just have the name in the config.ini?

Yes I’ve searched for all the MenuMusic in the solutions and didn’t find anything like that.

No problem. If you are looking for the main menu screen music, go to “client\data files\music” and place your specific sound in there. Then go back to the data files folder and open up “Config.ini”. Change “MenuMusic=” to “MenuMusic=filename here

@Lightning:

No problem. If you are looking for the main menu screen music, go to “client\data files\music” and place your specific sound in there. Then go back to the data files folder and open up “Config.ini”. Change “MenuMusic=” to “MenuMusic=filename here

No I mean how is the music loaded. I’ve searched through using the search control thing when you hit crtl-f and could only find it check Options.MenuMusic. How does it know where the file is located? Is there something I’m missing on how its being told where to find it in the source? I didn’t find anything like what you posted that got the image to load for the music.

@crzyone9584:

@Lightning:

No problem. If you are looking for the main menu screen music, go to “client\data files\music” and place your specific sound in there. Then go back to the data files folder and open up “Config.ini”. Change “MenuMusic=” to “MenuMusic=filename here

No I mean how is the music loaded. I’ve searched through using the search control thing when you hit crtl-f and could only find it check Options.MenuMusic. How does it know where the file is located? Is there something I’m missing on how its being told where to find it in the source? I didn’t find anything like what you posted that got the image to load for the music.

To be honest I havent messed around with the music in EO, keep looking, I’ll take a look later too.

Log in to reply