Binary ini type thing

For questions about using Classic.

Post » Thu Jun 04, 2009 4:49 am

Is it/would it be possible to have an ini file that you can read and write stuff to as usual but that is stored inside the exe?
I don't know how necessary it would be or if it's already possible but i think it would be a cool idea for like level editors and stuff where you could store all your levels in INTERNAL ini's so people don't go around editing things like save files and levels etc?
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Thu Jun 04, 2009 4:57 am

I do this for Vert.

I make an .ini with my level editor. Then I copy/paste the text of the .ini into a text box in my game.

The text boxes are all instances of the same box, with a "level" PV for the level number. There is a "levelNum" global to keep track of what level you're on.

When it's time to load, just do a quick "levelText.Value('level') Equal to global('levelNum') -> do level loading"

Easy :)

Of course, you can't write to it. You can't just write new text to a built .exe. Though I suppose you can "save" the game info after changing the level text if you're using the System save/load actions.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jun 04, 2009 5:23 am

That sounds like an interesting way of doing it.
I still would like my way though, that could give some games the option of user created levels without filling the directory with easily edited inis etc and you would also have all the other standard ini file interactions without the external files
Or is there some sort of encryption?

anyway it was just a thought i had that i like
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Thu Jun 04, 2009 8:55 am

<Insert obligatory comments on how it's the persons loss if they modify the game>

If your level is fairly complicated, then to modify it to confer any kind of advantage or anything (which in itself isn't disastrous) would be effort. Having your games open to mod often extends the life anyway! If you have a sub directory called 'maps' or 'levels' it's no clutter.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests