How did you Learn lua?

edited July 2013 in General Posts: 29

I just wanted to know how you learned how to script in lua. Maybe it will help me learn.


  • BriarfoxBriarfox Mod
    Posts: 1,542

    I just picked it up by googling Lua tutorials. Then I just read the posts on here and asked questions when I was stumped!

  • IgnatzIgnatz Mod
    Posts: 5,396

    I've written an ebook that may help you, here for beginners.pdf

  • Posts: 60

    I done both of the above. @ignatz e book is great and I have a copy handy at all times :)

  • edited July 2013 Posts: 175

    By just getting stuck in and experimenting, googling and reading the manual lots :D

    @Ignatz's e-book is an excellent reference for beginners and its all in context to Codea :)

    Id recommend master the syntax first so you can easily identify and fix typos that will prevent you running your code.

    Start simple and gradually build your knowledge :) always try and keep your variables and functions clearly named and your code simple, well organised and spaced out.

    There was a nice cheat sheet posted here a little while ago aswell

    Edit: Here's the manual too :)

  • dave1707dave1707 Mod
    Posts: 9,470

    Trial and error.

  • Posts: 90

    Looking at the Lua docs (the Reference Manual and Programming in Lua) and the examples provided with Codea and in the forums here. I've never used Lua except in Codea. OTOH I've worked with many programming languages so picking up Lua was easy. I also recommend @Ignatz 's ebooks for beginners.

    The bigger trick is learning Codea's environment and libraries on the iPad--the lack of organized documentation has been bothersome. For example, I've had Codea for almost 2 years but only yesterday found a link ( , bullet 3.5) that explains the example programs provided with the Codea system.

    But documentation has considerably improved since my first encounter with Codea almost 2 years ago. On both the iPad and my PC (when I'm using AirCode) I've bookmarked the Lua books, and Lua's libraries are now included in the editor-level documentation. And people on the forums are friendly and span a wide range of Lua expertise, so answers are just a friendly question away.

  • edited August 2013 Posts: 391

    I learned the same way as @dave1707. Using my knowledge of other programming languages I was able to learn Lua fairly quick through trial and error, and, of course, with the help of this great community :D

  • Posts: 7

    Hi all. I'm going on holiday and wanted to download Ignatz' "Lua for Beginners" on my iPad. The link however is dead. Anyone has an updated link? Ignatz?

  • Posts: 282

    I am learning using @Ignatz' ebook, and by studying the example projects and tweaking them.

  • Posts: 7

    Great! Thanks a lot, Ignatz! Downloaded the lot. The 3d stuff also looks very interesting! Maybe this time I'll stick around longer with Codea...

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Uglymike - Codea is cooool...

    Some of the ebooks are unfinished, eg the Codea one, there is just too much to write about.

    Try the shaders too, they are not as nasty as they seem

  • Jmv38Jmv38 Mod
    Posts: 3,297

    learned lua here. Process still going on.

  • Posts: 135

    Same here ^^

  • edited July 2014 Posts: 127

    Reference and wiki, trial and error, all that stuff. The wiki is too complicated for my tastes, though :) And @Ignatz is right, Codea is cool...

    I am still learning code, too (*)

  • Posts: 2,051

    @Ignatz, i don't know about that, I've tried before and shaders still go over my head :P

  • IgnatzIgnatz Mod
    Posts: 5,396

    @JakAttak - did you try my ebook? (I'm not saying I'm any sort of great writer, but I tried to explain it the way I understood it).

  • edited April 2015 Posts: 1,976

    I like to just fiddle around with existing code and find how it works. I do have a background in Java though, so it's a lot easier to pick up new programming languages.

  • Posts: 2,051

    @Ignatz, yes I've read your ebook :) (Im not trying to say you did a bad job, it seems to have helped lots of people)

  • IgnatzIgnatz Mod
    Posts: 5,396

    @JakAttak - lol, you can't win them all. I know what you mean, there are some things my brain wasn't built to understand. #-o

  • Posts: 1,595

    @JakAttak you don't need to fully understand the pipeline or anything like you just need to think it as a grid of colours for the fragment shader, and almost like a vertex manipulator for the vertex shader. It's not hard, although it looked almost impossible when I started them. Still does in places mind you..

  • The user and all related content has been deleted.
  • Posts: 14

    Codea and LUA are truly interesting, though it is a bit hard to learn, at the end if you can do the job, you are rewarded with hours of fun. After all there is nothing like creating something. And it's probably best to stick to Codea's example projects, tweaking the code here & there a bit and watching the results. And the AirCode feature in Codea is a lot of help - write some code and see the effects instantly, so if there is a mistake in your code you can instantly rectify it. If you make mistakes while normally writing on your iPad, the compiler won't let you through unless you write it correctly, AirCode only executes all the correct part, so if some wrong code is written, there is no effect, so you instantly understand that your last line was wrong and can change it or remove it.

    @Ignatz eBooks are truly helpful.

  • Posts: 77

    I mostly learned by trying and modifying other people's scripts (I started on a game called powder toy that has a Lua API)

  • I learned with Codea, just playing around

  • @Ignatz great books! Thanks so much for them.

    I learned Lua by the in app CODEA references (Love the Lookup selection, wish Search was on same popup menu), the references, and forum examples.

    I started programming in 1963 in IBM 7090 assembler, FORTRAN and CDC 1604 assembler. Did a bit of Pascal, PL/1, VB, C# over the years. All this experience helps learn new stuff.

    But I find CODEA and Lua have been the easiest to learn and the most fun to use.

    For those of you who have kept up with my CODEA Enlightenment project, my aim is to make learning from forum and GITHUB examples as easy as possible.

    My intent originally was just to make it easy for me to learn and reuse other's code.

    Thanks to everyone who has helped produce this great and very useful product.

  • Isn't this a really old post?

  • @Saturn031000 Just because a discussion was started a long time ago, that does not mean the content is no longer relevant nor additional posts bad.

  • IgnatzIgnatz Mod
    Posts: 5,396

    I'm still learning. There is so much... <:-P

  • Posts: 2,020

    This raises an interesting point. In the past the mod team have seemed to be quite strict about not reviving very old threads. I can see why that could be annoying if the thread is on a long-depreciated feature, or a bug that was squashed ages ago, a workaround that's no longer needed etc. But aside from those cases, is the no-bumping-old-threads "rule" necessary? When you click a thread, it shows by default #latest, and the posts are all clearly time-stamped, so I don't think it's particularly disorientating when an old thread comes back. And it might encourage people to use the discussion search feature more, if they knew that the results were not just "read only". But what do people think?

  • IgnatzIgnatz Mod
    Posts: 5,396

    It's a matter of judgement. Some old threads are clearly finished, others like this one are open ended.

  • Posts: 216

    I learned some basic syntax (sprites and a ton of if statements) and then just fooled around until I had a game. I kept coming up with newer ideas and just learned new stuff as I needed it with help from the reference or forums.

  • Jmv38Jmv38 Mod
    Posts: 3,297

    for what my opinion is worth (not much) i am very much on the 'let them live' side, so i dont like when people make hard comments about poping up old threads. If you dont like them, just let the thread sink again. And if people keep commenting into this revived thread, well, that means there is a need for that.

  • edited April 2015 Posts: 1,595

    @Jmv38 this is the only proper way, users won't keep an old thread up if the content is bad or irrelevant like some, but either way, it's nice to keep some form of talk flowing.

  • where can I get Lua for beginners.pdf ?

  • dave1707dave1707 Mod
    Posts: 9,470

    @bellboymartin I’m not sure if there’s a beginners pdf. The way I learned Lua was to look thru a Lua reference or the Codea reference to see what some of the commands were. I would then write simple programs just to see what the commands would do. I would modify thing to see what would happen. If things got confusing, I would ask questions or look for examples of code. The programs started small, but got larger as I learned more. So, if you have any questions or you would like to see a specific example of something, just ask. Everyone here will help, you just need to ask.

  • Posts: 1,255

    Pretty much trial and error... but after Pascal, Basic, Java, TMS9900 assembly, C, C++, Java, JavaScript, VB, Ruby, they all start to look sort of alike. There are things I love about Lua — collections. And things I hate — also collections. I seriously appreciate that you can trust the string handling. Recent coding on microcontrollers has reminded me of the hair-rippling experience of dealing with C string libraries (don’t, just don’t).

    Don’t discount the example code. It’s fantastically valuable for “how'd they do that?” moments.

  • pacpac
    Posts: 216
    Don't know lua just what parts are in codea.
  • Hey, a full learning resource for lua is being written over at it'll reach you step by step not just how to write lua, but how to code from the ground up. No experience needed and, it's completely free

  • Posts: 1,094

    i knew many languages. i read the lua manual, which worked for me because i'm experienced in reading language manuals. then i started writing programs ... and i still look things up in the manual sometimes. happy to help here or twitter. even email.

Sign In or Register to comment.