X
Xarddrax
Guest
I am having a horrible time for the last 2 hours trying to figure out why i cant update my .ini file with a script.
I am able to test the file exists. I am able to read the keys (at least see they exist) but I cant change them. I am running this script from an alarm every 600 ticks. Everytime I check the file using the resource explorer ("Included Files" tree) there is the same default setting I manually entered.
Here is the script being called:
I am able to test the file exists. I am able to read the keys (at least see they exist) but I cant change them. I am running this script from an alarm every 600 ticks. Everytime I check the file using the resource explorer ("Included Files" tree) there is the same default setting I manually entered.
Here is the script being called:
Code:
//update .ini file and current states
hp=obj_status.playerHp;
hpMax=obj_status.playerHpMax;
mp=obj_status.playerMp;
mpMax= obj_status.playerMpMax;
xp= obj_status.playerXp;
xpMax= obj_status.playerXpMax;
pbattles= obj_status.playerBattles;
hitC= obj_status.pHitChance;
critC=obj_status.pCritChance;
deaths=obj_status.pDeaths;
dmg=obj_status.playerDmg;
/* //----Test to see if the file is there---
if (file_exists(working_directory + "\player.ini"))
{show_message("its here");}
*/
ini_open(working_directory + "\player.ini");
if ini_key_exists("playerStats", "hp")
{show_message("key is here");}
ini_write_real("playerStats", "hp", hp);
ini_write_real("playerStats", "hpMax", hpMax);
ini_write_real("playerStats", "mp", mp);
ini_write_real("playerStats", "mpMax", mpMax);
ini_write_real("playerStats", "xp", xp);
ini_write_real("playerStats", "xpMax", xpMax);
ini_write_real("playerStats", "pbattles", pbattles);
ini_write_real("playerStats", "hitC", hitC);
ini_write_real("playerStats", "critC",critC);
ini_write_real("playerStats", "deaths", deaths);
ini_write_real("playerStats", "dmg", dmg);
ini_close();