MilesThatch
Member
Got a lighting system that saves the all the lights of the level into an .ini file. I grab that file, included it and use a function in an master lighting object "instance creation code" to read all the light properties and re-generate all the lights.
So here's the deal, the ini files that the game outputs with all the lights data is saved into the %appdata% folder using the room name as the file name. So I get "Level001lights.ini" I take the file, include it, add it with the function in the creation code of the light master object and the light are re-created. Now I figure I need a few more lights and some changes made. If I added a couple of lights, I'd just save the new ini file, open it, copy the contents, then, in game makers included files, right click > edit the existing ini file, delete everything and then paste the copied text there. Game Maker will then prompt that the file has been changed and asks whether you want to re-load it so that changes are taken in or to save it so that changes are overwritten with what was in the file before I pasted the content.
Now the problem tho is that those changes aren't showing up in the game, those new lights are not showing up. Instead I am forced to create a custon blank ini file, call it something different like "Level001lights-new01.inf" and put that file name in the creation code to load the files. The changes now showed up but I thought this was strange, game maker refusing to take in the changes of the ini file even though it prompted that changed were made... Now mind you, I did try the "clear target platform" button.
So ok, I did the above mentioned and the new lights with the changes showed up, so I try something. I check both ini files "Level001Lights.ini" and "Level001Lights-new01.ini" and they are both identical. I go into the %AppData% folder of the game where it saved the ini files originally, delete them.... and now all the loghts are gone. WHAT IS GOING ON HERE I think. Does game maker read files from the project directory or the game folder in %appdata% ? Maybe I'm missing something, maybe I'm supposed to save the included ini files into the %appdata% folder before accessing them. This is very confusing. All I can do now, to get the new lights working is to include a blank ini file, call it something new, this time "Level001Lights-new02.ini" and copy the data there. So every time I make a change I'd have to rinse and repeat going into "-new03" "-new04" etc. instead of just opening the original ini file and pasting the new config text there.
So here's the deal, the ini files that the game outputs with all the lights data is saved into the %appdata% folder using the room name as the file name. So I get "Level001lights.ini" I take the file, include it, add it with the function in the creation code of the light master object and the light are re-created. Now I figure I need a few more lights and some changes made. If I added a couple of lights, I'd just save the new ini file, open it, copy the contents, then, in game makers included files, right click > edit the existing ini file, delete everything and then paste the copied text there. Game Maker will then prompt that the file has been changed and asks whether you want to re-load it so that changes are taken in or to save it so that changes are overwritten with what was in the file before I pasted the content.
Now the problem tho is that those changes aren't showing up in the game, those new lights are not showing up. Instead I am forced to create a custon blank ini file, call it something different like "Level001lights-new01.inf" and put that file name in the creation code to load the files. The changes now showed up but I thought this was strange, game maker refusing to take in the changes of the ini file even though it prompted that changed were made... Now mind you, I did try the "clear target platform" button.
So ok, I did the above mentioned and the new lights with the changes showed up, so I try something. I check both ini files "Level001Lights.ini" and "Level001Lights-new01.ini" and they are both identical. I go into the %AppData% folder of the game where it saved the ini files originally, delete them.... and now all the loghts are gone. WHAT IS GOING ON HERE I think. Does game maker read files from the project directory or the game folder in %appdata% ? Maybe I'm missing something, maybe I'm supposed to save the included ini files into the %appdata% folder before accessing them. This is very confusing. All I can do now, to get the new lights working is to include a blank ini file, call it something new, this time "Level001Lights-new02.ini" and copy the data there. So every time I make a change I'd have to rinse and repeat going into "-new03" "-new04" etc. instead of just opening the original ini file and pasting the new config text there.