Loading rooms and sounds

I'm working on a project for someone else. 99% of the code was written by someone else so bear this in mind because this is a very strange issue. I have never experienced this before.

1) I can't access any rooms or sounds that weren't already in the project when I received it. So I create a new sound called test. I play the sound as, the very first line of code in the very first room. I get can't find a sound error. However, if I replace an already existing sound with a different sound file it will work.

2) I have 26 rooms (Don't ask I didn't design this). If I do room_get_name(0) or room_get_name(25) great. If I create another room a 27th room and do room_get_name(26) it tells me to swivel.

This leads me to believe there is something seriously odd going on here. I thought there might be something weird in the code causing this but I ran this code before anything else.


Any help appreciated.

Edit: I removed all objects and all rooms apart from one room. Still having this issue. Create a new project no problem. FYI I had to convert from an older version of GMS when I first loaded the project.
 
Last edited:

chamaeleon

Member
2) I have 26 rooms (Don't ask I didn't design this). If I do room_get_name(0) or room_get_name(25) great. If I create another room a 27th room and do room_get_name(26) it tells me to swivel.
Don't use numbers when writing code, use the room names instead. If you need to use numbers at some point, create an array, ds_list or ds_map that allows you to use a numerical index to map to the room identifier. Relying on numbers being generated in any particular way will result in undefined behavior and all bets are off. No ideas about the audio.
 
Top