Author Topic: How did you learn coding?  (Read 3673 times)


What was the point in you even posting?

Tri

I learned by looking at scripts and finding out what certain things do.  I used the TorqueScript appendix to learn new functions.

Looking at guides feels useless to me, too slow and too long.

I don't remember where I first scripted, but I know that I started when I first decided to move to TBM. I'd look over their scripts and put it sections together so I'd have my own scripts.

I actually think I remember when I first got into scripting. Staff leaders of the mod told me how to change crap to make simple chat scripts like a /me, so I started making tons of crappy things like that. Soon I was making crappy scripts that are not needed and abusive, but could still be considered "fun" by some. I tried putting them into GUI's, but without clients having them, it made them useless.

Actually, it sorta looked like Fooly Cooly's "crap" as it'd be called... o.o

(I could have done my first all the way back in AiO, but I remember starting in TBM)

To me, it's fun going into a lua file for garrysmod and trying to figure out what everything means. It's like a puzzle!

In my mind, if I see the code:
Code: [Select]
for(%i=0;%i<clientgroup.getcount();%i++) {
clientgroup.getobject(%i).player.kill();
}
I see:
Code: [Select]
%i is 0, while %i is less than the full clientcount continue, each cycle add 1 to %i.
Kill client in place of object by number.

Of course, it's much less then all that, but to say it exactly as my mind puts it would be confusing to you...

Code: [Select]
%i equals 0. %i less than count. add 1 %1
kill all

Lol

Lol.  I still need a translator for the second one :o
Lol.

So far I've learned the most from asking questons. I just need a teacher, I learn more from being taught more than anything.

It's a queston. So it does in fact say it all. I'm just seeing what some of the coders did to learn. T.T

You don't get the joke.

In my mind, if I see the code:
Code: [Select]
for(%i=0;%i<clientgroup.getcount();%i++) {
clientgroup.getobject(%i).player.kill();
}
I see:
Code: [Select]
%i is 0, while %i is less than the full clientcount continue, each cycle add 1 to %i.
Kill client in place of object by number.

Of course, it's much less then all that, but to say it exactly as my mind puts it would be confusing to you...

Code: [Select]
%i equals 0. %i less than count. add 1 %1
kill all

Lol
you read it like english too? God me, nixill you. Who else can read it like reading a book?

I can but some things like %i makes me go wat. I am guessing percentage sign means variable. But ++ just makes me guess +1. But I wouldn't know that.

Other than those, I can basically read it normally. I find that LUA is easier to read.

Other than those, I can basically read it normally. I find that LUA is easier to read.
LUA example please...I've never needed to look at it so I don't know what it's like.

In my mind, if I see the code:
Code: [Select]
for(%i=0;%i<clientgroup.getcount();%i++) {
clientgroup.getobject(%i).player.kill();
}
I see:
Code: [Select]
%i is 0, while %i is less than the full clientcount continue, each cycle add 1 to %i.
Kill client in place of object by number.

Oh I think I get it now.

clientGroup is the group of active clients (players on the server) right? So the code picks through all of them, assigning a Kill command to each of them in the process. Then when the script hits the point where it has Killed all the clients once (when %i becomes equal to the number of players, i.e. clientGroup.getCount() ) the script Stops looping and actually kills everyone at the same time.

Did I get it right? Damn this stuff is tough. I'm still learning the basics but atleast now I'm almost to the point of being able to modify simple scripts.

Here's the weight sTool for Gmod that allows you to change prop's weight.
http://www.nopaste.org/p/azxsv7B4K

In my mind, if I see the code:
Code: [Select]
for(%i=0;%i<clientgroup.getcount();%i++) {
clientgroup.getobject(%i).player.kill();
}
I see:
Code: [Select]
%i is 0, while %i is less than the full clientcount continue, each cycle add 1 to %i.
Kill client in place of object by number.

Oh I think I get it now.

clientGroup is the group of active clients (players on the server) right? So the code picks through all of them, assigning a Kill command to each of them in the process. Then when the script hits the point where it has Killed all the clients once (when %i becomes equal to the number of players, i.e. clientGroup.getCount() ) the script Stops looping and actually kills everyone at the same time.

Did I get it right? Damn this stuff is tough. I'm still learning the basics but atleast now I'm almost to the point of being able to modify simple scripts.
Commands don't wait, you tell it to do a command and it does it. Schedule could be an exception if you weren't starting the countdown with it.