Jump to content

What's a good place to learn LUA?


Recommended Posts

So I would like to get into more serious DST modding, but my mod was pretty much assed.

For all of you frequent modders, where did you learn LUA? Where do you suggest I learn it? What's a good place to learn it by practice as a free online course?

Thanks in advance.

Link to comment
Share on other sites

Do you have some programming experience with any language? 
I'm asking because if you have some, it's not a problem to program in Lua at all - almost all constructions are the same as in other programming languages and the rest is just syntactic sugar (or salt, it depends ;) ) So if you have some, my advice - just start doing your mod and use google with parameter site:stackoverflow.com for questions on how to make smt. in Lua

If you havent - theres suggested books at https://www.lua.org/pil/ and online version of first edition that aims at Lua 5.0 (according to this post DST uses 'a slightly modified version of LUA 5.1.4') or get yourself a copy of Second edition that aims at Lua 5.1 (but theres no really big difference between 5.0 and 5.1)

The biggest problem of DST modding (for me, I have ąround 6 years expirience in programming, mostly Python and Java) is lack of DST API documentation - you can be familiar with Lua but in order to make things working in mod you need examples on how it has been already done using DST Objects - Prefabs, Placers, etc. You can find those examples in other mods, at game files (\data\databundles\scripts.zip), or at this forum, but it will take a lot of time.  

Link to comment
Share on other sites

I learned LUA through the reading of the documentation on it online, using a local LUA 5.1 installation to run scripts for language syntax testings, and pouring over the DST code base.

For modding in DST you will be reading over every crevice of the code base repeatedly to find things until you get a basic grasp over many things.  Depending on what you want to end up with you'll have to become knowledgeable in the area before being able to work on it effectively.

Use a program like N++ that has a find in files option to find specific strings is very handy.

 

I have prior knowledge on programming under my belt, so learning the language wasn't hard.

Some things that had me check up online that come to mind were some syntax things, how everything is a variable, meta tables, and the very neat but easily broken debug library.

Meta tables are sort of like operator overloads in other languages, but has some other uses that act more like hooks than anything.

 

Something you'll need is time to learn and the motivation to do so.

Link to comment
Share on other sites

5 minutes ago, CarlZalph said:

I learned LUA through the reading of the documentation on it online, using a local LUA 5.1 installation to run scripts for language syntax testings, and pouring over the DST code base.

For modding in DST you will be reading over every crevice of the code base repeatedly to find things until you get a basic grasp over many things.  Depending on what you want to end up with you'll have to become knowledgeable in the area before being able to work on it effectively.

Use a program like N++ that has a find in files option to find specific strings is very handy.

 

I have prior knowledge on programming under my belt, so learning the language wasn't hard.

Some things that had me check up online that come to mind were some syntax things, how everything is a variable, meta tables, and the very neat but easily broken debug library.

Meta tables are sort of like operator overloads in other languages, but has some other uses that act more like hooks than anything.

 

Something you'll need is time to learn and the motivation to do so.

Haha, thanks for telling me but I already got a hand out of it, the N++ suggestion is extremelly amazing so props to you for that, thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...