• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows (Question) Can you save to another game's ini file.

C

Colorics

Guest
Title says it all, can you open up an ini file of another game you've made and alter it through the second game? If so, can you give me the code to do that. Would appreciate if you could change this game code to do that.

if (file_exists("Save2.sav")) file_delete("Save2.sav");
ini_open("Save2.sav");

The Save2.sav is in:
C:\Users\Anonymous\AppData\Roaming\Project
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Due to sandboxing rules, each game/application only has access to it's own directory, determined by the project name. So you would either:
  • Rename the second project file so that it shares the directory.
  • If this is for single-time save game import, use get_open_filename to let the user pick the file (which bypasses the sandboxing mechanism).
  • If you only aim for desktop platforms, use an extension to copy the file around or edit it at the other directory directly (free, paid)
 
Top