Newbie Dev and Syntax Errors

Hello.

I know this is more of a discussion topic, but Lua is hard to come by, sadly. :frowning: I figured I might try to get answers here.

I don’t entirely know the ins and outs yet. I have taken a few courses here and there on different languages, and tried a few game engines- one which I got serious with prior to this. The issues I had then follow me here- I don’t entirely know how to handle syntax errors. Sometimes, the errors make no sense. I have taken a Lua course, but it was for beginners and didn’t involve Corona SDK. As I have a lot of free time on my hands now, I would love to go in depth in understanding how to code. I have been doing the Getting Started Guide, and I have figured a few things out on my own- but is there a guide on syntax errors that I am unaware of? Is there perhaps a good course or video tut series on Corona SDK, or even a master class on Lua that might help? I saw some things on Corona SDK and Lua at Udemy, but I have had some bad experiences there where many questions on the different subjects- which were not only from me- would be left unanswered for months (Not all situations were like that, though. My last teacher there was awesome about such things). Any advice and tips would be appreciated! Thanks in advance.

Welcome to the community.

We have a forum area dedicated to Lua specifically here: https://forums.coronalabs.com/forum/522-lua-language/

At the top of that area you should see a post re: Lua Resources.  There are several good instructional and reference sources listed.

regarding Syntax errors,

First: The error message will typically have a reference to a file and line number as well as a message about the problematic bit of code.  Just remember, the problem may not always be on that line, but may have instead have been caused by some coding error before that.

i.e. If you get an error about some variable being ‘nil’, more than likely you made a mistake while defining or using that variable further back in the code/execution.

Second: When you can’t solve or understand an issue, post a question in the forums.  i.e. I got this error, I was doing this, and I can’t work out what is causing the issues.

Bonus Tip: As you proceed, you will be making larger and larger projects.  You will continue to run into issues and have questions (this is all part of the learning process). 

When you come to get help, debugging some weird issue, it is often very helpful to provide a tiny downloadable project showing the problem.  That way folks can actually grab the code and run it without doing a lot of extra work. 

Also, when making ‘tiny error demos’ you will often figure out the problem (simply by having been forced to look at it differently).

Additionally, when you do need help with something it’s a good idea to follow roaminggamer’s guide on asking questions in a way that makes it more likely you’ll get a straight-forward and helpful answer:

https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/

Welcome to the community.

We have a forum area dedicated to Lua specifically here: https://forums.coronalabs.com/forum/522-lua-language/

At the top of that area you should see a post re: Lua Resources.  There are several good instructional and reference sources listed.

regarding Syntax errors,

First: The error message will typically have a reference to a file and line number as well as a message about the problematic bit of code.  Just remember, the problem may not always be on that line, but may have instead have been caused by some coding error before that.

i.e. If you get an error about some variable being ‘nil’, more than likely you made a mistake while defining or using that variable further back in the code/execution.

Second: When you can’t solve or understand an issue, post a question in the forums.  i.e. I got this error, I was doing this, and I can’t work out what is causing the issues.

Bonus Tip: As you proceed, you will be making larger and larger projects.  You will continue to run into issues and have questions (this is all part of the learning process). 

When you come to get help, debugging some weird issue, it is often very helpful to provide a tiny downloadable project showing the problem.  That way folks can actually grab the code and run it without doing a lot of extra work. 

Also, when making ‘tiny error demos’ you will often figure out the problem (simply by having been forced to look at it differently).

Additionally, when you do need help with something it’s a good idea to follow roaminggamer’s guide on asking questions in a way that makes it more likely you’ll get a straight-forward and helpful answer:

https://forums.coronalabs.com/topic/55780-ask-a-better-question-get-a-better-answer/