• What would be a good beginner's project for GMOD Lua?
    30 replies, posted
I'm relatively new to Lua. I already know the syntax and the basics, of course, but overall I have no idea how to get it to work with Gmod. I have already used SourcePawn a lot plus C, C++, and C#, too. I also script in Expression 2 a lot, although I don't think that really matters. I was wondering, what would be a good way to start off? It's really hard to do anything if you aren't used to working with Garry's Mod and Lua combined. Something that is simple, yet not overwhelmingly simple. It doesn't have to be anything new, just something that can help a beginner establish a firm start.
I saw you on GMT earlier, so I'll still point out some examples of things to try: 1. A chatbox? 2. A basic admin mod 3. A swep, something that you think would be cool. 4. A SENT that does something funny? I dunno, I just think you need to start where you feel there needs to be improvement or addition. Remember all those random things you've downloaded and thought, "hey, cool! I can do this!" only to find out that you get tons of lua errors? Go fix it :)
Its actually in the reverse order!
Try takeing a look around the request section and see if anything catches your eye
[QUOTE=nicatronTg;19714577] 1. A chatbox?[/QUOTE] A chatbox is the worst possible thing you could start with.
[QUOTE=nicatronTg;19714577] 2. A basic admin mod [/QUOTE] And there's already more admin mods in the world than you'd ever need.
[QUOTE=tw1tchy;19751136]And there's already more admin mods in the world than you'd ever need.[/QUOTE] Doesn't mean it can't be good to get more Lua experience.
[QUOTE=MegaJohnny;19751557]Doesn't mean it can't be good to get more Lua experience.[/QUOTE] I didn't know much serverside stuff until I made my admin mod :D It's good practice
I think my first non-5-minute Lua project was my personal admin mod. It doesn't have a particularly fancy interface or anything, but it was good to learn server-client architecture and all that. It's also nice having a personal admin mod that you can add to really easily to let you control bots or keep play-testers for other projects under control without bogging things down with a full-blown public admin mod.
A Basic chatbox isn't that hard to start with if you know some basic GUI, maths and client-server-server-client stuff, It's when you try to add fancy markup parsers to it is when it gets difficult for beginners.
Read up on how to make a simple gamemode. Thats how I got started. I ended up learning so much in the process of making a gamemode (That I never finished because it blew) that I realized it'd be better to abandon it and work on something else So in short, a gamemode.
A basic admin mod could be useful if you are coding your own gamemode, because you want your gamemode to have something unique about it, especially a chatbox. So really all things pointed out in the list is essential if you want to create a gamemode.
A name changer can touch on a lot of basic things in lua such as tables, strings, math and other stuff.
[QUOTE=slayer3032;19758358]A name changer can touch on a lot of basic things in lua such as tables, strings, math and other stuff.[/QUOTE] That was exactly the first thing I coded without an extortionate amount of help. Was a good day :wink:
Start with SWEPs, advance on with SENTs/small scripts (I would recommend small scripts first, that's where you learn how to use metatables/etc.). When you're confident about your scripting skills, try making a gamemode.
As a great man once said "Hat"
[QUOTE=LEETNOOB;19763606]Start with SWEPs, advance on with SENTs/small scripts (I would recommend small scripts first, that's where you learn how to use metatables/etc.). When you're confident about your scripting skills, try making a gamemode.[/QUOTE] SWEPS are not a good thing to start with
[QUOTE=*Fish*;19779752]SWEPS are not a good thing to start with[/QUOTE] Agreed - SOMEHOW I managed to crash G-Mod... Maybe I'm a terrible Lua coder or *something else* was responsible...
Have a check of the videos i have posted that i made in this forum. That should be easy enough.
[QUOTE=slayer3032;19758358]A name changer can touch on a lot of basic things in lua such as tables, strings, math and other stuff.[/QUOTE] Thats true, lua hacks are really good to start learning lua. like esps, aimbots, name changers
[QUOTE=*Fish*;19779752]SWEPS are not a good thing to start with[/QUOTE] Really? I learned how to use metatables mostly when scripting SWEPs.
It really annoys me when people call them lua "hacks". They are not "hacks", they don't "hack" anything.
Yeh a hack is when you get somewhere you shouldn't and do stuff to things that are already there. Your just making exploitational programs.
They're just pretty shitty exploits that can be blocked far too easily (As long as the creator of it didn't go and create their own Lua environment for it ( BBV3))
An unlock system for tools. The longer you've been on a server the more points you have which you can then spend on unlocking tools. Check out the [b][url=wiki.garrysmod.com/?title=Gamemode.CanTool]Gamemode.CanTool [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]hook, use it to disable a tool if it hasn't been unlocked for that player. This teaches you how to use gamemode hooks. To pick a tool to unlock you'll need a console command. Make this work before you try an interface. You'll probably want a menu for picking a tool to unlock eventually. There's interface design. Ideally you'll want it to save unlocks and points as well. There's saving data to a file and loading on startup. This non-trivial project would be interesting enough to release to the public and should give you experience in a few important areas of Garrysmod modding.
I would like to see something that is completely different from everything else, but not too incredibly complex. I'm working on something like that right now :v:
After 5 hours of intense scripting and debuging, I managed to create a stone that changes objects material to xencrystal_sheet when touched... :v: with the original idea of Philosophers stone (piece of shit that makes inexpencive metals (like lead) become gold)
For learning, I started with simple SWEPs and SENTs. Then I tinkered with gamemodes for a bit and worked on some random autorun scripts. After honing those skills, I moved onto actual gamemodes.
How about a basic gamemode? Humblesnurp has a great gamemode lua tut for begginers (I would know that's what I'm making)
Hey man try making a Message of the Day script, that's what I first started with. Good luck!
Sorry, you need to Log In to post a reply to this thread.