Jump to content


Photo

ini file


  • Please log in to reply
5 replies to this topic

#1 mrokke96

mrokke96

    GMC Member

  • New Member
  • 256 posts
  • Version:GM8

Posted 21 May 2012 - 03:58 PM

Hi there! im making a xp kinda thing in a ini file, and when i kill a enemy i want it to increase by 1, i tried ini_write_real("Blah","Blah",+1) but nothing happens!! Why, what am im doing wrong? :confused:
  • 0

#2 @Alex@

@Alex@

    Retired GMC Reviewer

  • Reviewer
  • 3076 posts
  • Version:Unknown

Posted 21 May 2012 - 04:00 PM

You shouldn't be writing to the ini in real time, you should only be writing it at the end of the game or when you save.

If you do want to do it this way you'll need to fetch the variable from the ini value , increase it and rewrite it to the ini file.
  • 0

#3 ChefDavid22

ChefDavid22

    No, YOU shut up!

  • GMC Member
  • 1193 posts
  • Version:GM:Studio

Posted 21 May 2012 - 04:03 PM

Yes what Alex says - that will put too much hog on resources for your game. Your best bet is to check at the end of the round and see if your new value is greater than the saved value, then override with the new value.

Edited by ChefDavid22, 21 May 2012 - 04:34 PM.

  • 0

#4 mrokke96

mrokke96

    GMC Member

  • New Member
  • 256 posts
  • Version:GM8

Posted 21 May 2012 - 04:05 PM

Yes what Alex says - that put too much hog on resources for your game. Your best bet is to check at the end of the round and see if your new value is greater than the saved value, then override with the new value.

ok, but how do i check that, if the xp value or what you want to call it, is greater than the value in the ini file??
  • 0

#5 @Alex@

@Alex@

    Retired GMC Reviewer

  • Reviewer
  • 3076 posts
  • Version:Unknown

Posted 21 May 2012 - 04:15 PM

You read the value from the ini file and store it in some variable. You should already be storing your xp in some other variable you simply check if variable B is greater than variable A and then if it is you write the value.

Have a look at the guides in my signature and some of the other ones in the Tutorials section to get a better idea on how to use ini files.
  • 0

#6 mrokke96

mrokke96

    GMC Member

  • New Member
  • 256 posts
  • Version:GM8

Posted 21 May 2012 - 04:29 PM

You read the value from the ini file and store it in some variable. You should already be storing your xp in some other variable you simply check if variable B is greater than variable A and then if it is you write the value.

Have a look at the guides in my signature and some of the other ones in the Tutorials section to get a better idea on how to use ini files.

Oh, how stupid i am :sweat:, i should have known that, but thank you and chefdavid22 for the help!! :thumbsup:
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users