• Where did you learn lua?
    17 replies, posted
Hey Guys, Could you post how/where you learnt lua coding, i would love to learn but i dont know where to start and which is the best place to start. Thanks, CharbelK.
[QUOTE=CharbelK;48140408]Hey Guys, Could you post how/where you learnt lua coding, i would love to learn but i dont know where to start and which is the best place to start. Thanks, CharbelK.[/QUOTE] I mostly taught myself by looking at other people's scripts and trying to figure out how they worked and then applying what I learned to do the things I wanted to do. I made a lot of mistakes along the way and there are plenty of things I did wrong looking back but I eventually learned it. Once I had figured out the basics I read a lot of documentation and tutorials. Here are some good resources that I found helpful: For Gmod take a look at: [url]http://wiki.garrysmod.com/page/Main_Page[/url] [url]http://www.lua.org/manual/5.1/[/url] (version Gmod uses) [url]http://lua-users.org/wiki/LuaDirectory[/url] Although it is outdated the old wiki is occasionally helpful because it tends to have better examples then the new one. [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4875.html[/url] For Lua in general: [url]http://www.lua.org/manual/5.3/[/url] (latest version) [url]http://lua-users.org/wiki/LuaDirectory[/url]
I don't know glua but I did learn lua. With löve, reevezy67
Self taught. I went and started trying to modify SWEPs for TTT to do silly things like edit the zombie infector, I wrote a lot of bad code and have a lot of broken SWEPs because of it. After SWEPs I started writing addons that incorporated Derma and net messages and so on. You can learn pretty fast and once you get the hang of it and start working on larger projects you'll get better (and never want to read your old code)
Already was familiar with most C languages be4 I did gmod, learned most from the old wiki over at [URL="https://maurits.tv/data/garrysmod/"]maurits.tv[/URL]. It has lots of examples. Started in late 2013.
[QUOTE=mooshbeef;48142512]Already was familiar with most C languages be4 I did gmod, learned most from the old wiki over at [URL="https://maurits.tv/data/garrysmod/"]maurits.tv[/URL]. It has lots of examples. Started in late 2013.[/QUOTE] Ok thanks. [editline]8th July 2015[/editline] [QUOTE=Exho;48140679]Self taught. I went and started trying to modify SWEPs for TTT to do silly things like edit the zombie infector, I wrote a lot of bad code and have a lot of broken SWEPs because of it. After SWEPs I started writing addons that incorporated Derma and net messages and so on. You can learn pretty fast and once you get the hang of it and start working on larger projects you'll get better (and never want to read your old code)[/QUOTE] interesting ok. [editline]8th July 2015[/editline] [QUOTE=Dinnanid;48140499]I mostly taught myself by looking at other people's scripts and trying to figure out how they worked and then applying what I learned to do the things I wanted to do. I made a lot of mistakes along the way and there are plenty of things I did wrong looking back but I eventually learned it. Once I had figured out the basics I read a lot of documentation and tutorials. Here are some good resources that I found helpful: For Gmod take a look at: [url]http://wiki.garrysmod.com/page/Main_Page[/url] [url]http://www.lua.org/manual/5.1/[/url] (version Gmod uses) [url]http://lua-users.org/wiki/LuaDirectory[/url] Although it is outdated the old wiki is occasionally helpful because it tends to have better examples then the new one. [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4875.html[/url] For Lua in general: [url]http://www.lua.org/manual/5.3/[/url] (latest version) [url]http://lua-users.org/wiki/LuaDirectory[/url][/QUOTE] Thanks for the information and links
I'd recommend learning coding basics in maybe python or java, just to get the hang of it. Once you know how to code basically, like you don't need to know more than how to use functions and loops, maybe some OOP basics but you could literally do anything by not being so experienced if you put things together correctly. Read a little on the gmod wiki.
[QUOTE=RedNinja;48144465]I'd recommend learning coding basics in maybe python or java, just to get the hang of it. Once you know how to code basically, like you don't need to know more than how to use functions and loops, maybe some OOP basics but you could literally do anything by not being so experienced if you put things together correctly. Read a little on the gmod wiki.[/QUOTE] Why on earth would you learn language X to help you learn language Y? Especially when there is no serious reason to learn X over Y because the programming concepts are the same and the syntax is similar. It just makes no sense to send a guy off to another programming language to learn exactly what he could learn in the first one and I can vouch because I learned Lua first and applied those concepts to C#, not the other way around.
I learned Lua over 9 years ago so I could create stuff in Roblox. I used their wiki primarily ([url]http://wiki.roblox.com/index.php?title=Scripting[/url]) but picked up a Lua book from a bookstore and then taught my self going forward. In my opinion, dissecting the creations of others to see how they accomplish things is one of the best ways to learn.
God, it was back in 2007. I simply tried out addons and then remembering downloading "sin weapons" addon and changing its gun sound to some other in lua. That was ground breaking for me, hah. Never had coded anything my life, seeing how things function the first time in my life. I was hooked. There were no tutorials back then, so over the later 1-2 years I copy pasted, see what errored what worked, got to know everything by trial and error. Until at some point it became alot easier to simply write my own code instead of copy pasting.
I copy pasted everything I could, at some point I figured out the basics, started to look at the wiki, talked with others and learned over a couple years. You can find some good resources [URL="http://facepunch.com/showthread.php?t=1337945"]here[/URL]
[QUOTE=Exho;48144728]Why on earth would you learn language X to help you learn language Y? Especially when there is no serious reason to learn X over Y because the programming concepts are the same and the syntax is similar. It just makes no sense to send a guy off to another programming language to learn exactly what he could learn in the first one and I can vouch because I learned Lua first and applied those concepts to C#, not the other way around.[/QUOTE] Think a little. Lua is not a language which should be learnt as a first programming language. It's hard to understand and different than others. If a person wants to know how to program he should start off with an easier, friendlier language. And then start learning lua. I'm not even talking syntax-wise.
Been programming in various languages since I was in elementary school. Expression 2 was a huge gateway to Gmod for me, but it was a bit confusing moving from E2's naming conventions to lua's. Before that I think I messed around in QBasic/Java/Python/C#/ Maybe a little bit of C/C++ but I had no idea how memory management was supposed to work.
[QUOTE=RedNinja;48145035]Think a little. Lua is not a language which should be learnt as a first programming language. It's hard to understand and different than others. If a person wants to know how to program he should start off with an easier, friendlier language. And then start learning lua. I'm not even talking syntax-wise.[/QUOTE] I think your making it out to be harder than it really is... Yeah sure the way tables are handled are bad and can lead to bad practices but its important that you understand the concepts of storing multiple values together and its not that hard to pick up Arrays after that. And then with 1-indexing instead of 0? Subtract 1 when you access an array's value and just remember that it starts at 0. One type per array? Even easier to catch on to. What is important is that you learn the concepts, I went from gLua to Unity and C# and picked it up fairly quickly because [U]I knew how to solve my problems with code[/U] and it was just a matter of changing the syntax and adjusting here and there for a new language. I don't think I would've been able to whip up a simple 2D game in a few weeks without already having knowledge in Lua. And Lua is friendly and easy, its easier than any C language and reads more like english. I would argue its a bit easier than Python as your blocks of code are cleanly defined in keywords like "if .. then .. end" instead of "if ... : -whitespace-". I'm not going to actively discourage someone from learning Python over Lua but saying that its better for a beginner is just ignorant.
copypasted shitty hacks :v:
By leeching help from other developers at Metastruct.
start from here [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7a06.html[/url] first complete the all Starter Tutorial from start to finish but with great attention to details progress slowly understand everything and the most importantly "practice" it theory without practice is useless you have to type the code examples again and again and even derive from example codes and create your own examples on particular subject. You have to repeat what you learn to yourself physically or mentally as soon as possible in order to apply information to your long term memory coding is all about long term memory processing. after buy this book [url]http://www.amazon.com/Programming-Lua-Roberto-Ierusalimschy/dp/859037985X/ref=sr_1_1?s=books&ie=UTF8&qid=1436465242&sr=1-1&keywords=lua[/url] don't read it from start to finish but try to practice example codes and derive your examples from them again and keep this book as your reference also i suggest this link also [url]http://lua-users.org/wiki/TutorialDirectory[/url] one of the best tutorials about lua on the net if you have enough patience complete this tutorial also very carefully after you have some knowledge about lua and you are trusting yourself [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index4875.html[/url] [url]http://wiki.garrysmod.com/page/Main_Page[/url] use old and new wiki examine things in them i know very good tutorials on youtube about lua you can also check out these [url]https://www.youtube.com/playlist?list=PLCFyE3cH3BEF_1Dxh6UiTSS7TwpXavZZO[/url] [url]https://www.youtube.com/watch?v=S4eNl1rA1Ns[/url] ( fast review of lua ) other sites [url]http://www.tutorialspoint.com/lua/index.htm[/url] also there is a very good paid lua tutorial [url]http://www.pluralsight.com/courses/beginning-lua[/url] 1 more book i have to mention is this [url]http://www.amazon.com/Beginning-Lua-Programming-Kurt-Jung/dp/0470069171/ref=sr_1_6?ie=UTF8&qid=1436465920&sr=8-6&keywords=lua[/url] but it's rather advanced compare to others also don't forget to use löve [url]http://www.amazon.com/L%C3%96VE-Game-Programming-Darmie-Akinlaja/dp/1782161600/ref=sr_1_10?ie=UTF8&qid=1436465920&sr=8-10&keywords=lua[/url] most important topics in new wiki [url]http://wiki.garrysmod.com/page/Object_Oriented_Lua[/url] [url]http://wiki.garrysmod.com/page/Metamethods[/url] [url]http://wiki.garrysmod.com/page/Hook_Library_Usage[/url] most important topics in old wiki [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index64f4.html[/url] [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index142b.html[/url] [url]https://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index43df.html[/url] if you having hard time with learning lua then i suggest try to learn python first but it doesn't necessary other important links [url]https://en.wikipedia.org/wiki/Lua_(programming_language)[/url] [url]http://www.lua.org/home.html[/url] [url]http://stackoverflow.com/[/url] and this forum :eng101: another very useful video [url]https://www.youtube.com/watch?v=iMacxZQMPXs[/url] and don't forget lua means moon in portuguese :smile:
[QUOTE=CharbelK;48140408]Hey Guys, Could you post how/where you learnt lua coding, i would love to learn but i dont know where to start and which is the best place to start. Thanks, CharbelK.[/QUOTE] Built a server while teaching myself LUA. I had never touched a piece of it until my friends asked me if I wanted to help them code and I said sure. I'm not the best at it but I can read and understand whats happening most of the time but I cant write it to save my life unless it's simple like SWEPs or pointshop or something along the lines
Sorry, you need to Log In to post a reply to this thread.