I have an interesting idea of modifying and existing gamemode and want to make it real in some way, though I don't have any experience with coding in lua or gamemodes in Garrys mod. Can anyone give me tips or hints, where to start best?
To help you orientate what my plan is about: The base is Trouble in Terrorist Town. Instead of the Traitors going to kill all Innocents straight away, everyone is being given a specific target to kill. Killing anyone else but the target results in a penalty.
Well, first you want to learn to code Lua by doing simple things and then you can move on to slightly harder stuff like what you mentioned in the OP.
Surely that is the way to go, but what do you think will I have to focus on specifically? Can you give me a slight direction?
Create your own basic gamemode. It help with understanding how a gamemode works. Use Gmod wiki, maurits and Facepunch to learn lua and get a network of coders on your friendlist
Modify DarkRP. Even if you hate it/think it's boring, it gives you a great start, it's very customizable, and there's a ton of documentation.
-snip-
-snip-
Well I guess overall, modifying stuff is much easier than I thought. Got my framework ready, just need a good idea for playerpunishment now.
[QUOTE=Mezzokoko;42454101]Well I guess overall, modifying stuff is much easier than I thought. Got my framework ready, just need a good idea for playerpunishment now.[/QUOTE]
Glad to see someone new who is actually willing to jump in and tinker with stuff until they get a basic understanding of it.
Here's the same advice I give everyone that asks the same question:
Here are some resources which may help you:
The Lua manual, this will definitely help you get started!
[url]http://www.lua.org/manual/5.1/manual.html[/url]
The New Garry's Mod Wiki, has a ton of information, how to use the function calls, how to integrate vgui elements, and more!
[url]http://wiki.garrysmod.com[/url]
Not everything is on the new Garry's Mod Wiki yet, if it's not there, it's here. There is a lot of things that has changed since Garry's Mod 12, to Garry's Mod 13. This is primarily for 12.
[url]http://maurits.tv/data/garrysmod/wik...index4875.html[/url]
A place to hire coders:
[url]http://www.coderhire.com[/url]
One of the best places to start, if by modifying TTT. Start by changing the sweps, more realistic fire-rates, balance the damage, add a feature which changes the cone based on if you're moving, firing from the hip, aiming down the sights, crouching, holding the walk button, etc etc. Start small, start by doing simple things and work your way up!
Thx for the links, there is some new stuff for me which Ill defininetely look into. Right now I am exploring the mysterious and fascinating world of lua-Errors. Guess Ill post a first draft here with github soon, so that others can hunt errors aswell.
edit: Is BadKingUrgrain around here a lot? I want to ask him if I can upload my modified stuff together with his original gamemode so that is easier for servers to install (instead of replacing individual files).
[QUOTE=Mezzokoko;42458450]
edit: Is BadKingUrgrain around here a lot? I want to ask him if I can upload my modified stuff together with his original gamemode so that is easier for servers to install (instead of replacing individual files).[/QUOTE]
I don't think it is advisable to edit stuff like TTT and Darkrp directly it means it becomes a pain to update the gamemoe when updates are released, you should just make an addon that changes what you need without changing the base directly if you can.
If you're modifying someone else's gamemode... I would start with asking them if its okay if you mod and/or publish the modded version of their gamemode.
[QUOTE=King Penisless;42462914]I don't think it is advisable to edit stuff like TTT and Darkrp directly it means it becomes a pain to update the gamemoe when updates are released, you should just make an addon that changes what you need without changing the base directly if you can.[/QUOTE]
Might be a good idea. In that case my question would be, how can I call a function from my addon from within a function in the init (Because thats where my main code kicks in)? Updating stuff with the gamemode directly should in my case not be much of a problem, because I just have to add my code to the end of the init, setup an init-point for my code and add a clientfile. Even though Ill try to work myself into creating addons, since that might be the smarter way to go.
[QUOTE=S31-Syntax;42462923]If you're modifying someone else's gamemode... I would start with asking them if its okay if you mod and/or publish the modded version of their gamemode.[/QUOTE]
That's kind of what I am trying to do at the moment, but he seems barely online.
[QUOTE=Mezzokoko;42463376]Might be a good idea. In that case my question would be, how can I call a function from my addon from within a function in the init (Because thats where my main code kicks in)?
That's kind of what I am trying to do at the moment, but he seems barely online.[/QUOTE]
PMing him on zombiemaster.org could do it. IDK if you even can PM on that forum but try it
[QUOTE=Mezzokoko;42463376]Might be a good idea. In that case my question would be, how can I call a function from my addon from within a function in the init (Because thats where my main code kicks in)?[/QUOTE]
Same as you would call any function, FunctionName( FunctionArgs )
[url]http://lua-users.org/wiki/FunctionCallTutorial[/url]
I also wouldn't worry about asking permissions. Plenty of server owners run modded/vanilla TTT servers and accept donations. This would just be another addon/modification.
If you had plans on completely rebranding & releasing the gamemode though, that's not going to happen even if you get in contact with the original creator.
[QUOTE=Cep.;42463396]Same as you would call any function, FunctionName( FunctionArgs )
[url]http://lua-users.org/wiki/FunctionCallTutorial[/url]
I also wouldn't worry about asking permissions. Plenty of server owners run modded/vanilla TTT servers and accept donations. This would just be another addon/modification.
If you had plans on completely rebranding & releasing the gamemode though, that's not going to happen even if you get in contact with the original creator.[/QUOTE]
I don't know how to make addons yet, so I guess Ill get my answer somewhere in the learning process. The reason why I would like to ask for permissions is, that I uploaded the whole gamemode together with my modified stuff, so I thought it would be a good idea to make sure everyone is ok with it before distributing.
edit: Just removed all original TTT-files from my github, guess it is the safer way to go.
[editline]9th October 2013[/editline]
Alright here is my code so far: [url]https://github.com/Mezzokoko/contracts[/url]
Has anyone the time and desire to go through my code and give me a few hints on what to do better? It is mostly not great code, because I had a lot of trouble with tables. But at the moment it is stable and runs fine. Only thing missing to completion is an award/punishment-system but Ill need a good idea for that.
Thanks to everyone here who helped me get past the first few steps, I finished my first version finally and that way faster than I would have ever expected :)
Sorry, you need to Log In to post a reply to this thread.