Developping question

I’ve been trying to learn different languages and as usual the same questions come to my mind.
“Where am I supposed to start ?” and “Which way to code it?”

I’m not talking about learning LUA, as I’ve been doing it for quite a long time. I’m talking about how to make it work by myself. I started making my own gamemode for garry’s mod and even if I know what I want to do, I am never able to think about the way to write/code it before I actually see a part of code from the wiki that helps me doing it.

I feel like an idiot asking this. Am I missing some programming logics that makes me unable to code by myself at some points ? Does it means I do have a lack of knowledge ?

Being a serious topic, do not answer this thread unless you’ve got a constructive (positive or negative) answer/idea to share. I need your experienced advices.

I wish you all a great evening and/or night.

Take a look at other developers addons and see there idea and how they did it… I’m sure this will give you the idea on how things are constructed! Also ask different questions here like “i’m trying to do this” “how would i ___?” ect.

I have never learned or even looked at a different scripting language then lua so i would not know where you are coming from…

Well the only languages I had less troubles with were web ones.
“I am trying to do this, how would I ?”

That is one good question I could ask myself while trying to code there! But I would probably encouter errors and ask myself if I’m doing something completly wrong there. I am so motivated for this. I just do not want to give up at all.
Thanks for your tip man.

I really appreciate those who will help me to figure this out !

Most things you want to do are driven by events. Consider WHEN you want something to happen, then consider how you can decide if it’s the right time. Look at the hooks and see if one fits.

I think you should break down what you want to do into smaller parts.

Making a gamemode is a pretty damn big task if you don’t know what you’re doing, so I’d recommend trying out smaller ideas (to do with the gamemode) first, then ask somewhere on the Developer Discussion if you get stuck with anything, and then eventually you’ll be able to finish the gamemode (hopefully).

You can find quite a bit of example gamemode code if you google it as well, so if you need a base for reference, you can always look for that.

Also, some people said before, hooks are pretty useful, and there are tons of them in the game.

Also, since GMod has about a billion addons in the workshop, if you can’t figure out what to do, you can usually find an addon with some related code in it to what you want to achieve.

One last thing- looking on the wiki for what you want can sometimes help, since most of the functions are named pretty much exactly what they do.

[editline]8th February 2016[/editline]

Actually, something much simpler than all that-

If you ever get stuck, ask on the Developer Discussion.

I used to get stuck all the time with functions and hooks and stuff since I had no clue how any of it worked, but I asked here (after trying to ask MaxOfS2D about 20 things), and then some people told me. This discussion is actually the best thing possible for help with GMod coding in my opinion, I wouldn’t be able to do anything really without it.

I’m in your same situation. I’ve been coding Lua for around 4 months and I usually have to look at some code prior to achieving certain things. I wouldn’t look at this as something negative, it just means you may need some more polish or knowledge in that certain area; so long as you’re learning and not blindly copy and pasting I see no harm. I also feel like I am not able to think for myself and feel like I lack general knowledge and I’ve never really been able to think about why either. I guess it all comes down to experience and others will learn at different paces and in different way to yourself so make sure you don’t compare yourself to others. I try to just keep coding and with experience eventually I’ll hopefully become more confident and fluent in code. My main issue is I spend too much time asking myself these questions you’re asking rather than just writing and getting on with it.

I hope you’ll find a way through this and feel better about your code and answer all these questions you have buzzing away, I know it sucks and it causes you to doubt yourself a lot.

I always feel like an idiot about this too so i’ve never publicly expressed this (until now)

TL;DR: I’m in your situation and it seems like the answer is: keep coding.