Writing into TXT

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
~Tidal
Prole
Posts: 27
Joined: Sat Jan 10, 2015 8:19 pm

Re: Writing into TXT

Post 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:
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Writing into TXT

Post 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)
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
~Tidal
Prole
Posts: 27
Joined: Sat Jan 10, 2015 8:19 pm

Re: Writing into TXT

Post 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?
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Writing into TXT

Post 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!)
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
~Tidal
Prole
Posts: 27
Joined: Sat Jan 10, 2015 8:19 pm

Re: Writing into TXT

Post 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).
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Writing into TXT

Post 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?
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
~Tidal
Prole
Posts: 27
Joined: Sat Jan 10, 2015 8:19 pm

Re: Writing into TXT

Post 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 :).
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Writing into TXT

Post 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)
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
~Tidal
Prole
Posts: 27
Joined: Sat Jan 10, 2015 8:19 pm

Re: Writing into TXT

Post 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.
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Writing into TXT

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests