How do I use something like INI files with NodeWebkit

Get help using Construct 2

Post » Sat Oct 03, 2015 9:25 am

Hi everyone.

I'm working on a program that will let users create and edit data files. What's my best option for easy data management within the file (setting and retrieving numbers or strings for specific variable names like "X POSITION=144" etc.)

I've used INI files in the past, which would be perfect for my needs. Is there any equivalent for C2 that would work well with NodeWebkit?

Thanks

-Mike
B
49
S
9
G
4
Posts: 425
Reputation: 7,037

Post » Sat Oct 03, 2015 10:13 am

Brashmonkey wrote:Hi everyone.

I'm working on a program that will let users create and edit data files. What's my best option for easy data management within the file (setting and retrieving numbers or strings for specific variable names like "X POSITION=144" etc.)

I've used INI files in the past, which would be perfect for my needs. Is there any equivalent for C2 that would work well with NodeWebkit?

Thanks

-Mike

You can make it load a text file where you could read the data from using NWjs or the XML object might work as well.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,828

Post » Sat Oct 03, 2015 2:00 pm

Load all the data you want to save into arrays.... Then save all the arrays into a single "Save array" and save as text file in .json format.

If you are making one for simple user settings, that the user will be able to understand and read later, you should study the GetTokenAt get token count.
The second option is the hardest, but if you want users to understand the file it is your best bet.


There is a Save and Load game feature as well, but it will not let you have much control over what gets saved. You can save to the built in save slots, or dump the save into a .json string, and save it as the text file.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher and 6 guests