Hey, I’ve looked around abit and I cant see to find any decent tutorials apart from the WIKI to learning LUA. So I was wondering if anyone has any pointers to learning LUA? Also, do I need to know any other programming/scripting language before picking up on LUA? or can I just jump straight in LUA and learn it. And how would I go about learning.
Go through the wiki tutorial and have a brief read through PiL.
[del]See, the first thread in this section, what does it say?[/del]
Didn’t read thread; only title
Wikis are good for learning syntax, but too really learn lua (or any other language) you have to think logically and be able to see the patterns in the code (not understanding what it does, but just see repeating patterns and keywords) and finally to see connections between the code and what actually happens in game. Oh and always try to solve problems yourself before asking for help:wink: Good luck!
1.) Download addons you like
2.) Modify them to make them into addons you really like
3.) Repeat until you begin to fiddle with more advanced stuff
4.) Create your own small addons
5.) See 3
6.) Create bigger addons
7.) See 3
8.) Acquire a massive ego
10.) You’re now a well known Lua developer within the GMod realm
11.) Turn into a lua king
12.)Dominate South American countries and use their combined forces to dominate the rest of the world
13.) Move onto C++
[del]14.) Create a mod[/del]
14.) Write modules
Exactly what I was thinking after I got the hook of EventScripts.
The wiki tutorial doesn’t do very much besides get your feet off the ground. I recommend attempting to make a variety of different things, useless or not. If you’re stuck, try to think of an addon that does something similar to what you want to do. Look thru that addons code, and learn from it. Just don’t steal it.
I reccomend just placing your lua files in lua/autorun/client or lua/autorun/server for now, then running them via lua_openscript[_cl]. Make sure gmod is in windowed mode, and make sure your using notepad++ with the gmod lua plugin.
And never EVER copy paste code. EVER!
By doing so you do not only learn nothing
but you will laso go to hell when you die:devil:
Google it. Lua is not only a programming language for Garry’s Mod. Check out lua’s homepage and read throu a starter tutorial. Then try to modify some addons for garrysmod, and after that it’s just to create stuff/try to create stuff. You don’t need to know any other programming language before you start with lua. Lua is one of the easiest one.
Agreed you really need to look at the tutorials on the garrysmod.com wiki they will give you a true basic look at lua programming and start you on the path to creating a very basic mod.
But to be honest depending what your after it would most probably be easier to do that then look at mod making for existing addons like exsto, I gave it a good go last night for first time and thanks to their example and the tutorials on gmod wiki I was able to make a simple and functional plugin that also saved its settings to the server file system and would respond to chat typed commands as well as console commands.
I didnt manage to make anything more advanced than just that but I think with more study and education the programming language could be learned in a matter of weeks.
Also I’d ignore the copy and pasting code remark fk him, copy and paste away as this will only cause issue which then you will have to trouble shoot and fix it also gives you example code to work with and study as during your editing of someone elses script you will learn what and how they did what they did thus enabling you to rewrite it, improve it and hopefully introduce your own functionality and systems of operation.
I learned html, jquery and asp from looking at other peoples code taking it apart, putting it back together and now I write all my scripts from scratch and have a quite large code file that I use in almost every site thanks to that method of learning, did i mention I picked up and got to an intermediate/advanced in asp in less than one month when I started this job.
There’s a difference between copying and pasting, and using other people’s code to learn.
Sorry I assumed that was the point intentionally stealing code and claiming its your own is a big no no, no matter where you are the legal implications can be awful and the social repercutions are not even worth looking at as its just too horrible