Login to ZARP
Username: Password: Remember me

TOPIC: Interested in starting Lua/GLua

Interested in starting Lua/GLua 6 years 4 months ago #780920

So I've been having quite a lot of spare time in my hands recently and I feel like I've been wanting to develop a skill for Lua coding in Garry's Mod for quite some time, I don't really know where to start off so if anyone with any good knowledge could help me out a lil bit with how I can start off (Even linking me guides that are useful), I would really appreciate it :)

I've coded in HTML and Python before as it is easy to learn so I do have past experiences with coding with out languages before.
  • Clarky
  • Clarky's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP Gold Badge
  • I love Henny
  • Posts: 16702
  • Thanks received: 9536
  • Karma: 1000
Login or register to post a reply.

Interested in starting Lua/GLua 6 years 4 months ago #780938

Really depends on your past experience with other coding languages. Its much easier to learn LUA if you have experience with something like C#. I dont know about Phyton though but im sure there are similarities and shortcuts. I havent spent much time learning LUA but I learned a small bit by reading / checking other people's SWEPs LUA. M9K LUA code is really helpful, There are explanations of most lines and what they do. It really helps to get a better understanding of what does what.
Login or register to post a reply.

Interested in starting Lua/GLua 6 years 4 months ago #780941

Mobile Task Force Gunner wrote:
Really depends on your past experience with other coding languages. Its much easier to learn LUA if you have experience with something like C#. I dont know about Phyton though but im sure there are similarities and shortcuts. I havent spent much time learning LUA but I learned a small bit by reading / checking other people's SWEPs LUA. M9K LUA code is really helpful, There are explanations of most lines and what they do. It really helps to get a better understanding of what does what.
When me and DEADMONSTOR were both working on Jailbreak together, I kinda got the idea which so then my interest in glua came up and was looking into where to start off (which I had no idea how I can start off) so here I am just tryna find some help since there are quite a few coders who know quite a bit about lua coding.
  • Clarky
  • Clarky's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP Gold Badge
  • I love Henny
  • Posts: 16702
  • Thanks received: 9536
  • Karma: 1000
Login or register to post a reply.

Interested in starting Lua/GLua 6 years 4 months ago #780962

what a nerd
  • MsMs
  • MsMs's Avatar
  • Offline
  • Gold Boarder
  • ZARP VIP
  • hey there I'm MsMs
  • Posts: 2403
  • Thanks received: 1209
  • Karma: -23
Nothing
Login or register to post a reply.

Interested in starting Lua/GLua 6 years 4 months ago #780964

MsMs wrote:
what a nerd
I bet you kiss girls, faggot!
  • Clarky
  • Clarky's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP Gold Badge
  • I love Henny
  • Posts: 16702
  • Thanks received: 9536
  • Karma: 1000
Login or register to post a reply.
The following user(s) said Thank You: MsMs

Interested in starting Lua/GLua 6 years 4 months ago #781012

wiki.garrysmod.com/page/Main_Page

Everything you need and more feel free to ask me questions. One thing I would says is I see a lot of people try and learn lua but they never end up following good practices when it comes to nameing variables, networking and the general formating of their code.

I would recommend reading through things such as darkrp and looking at how falco does things.
  • _Max
  • _Max's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP
  • Sup
  • Posts: 2666
  • Thanks received: 1002
  • Karma: 15
Login or register to post a reply.
The following user(s) said Thank You: Clarky

Interested in starting Lua/GLua 6 years 4 months ago #781022

_Max wrote:
wiki.garrysmod.com/page/Main_Page

Everything you need and more feel free to ask me questions. One thing I would says is I see a lot of people try and learn lua but they never end up following good practices when it comes to nameing variables, networking and the general formating of their code.

I would recommend reading through things such as darkrp and looking at how falco does things.
Naming variables is pretty simple and easy, haven't really seen the networking part at the moment.
Warning: Spoiler! [ Click to expand ]


and yeah I've seen how Falco does some things, alongside with how coding should be formatted which looks cleaner than it just being a huge mess.
  • Clarky
  • Clarky's Avatar
  • Offline
  • Former Community Manager
  • ZARP VIP Gold Badge
  • I love Henny
  • Posts: 16702
  • Thanks received: 9536
  • Karma: 1000
Login or register to post a reply.

Interested in starting Lua/GLua 6 years 4 months ago #781058

Code Blue does some really good videos. Lua is a great language to start off with even though it's mostly a scripting language.

Also when it comes to naming variables there's more to it than calling stuff test. It needs to be easy recognizable and easy to configure in the future. There's a few thumbrules you wanna stick to for example capping every word excluding the first one eg;

int myInt = 5;
string thisIsAString = "";


char mycharveriguud = ' ';

as you see the green ones are much easier to read compared to the red one

there are also stuff you can do when passing in variables into parameters such as

Warning: Spoiler! [ Click to expand ]


using underscore which allows me to see that it's the same variable but still having different names.
  • catboy sven ツ
  • catboy sven ツ's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Respected Zarp Contributor
  • Posts: 7193
  • Thanks received: 1544
  • Karma: -45
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)








Last Edit: 6 years 4 months ago by catboy sven ツ.
Login or register to post a reply.
The following user(s) said Thank You: Clarky
Time to create page: 0.101 seconds

128 PLAYERS ONLINE

Connect to server View Gametracker DarkRP 1
7/127
online
Connect to server View Gametracker Deathrun
0/40
online
Connect to server View Gametracker TTT
0/47
online
Connect to server View Gametracker Bhop
1/32
online
Connect to server View Gametracker Surf
0/32
online
Connect to server View Gametracker Prop Hunt
0/42
online
Connect to server View Gametracker Sandbox
0/42
online
Connect to server Discord
120/787
online
Top