Jump to content




Yeah ... I'm Totally Lost In My Mind (fs.open(), Write Table And Cie ...)


  • You cannot reply to this topic
2 replies to this topic

#1 Neekow

  • Members
  • 55 posts

Posted 13 November 2013 - 06:33 PM

Hi every one.

Before, anything, i'm french, so my english isn't perfect (really), so i hope you'll understand what i'll say ... (as i'm not sure to understand myself ... will be hard to explain).


ATM, i'm trying to do a really complete printer program (GUI, Saves/Load, pre-done page and maybe colors ...), but i really miss a huge part of lua (especially in syntax, and a bit when i've to imagine what the result of an completly "temporary" table).

So what are my problems now:
(what i want)
  • to do saves, i think that the best way is to create a file with the title as file's name:
    you have: "i love myself" in title, on your computer you will have save/i love myself
    and in this file will be also write: your text, the page you used, the page's limit
  • have in my mind something like:
    Current_text = {{xPos,yPos,letter,colorCode},{xPos+1,yPos,letter,colorCode},{xPos+2,yPos,letter,colorCode}{xPos+3,yPos,letter,colorCode},...}
    in the text's file, why:
    - by this way, i'll should be able to avoid any bug like 2 letters in the same place (what will be anoying when you'll print ...)
    - easy to rewrite on screen (and see imediatly any change you do)
    - highly easy print (as term.cursorPos(1,1) = print.cursorPos(1,2)
(where i'm stucked, got the ideas, think parts of differents functions ...)
Note: these are my own handwrited notes, didn't tryed on CC because i know that nothing is right, i'll comment on what it's mean for me
Spoiler
-- [[ [2]
check from the end of file and rewrite the "new position" in the same place are very important (in fact, almost all of this functions are based of this) ]]

anyway ... i'm on that actually, and i really dunno where i should go to continue ^^ so if ever some one can post links where it's explain or take the time to explain or have an idea ... thanks =)

#2 Yevano

  • Members
  • 376 posts
  • LocationUSA

Posted 13 November 2013 - 07:01 PM

You made a pretty big post without really asking a question. So, what exactly do you need help with? Do you need to know how to do file IO, or is it the GUI you're having trouble with? If you haven't tested anything in-game or in an emulator yet then I suggest that you do that first and experiment.

#3 CCJJSax

  • Members
  • 262 posts

Posted 13 November 2013 - 10:08 PM

Yeah, I'll be honest I didn't get too far into that topic until my ADD kicked in. If you're trying to figure out how to write to a file, this worked perfectly for me and it was rather easy to understand.

Go to the 14th post in this link that I'll give you. It's made by a guy named MysticT. http://www.computerc...lines-in-files/





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users