Jump to content


Photo

Can't read INI files...


  • Please log in to reply
4 replies to this topic

#1 ZetronMan

ZetronMan

    GMC Member

  • New Member
  • 16 posts

Posted 02 September 2010 - 04:43 PM

Hey all,

I'm not sure if this is a bug, or a "feature" and was wondering if I was doing something wrong, or if others have run into this too. When I create a simple INI file for reading in notepad, I seem to be unable to read it in game maker (it seems to open the INI file, I just get the default value assigned to the variable I'm assigning the value from the key to).

I noticed that if I write the INI file with game maker, then I can read the INI file. I can even modify the game maker created INI and have it continue to work. I am not at the computer I have it on right now, but my next step was to open up both in a hex editor and see if Game Maker adds anything specific to the file header that it may be looking for when opening.

Has anyone else run into this issue? If so, has anyone figured out what causes it?

Thanks!
ZM

p.s. I am making a level creator in GM, so it's not really an issue I need help solving as it's irrelevant to my game, just a PITA to figure out why it was happening and I'm wondering if others have experienced it, and in the future if there's something I can add to the file header to not run into this.
  • 0

#2 ramses12

ramses12

    6

  • GMC Member
  • 5769 posts
  • Version:GM8.1

Posted 02 September 2010 - 05:04 PM

There is no invisible file header for a .ini file. Are you sure that your notepad file is absolutely identical to the GM's one? The only thing that can cause this would be a mistake in the name. As I recall, GM's ini functions are case-sensitive; that might be a problem.
  • 0

#3 ZetronMan

ZetronMan

    GMC Member

  • New Member
  • 16 posts

Posted 02 September 2010 - 05:17 PM

I don't think it's the file name, because when I had the incorrect file name, the room wouldn't load (loading the INI file into variables was in the room create code). It was just returning the default value, so I reduced my INI to one section, one key and one value, same problem of default value.

I then deleted my INI file, used the GM functions to write the INI file with the exact same section, key and value, then on next run commented it out and the default value was no longer being returned. I was able to replicate that behavior on both the Mac and Windows versions of GM.
  • 1

#4 deathzero021

deathzero021

    GMC Member

  • GMC Member
  • 720 posts
  • Version:GM8.1

Posted 02 September 2010 - 06:46 PM

hmm that's strange, i made my INI's using notePad and GM loaded them just fine.
  • 0

#5 ZetronMan

ZetronMan

    GMC Member

  • New Member
  • 16 posts

Posted 02 September 2010 - 07:34 PM

Strange. Perhaps it's time to review my UAC settings on my Vista machine and my permissions on my Mac.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users