Guide to scripting with Lua

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
I've been working on a book which aims to provide a way to learn for anybody looking to learn Lua. The end goal is to have a book that lets anybody go from zero knowledge to being experienced, and to provide even just 1 thing that somebody could learn, even if the reader is experienced.
Hopefully what I'm writing here will be easier to understand than anything given or explained by the official Programming in Lua book, or any explanation on lua-users.
This book isn't so people can learn scripting for TFS. I believe it is infinitely more important to learn the language itself rather than learning just enough to get by and create nooby scripts in TFS. Learning the language itself and applying that knowledge to TFS will be much easier in the long run than not knowing what you're doing and simply just copy/pasting code (this is exactly how I learned and how I got here today!).
This book is not finished, but I have finished all of the basics that anybody looking to learn will need, and there will be much more to come.
If you're here to learn, tell me what you don't understand! It will help me improve and be able to provide a better explanation for future readers. Experienced readers, alert me of any typos or mistakes I may have made, or if you have any recommendations on analogies or examples, let me know!
I believe anybody, even if you're unfamiliar with programming, can learn at least how to do basic things in any language. All you have to do is have an open mind and apply yourself.

You can view the book here:
 
Last edited:

zxmatzx

Intermediate OT User
Joined
Dec 1, 2010
Messages
150
Best answers
5
Reaction score
37
Very good content! Easy reading and very well explained! Waiting for next chapters.
 

Shadowsong

Game Developer & Graphic Designer
Joined
Feb 23, 2010
Messages
3,368
Best answers
17
Reaction score
2,663
Location
Bosnia & Herzegovina
Extremely simple and easy to understand, like Lua itself is. This will come in handy as a reference for helping anyone who wants to get into OT development and further using Lua.

I'm currently organizing a bit of a boot-camp for new developers on my project, and have been explaining these things to them through wiki entries and discord notes, but having a book like this, explained in layman's terms is much easier.

It's interesting to see that most of us tend to use almost the exact analogies for explaining stuff like tables and variables. 😅
 
OP
Delusion

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
Update: I've added examples for the return keyword in Control Structures, and added the length (#) operator in the Operators page. Also added a new example for functions under Types to declare a function inside of a table like all of the standard libraries do (table.insert, string.format, etc). Made drafts for Closures, Iterators, and Recursion.

I've also introduced the rest of the layout of the book so you can see what it'll look like in the end, but I'll more than likely be writing the concepts before manually rewriting the Lua manual to include examples of each standard lib function.
 
Last edited:

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
628
Best answers
17
Reaction score
74
Very Nice Bro!!!
I read All and im waiting for a News.
 
OP
Delusion

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,935
Best answers
451
Reaction score
2,547
Metatables, Weak Tables, Memoization, and Object-Oriented Programming now have rough drafts.

The Object-Oriented Programming page will be especially useful for those looking to understand how the new TFS scripting style works in 1.0+. Memoization as well for anybody trying to optimize scripts.

Since the Concepts chapter is now 'finished' (roughly), I will be working on the Auxiliary/standard library chapters.
 
Last edited:

Kulavy

New Member
Joined
Apr 3, 2017
Messages
4
Best answers
0
Reaction score
0
Good Job ! Very helpful and easy to understand o_O
 
Top