Page 2 of 2

Re: Writing into TXT

Posted: Sat Jun 27, 2015 6:53 pm
by ~Tidal
So, i was thinking...a save file should be placed in the same folder too? That's pretty...annoying, to be honest. :huh:

Re: Writing into TXT

Posted: Mon Jun 29, 2015 6:03 pm
by Positive07
~Tidal wrote:So, i was thinking...a save file should be placed in the same folder too? That's pretty...annoying, to be honest. :huh:
Well it seems you have never looked for Chrome or Firefox configuration files, they are in AppData hidden in thousand of files that are used internally... Horrible just as you said, but a common problem

A solution, make subdirectories in your save folder, Configuration, Saved Games, Private, etc. I would totally go with!

Another solution, change the identity (save folder), for example when you write your private files use love.filesystem.setIdentity("YourGame Privates") and when you want to save the game do love.filesystem.setIdentity("YourGame")... Note that LÖVE had some issues with this in the past (I think they are fixed now)

Lastly: Just make names clear, or document which files should be touched by the user and which ones should be ignored (you should probably do this even if you use some of the above solutions)

Re: Writing into TXT

Posted: Tue Jun 30, 2015 12:10 pm
by ~Tidal
Oh.
I'll probably hijack the whole stuff, making the user backup its save file if it want to directly from the game in some way.
Sounds decent enough?

Re: Writing into TXT

Posted: Thu Jul 02, 2015 6:39 am
by Positive07
~Tidal wrote:Oh.
I'll probably hijack the whole stuff, making the user backup its save file if it want to directly from the game in some way.
Sounds decent enough?
Well old Flash games had those codes, were you would end up a level and this code would pop up and if you played another time you could put the code in a text box and you would start on that level... So yeah something like that maybe (you can [wiki]love.system.getClipboardText[/wiki] and [wiki]love.system.setClipboardText[/wiki], just dont do it without user consent)

Or you could just use [wiki]love.system.openURL[/wiki] (I would really prefer this!)

Re: Writing into TXT

Posted: Thu Jul 02, 2015 8:56 pm
by ~Tidal
Well, cookie clicker does this, for example.
Even just displaying the code itself would do the trick, I think, adding some sort of encryption (so it wouldn't be SO simple cheating).

Re: Writing into TXT

Posted: Sun Jul 05, 2015 7:11 am
by Positive07
~Tidal wrote:Well, cookie clicker does this, for example.
Even just displaying the code itself would do the trick, I think, adding some sort of encryption (so it wouldn't be SO simple cheating).
Dont worry about that stuff!! People that wants to have fun, will have fun!... Also it was a nice thing to play in a friends computer and say "Hey! I've got a code for level 10!!", even if the code is distributed online and people "cheat" I dont consider that a bad thing... Not if they are playing my game hahaha... Do you have a solid reason to think encrypting the code is needed?

Re: Writing into TXT

Posted: Sun Jul 05, 2015 2:51 pm
by ~Tidal
Because I like the idea of people breaking my code, but not just changing, for example "Chinese_Vase.unlock = false" into "Chinese_Vase.unlock = true". It would be too simple. And I'm evil inside. Actually just saving in quads or bits will do the goal. I just don't want everything to be a nominal value :).

Re: Writing into TXT

Posted: Mon Jul 06, 2015 10:29 pm
by Positive07
Oh! Of course! The user doesnt need to know what the data means.

Also If you can dont make it long, try to keep it less than 30 characters if possible (will allow the user to write it down on paper)

Re: Writing into TXT

Posted: Sat Jul 11, 2015 8:26 pm
by ~Tidal
there is something (library, function, user function) that converts data in quads, bits, and then ascii (a-z, 0-9)? Do you have any idea how to do that? I did this in a previous game, but it was a mess since it included EVERY symbol in the chart and not only a-z/0-9 (or at the best "usual" punctuation).
Thanks in advance.
Sorry, I am a beginner in programming and coding...and I don't even study this.

Re: Writing into TXT

Posted: Sat Jul 11, 2015 8:41 pm
by airstruck
It sounds like you need two things, a Lua binary serialization library and something like a Lua ascii85 encoder or Lua base64 encoder.

Always helps to know what you're looking for.