Ok, I think I'm am going to start learning Lua and I have TONS of questions and problems. I'm going to name all of them of and please please please help me get them all answered. Here they are:
1. Where do you learn GMod Lua?(Prefer one site that gives a complete tutorial, and I took tutorials everywhere but it never explains how to make all sorts of types of addons)
2. What program do you use to model?
3. How do you put the model into the script?
4. Is there a list or something that I can get all of the GMod terms? (like in scripts I see ( ply ) which means player and it never says that on the lua.org tutorials)
5. How do I make a gamemode? (something simple like you kill someone and you get $10 to upgrade your speed, or buy a new weapon)
6. If you are a master Lua person, what websites, resources, and anything else you used to learn Lua.
7. About how long does it take to become a really good scripter that if someone requests something then you could just go do it?
8. How do you make an HUD, or a GUI?
So basically I just want a COMPLETE tutorial on how to script anything, model stuff and insert that into script, make gamemodes on request, and make a map that relates to a gamemode like some RP maps work with the gamemode, and just how to create maps.
[LIST=1]
[*][URL="http://wiki.garrysmod.com/?title=Lua"][B]Here[/B][/URL]
[*]Modelling != Lua, I wouldn't know
[*] [b][url=http://wiki.garrysmod.com/?title=Entity.SetModel]Entity.SetModel [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] and by putting it into the models/ folder
[*]Check out the pages mentioned in 1). Also, it looks like you do not have much experience in programming in general. Make sure you follow those tutorials.
[*][B][URL="http://wiki.garrysmod.com/?title=Simple_Gamemode"]This[/URL][/B]
[*]1)
[*]It took me 3 months to where I am now, but I have had 10 years of programming experience.
[*][B][URL="http://wiki.garrysmod.com/?title=Simple_Hud"]This[/URL]
[/B]
[/LIST]
What does that mean?
You will have to ask more specific questions, or else I won't be able to help you.
About 8, VGUI and HUD are quite different to make. For a VGUI, you might want to consult [URL="http://wiki.garrysmod.com/?title=Guide_to_Derma"]this[/URL] article, which documents a number of components, including pictures and code examples.
For modelling, you can use 3DS Max, or MilkShape.
And as for becoming good with lua, it depends on how much time you dedicate to scripting in lua, and how much you try to push yourself to do imaginative things.
For compiling code and writing your scripts, I suggest you get Notepad++ with the Garrysmod lua plugin. It helps out a lot to show you where functions/loops/strings/parenthesis/brackets/etc. are ending, as well as puts garrysmod functions in different colors. It also colors constants such as HITGROUP_HEAD that are predefined by garrysmod.
How do I put the GMod addon into notepad ++ where do i save it?
Follow the installation instructions for it here:
[url]http://code.google.com/p/npp-gmod-lua/wiki/HowTos[/url]
[QUOTE=SeveredSkull;24185908]For compiling code[/QUOTE]
To prevent confusion, [b]Lua is not a compiled language in a traditional way. It acts like an interpreter, but is infact almost a compiler.[/b]
More specifically, code is "compiled" into bytecode, which is then interpreted.
Ok, well I went throught the first part of the tutorial series and it didn't help much, It moves onto gamemode but I want to learn how to make addons right now. Are there any Lua masters here? If there are where did you learn?
I [U][I][B]STRONGLY[/B][/I][/U] suggest you follow the gamemode tutorial.
In order to make addons, you really should learn about gamemodes, because you will be using those functions often for just about anything. Take a look at all the hooks while you are at it.
[editline]11:56AM[/editline]
I dont think anyone here currently is a "Master", but I am fairly advanced, and I know FlapJack and MegaJohnny have reputations to be a very skilled Lua coders. So I think between all of us, we can handle helping you out.
Following tutorials will only take you so far. What you need to do is start writing small little things. Look things up on the wiki to find out what functions will do what you need.
[QUOTE=|FlapJack|;24189084]Following tutorials will only take you so far. What you need to do is start writing small little things. Look things up on the wiki to find out what functions will do what you need.[/QUOTE]
Agreed. You can also look at code from other creations and see how they did certain things. Thats exactly how I learned Lua... Rip apart peoples codes and figure out all the methods to do things. Then once I was familiar with the syntaxes and functions, I was able to start creating my own creations instead of modifying pre-existing code to fit my needs.
If you want to make an addon, make a simple, small one, such as one which allows you to change your speed via a derma menu, really simple stuff like that.
Alright so I'm done being forced to do stuff and now it's all free practice. Sounds pretty fun.
Mate... you weren't FORCED to do anything. You dont have to take any of our advice if you dont want to.
I don't mean it like that. I mean with the tutorials they like tell you what to do and it wasn't really that fun but now I'm editing mods and they are getting cooler. Any ideas of some simple addons I could create?
Ok. heres a challenge for you. Its already been done, so dont release it please. Make a weapon that shoots a prop instead of a bullet.
If you need help Go to the wiki page: [url]http://wiki.garrysmod.com/?title=Chair_Throwing_SWEP[/url]
BUT ONLY IF YOURE STUCK.
[editline]01:33PM[/editline]
Also does anyone know how to do the spoilers? I dont know the code for it.
[QUOTE=Jordan589;24190847]I don't mean it like that. I mean with the tutorials they like tell you what to do and it wasn't really that fun but now I'm editing mods and they are getting cooler. Any ideas of some simple addons I could create?[/QUOTE]
My first script was a basic chat cryptography script. Basically, a little DFrame with a DTextEntry and a DButton, that took a string from the user, and encoded it with a ROT-esque thing I wrote, and then used RunConsoleCommand to say it. It also had a little chat hook (OnPlayerChat) that decrypted the chat.
Obviously, because I was new to Lua it only half-functioned, and would decrypt any text regardless of whether or not it was encoded by my script.
[QUOTE=SeveredSkull;24191561]Also does anyone know how to do the spoilers? I dont know the code for it.[/QUOTE]
[noparse][sp]STUFF[/sp][/noparse]
[sp]STUFF[/sp]
[QUOTE=|FlapJack|;24191662]My first script was a basic chat cryptography script. Basically, a little DFrame with a DTextEntry and a DButton, that took a string from the user, and encoded it with a ROT-esque thing I wrote, and then used RunConsoleCommand to say it. It also had a little chat hook (OnPlayerChat) that decrypted the chat.
Obviously, because I was new to Lua it only half-functioned, and would decrypt any text regardless of whether or not it was encoded by my script.
[noparse][sp]STUFF[/sp][/noparse]
[sp]STUFF[/sp][/QUOTE]
Completely useless... yet so awesome! :razz:
[editline]01:41PM[/editline]
Awesome. thanks for the code :D
Follow the link [URL="http://www.facepunch.com/showthread.php?t=542906"]here[/URL] to learn how to model, It will take awhile to learn how to model but it is worth it in the end :)
[QUOTE=SeveredSkull;24191561]
Ok. heres a challenge for you. Its already been done, so dont release it please. Make a weapon that shoots a prop instead of a bullet.
If you need help Go to the wiki page: [url]http://wiki.garrysmod.com/?title=Chair_Throwing_SWEP[/url]
BUT ONLY IF YOURE STUCK.
Edited:
Also does anyone know how to do the spoilers? I dont know the code for it.
[/QUOTE]
I have no clue how to create weapons but I am getting the hang of gamemodes a tiny bit and i am basically really good with Derma now.
[QUOTE=Jazora;24192016]
Follow the link here to learn how to model, It will take awhile to learn how to model but it is worth it in the end :)
[/QUOTE] That helps for making ragdolls, but what about weapons with constantly changing colors or parts. Or vehicles with spinning wheels and like toggable lights
Alright so right now I'm getting the hang of Derma, made a couple of GUI's and now I'm moving on to creating a gamemode for my Derma Panels. Would anybody be able to help me create a script so when someone kills someone $10 is added to their money supply. And I am also having problems with getting variables from different files and using them in the same file. Might sound kind of confusing so let me clarify it:
I will have a money variable and when someone is killed to add that amount of money to their account but the money variable is in a different file and i get an error that the variable doesn't exist.
--------------------------------------------------------------------------
One more thing: How do you know what to put in cl_init, init, and shared?
[QUOTE=Jordan589;24197296]That helps for making ragdolls, but what about weapons with constantly changing colors or parts. Or vehicles with spinning wheels and like toggable lights
[/QUOTE]
Constantly changing colors or parts, I think your talking about Hacking/Reskining, That tutorial I showed you should show you how to do that. For vehicles wheels you really need to start off with the more basic stuff in order to move onto features like that and for toggable lights that can be done by lua. Hope that helps.
[QUOTE=Jazora;24197612]Constantly changing colors or parts, I think your talking about Hacking/Reskining, That tutorial I showed you should show you how to do that. For vehicles wheels you really need to start off with the more basic stuff in order to move onto features like that and for toggable lights that can be done by lua. Hope that helps.[/QUOTE]
Yeah I havent heard of any viewmodel that is constantly changing... except for the system that I am developing at the moment :3
[QUOTE=Jordan589;24197296]IAlright so right now I'm getting the hang of Derma, made a couple of GUI's and now I'm moving on to creating a gamemode for my Derma Panels. Would anybody be able to help me create a script so when someone kills someone $10 is added to their money supply. And I am also having problems with getting variables from different files and using them in the same file. Might sound kind of confusing so let me clarify it:
I will have a money variable and when someone is killed to add that amount of money to their account but the money variable is in a different file and i get an error that the variable doesn't exist.
--------------------------------------------------------------------------
One more thing: How do you know what to put in cl_init, init, and shared?[/QUOTE]
Dude if you have the hang of Derma... props to you. I think it is the biggest pain in the ass. As for your money system... Heres a hint. Hooks! A specific hook called [B][URL="http://wiki.garrysmod.com/?title=Gamemode.PlayerDeath"]Gamemode.PlayerDeath [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL][/B] would be what you need to acomplish this.
[editline]08:37PM[/editline]
Missed the last part. "Cl_" is the prefix for Client. So anything that is meant to run Clientside only should go in there. Init.lua holds all server functions, and shared holds functions/variables that are needed by both the client and server.
For modeling, you would most likely use 3ds max, but if you can't afford it either use blender or softimage xsi 7.5 (search for it, the developer doesn't make it anymore, that's the last version before autodesk bought it)
I have learned most of my scripting skills from the gmod wiki, and reading peoples help topics/answers here on facepunch.
Tutorial links:
Gamemode:
[url]http://wiki.garrysmod.com/?title=Simple_Gamemode[/url]
Entity:
[url]http://wiki.garrysmod.com/?title=Jumping_Bathtub[/url]
STOOL:
[url]http://wiki.garrysmod.com/?title=Basic_STOOL[/url]
List of basic lua tutorials:
[url]http://wiki.garrysmod.com/?title=Lua_Tutorial_Series[/url]
[QUOTE=c0baltha1l;24201414]I have learned most of my scripting skills from the gmod wiki, and reading peoples help topics/answers here on facepunch.
[/QUOTE]
Yes, Yes, Yes. Facepunch is always a good solution for basic help that doesnt involve too much work. For more complicated things like asking people to design a whole new gamemode FOR you, I doubt you would get a response.
Also, dont get offended if someone is a real ass. Half the community here act like complete assholes. Most of the time they just belittle you for your lack of knowledge in the subject, but everyone has to start somewhere... even them at some point back in time.
[QUOTE=c0baltha1l;24201414]For modeling, you would most likely use 3ds max, but if you can't afford it either use blender or softimage xsi 7.5 (search for it, the developer doesn't make it anymore, that's the last version before autodesk bought it)[/QUOTE]
Also another one to the list, Milkshape 3D its free and used for low poly stuff, It works great with the Half Life 2 models.
(Offtopic)
Wow. I love how he already got banned.
Ontopic.
Agree. but dont you have to get plugins to convert them? Or am I thinking of a different program?
[QUOTE=SeveredSkull;24212404](Offtopic)
Wow. I love how he already got banned.
Ontopic.
Agree. but dont you have to get plugins to convert them? Or am I thinking of a different program?[/QUOTE]
Wow just saw that aswell lol With Milkshape it already has the plugins/dlls to use .smd's but it was built for Half Life Smd's but doesn't really make a difference if your doing only basic models.
Sorry, you need to Log In to post a reply to this thread.