How would one begin LUA?

Hello I’m quite new to this section and I was wondering

How would one code LUA?

I read the FAQ and it had a link to the GMOD Wiki LUA Section but no content was posted there

Any of you have good places to start at? Website links or anything of the sort?

First of all, WHAT do you want to code? A gamemode? Server addons? If you just want to make nice guns, you don’t need to really know Lua

Hmmm, I would say something like a Simple Gamemode possibly.

And for the part with Guns, While I probably won’t bother I’d be nice to know what people use for creating cool guns.

When I started all those years ago, I read all the way through the first edition of PIL. I still reference it occasionally.

If you’re looking for a general Glua resource, I wouldn’t know where to point you. The tutorials on the new wiki are sparse and a bit hard to understand without prior Lua knowledge. The old wiki had tons, but most of it won’t appy to the various new systems pushed in the update.

[editline]15th January 2013[/editline]

Also, for more in-depth definitions of functions, check out the manuals (there are links to them on the PIL page).

The problem with PIL is that it is meant more for people with previous programming knowledge who want to know how to use Lua specifically rather than learning to program in general.

So, really, the question is are you interested in learning to program? A guide along the lines of this should give you an idea of what it would take and the kind of commitment programming takes.

The most important step of the process is actually liking programming and being interested in it in general.

Having a tutor would be a good idea, since they can either answer your questions ( why does this not work the way I expect? How do I use surface.DrawPoly? ) or point you to an example at a minimum. However, do NOT try to get someone to teach you by giving you “the codes.” In general, someone who is helping you should be in a similar timezone to you if at all possible - if someone is on the other side of the world from you, they are going to be hard to get in contact with, especially if they have a day job.

Programming isn’t for everyone. Having someone teach you or reading tutorials isn’t going to turn you into a person who can write code for an hour or more at a time and get things accomplished. It takes serious dedication, even more so if you end up partially or entirely self-taught. It takes a serious amount of time - likely a few months to get an understanding of the logic in general.

In addition, don’t start big. While writing a gamemode would be a shortcut method to learning everything along the way ( weapons, entities, hooks, effects, gui, et al ), it would be better to start small on things that aren’t very difficult and work your way up. The best part about starting small is you get to see results sooner. Find out if you still have an interest in it after making a few weapons and entities.

I don’t want to scare you off from programming, but don’t set yourself up for disappointment. It’s going to be somewhat difficult ( or hard, depending on how you think ), it is going to be frustrating, and you aren’t going to see many results until later.

I like that answer. One thing many forget (myself included) is that programming takes some serious dedication and it most certainly isn’t for everyone.
Though, I’m not entirely in agreement with you about PIL. I had pretty much zero knowledge about programming before I read PIL. Everyone is different, and I like a challenge; reading and trying to understand PIL at the age I was at (at least 4 to 6 years ago) was a task indeed, but I enjoyed every second of it. I am entirely self-taught; never taken a programming class or anything of the sort. I just mucked around until things worked, following the steady words of PIL, and I felt I learned more doing that than I ever would otherwise.
The link you posted seems to explain what I find am constantly trying to convey perfectly. It’s going on my bookmarks.

One does not simply begin lua.

Just kidding. Look up tutorials. Learn Lua itself, shit like that.

Maybe learn with Love?

It’s probably the best way to get into Lua if you’re not familiar with programming at all

I started lua coding by making darkrp jobs at first. Try editing the shared.int file in the darkrp gamemode.
Plus YouTube is a great way to learn to

DarkRP is a clusterfuck of disgusting code practices.

(at least it was when I first looked at it a while ago)

:s

First start a small project such as an addon or simple gamemode, and reference similar addons or gamemodes as you progress. Look for appropriate hooks and functions on the wiki.

Also of course read the first few chapters of PIL to learn the basic syntax. http://www.lua.org/pil/

It really helps if you already have programming experience, so take any classes if you school offers them.

I ordered “PIL second edition” yesterday because I learn alot better from books (Don’t ask me why). Anyone who has them that can share a little review? Thanks in advance!