Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Save files?


TailsSena

Recommended Posts

To check the first one, simply make a global "config" save file (it can be an ini) and leave a value there as 0. When the game starts, check if said value is 0, and if it is, do whatever you need to do, while setting said value to 1. You can use this ini to store stuff such as default controls, window size, among other things.

-------------------

To do the second check, there are various methods. I'm assuming you're loading a "fixed" array (ergo, one with a specific name that won't change). This array should always exist (include it in your default installation). You can use the File object to check if it exists. If it doesn't, immediately write the array to file so it's recreated.

You'll have to compare the first "free" byte of your array (remember that MMF arrays begin with CNC ARRAY as ASCII text), if it's equal to zero.

+Condition
---*Action

+[color=#0000CC]ValAtXYZ[/color]([color=#00AA00]"Array"[/color],[color=#CC0000]0[/color],[color=#CC0000]0[/color],[color=#CC0000]0[/color]) = [color=#CC0000]0[/color]
---*actions here

Assuming your value array is zero-based, this event will compare the first usable value of the array to zero.

There, you can do as you wish. If you use a text array instead, simply replace ValAtXYZ with StrAtXYZ and the 0 in the second expression with "".

  • Like 1
Link to comment
Share on other sites

Easy: The File object has a pair of conditions "File is Readable" and "File is Writable".

Either of these will work. When it asks for an expression, use appdir$ as an equivalent for the application directory.

Example: appdir$+"\Music\boss.mp3" would point to the file "boss.mp3" inside a "Music" directory, which is in the directory where the application's executable resides.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...