The 'QuakeC lessons' thread[prev. help with script teleport]

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by iCYsoldier » May 4th, 2011, 9:48 pm

Can we maybe start a new thread with a defined format? So multiple people can post their code and learn from each other.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by Drofder2004 » May 4th, 2011, 10:00 pm

My problem with this entire idea is that we are teaching coding to someone who has yet to learn the basics of coding.

The order of what needs to happen should NOT start with coding itself, it should be soemthing like:

- Learning to compile/run the code
- Learning to retrieve errors (developer & console)
- Learning the code syntax (semi-colons and parantheses usage)
- Learning other syntax (such as variable naming conventions and rules)
- Learning the important keywords

All of that is what I would say is important to learn BEFORE your first code is completed.

At the moment we are throwing exercises around, the problems are attempted, we then correct with explanations on how to do the exercise and then we move on... the same exercise should be repeated with small changes and completed succesfully before the next idea is started.

As 'teachers' we are all out of our depth, and as such we are putting those learning out of their depths.

I would be willing to do a bigger, better "Scripting for dummies" thread with more info, but the amount of people willing to read and learn from it, would be few.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

BeZZo
CJ Worshipper
CJ Worshipper
Posts: 495
Joined: June 25th, 2010, 11:23 pm
Location: Croatia

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by BeZZo » May 5th, 2011, 12:21 am

iCYsoldier wrote:Can we maybe start a new thread with a defined format? So multiple people can post their code and learn from each other.
That.
On a side note, I tried to "solve" a couple of these exercises, and like Ryan I realized that i have completely no idea what of i'm doing :(

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by Drofder2004 » May 5th, 2011, 1:14 am

BeZZo wrote:
iCYsoldier wrote:Can we maybe start a new thread with a defined format? So multiple people can post their code and learn from each other.
That.
On a side note, I tried to "solve" a couple of these exercises, and like Ryan I realized that i have completely no idea what of i'm doing :(
See previous post.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by megazor » May 5th, 2011, 4:10 am

I think it would be good if experienced scripters like drofder, rezil, iznogod described how they were learning coding. This might help ryan and other people who want to code well.

I will be first :-)

So,
I started from CoD Radiant. When i opened it for the first time (summer 2009), it seemed so difficult... I then tried to map, but failed at that and removed Radiant. In a few weeks I reinstalled it, read some tutorials more carefully than I did before, put a few questions to mappers I had on Xfire - and I finally managed to create my first map. But then I wanted to add some moving things to my map. This was when I faced coding the first time. Taking finished code from modsonline.com, my first script was "made". Just after that, I started learning how to code. I was pretty often asking coders, but my main method of study was simple reading finished scripts, which CoD was full of (and so were custom maps). bit by bit, I was improving my coding.

Thereby I think we should keep leaving code here.

User avatar
iCYsoldier
CJ Worshipper
CJ Worshipper
Posts: 289
Joined: December 5th, 2009, 7:12 am
Location: Australia

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by iCYsoldier » May 5th, 2011, 6:53 am

One thing I'd like to know is, how many of you have programming experience with other, more common languages? I personally, have been using Java for 1-2 years, making it easier to move onto QuakeC. All the exercises above, I managed to do quite easily, but there are still differences between the language I know and this one, which I'm hoping to learn from a thread like this.

Ryan
CJ Newbie
CJ Newbie
Posts: 64
Joined: March 2nd, 2008, 1:18 am
Location: Germany

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by Ryan » May 5th, 2011, 2:57 pm

i'd like to learn it as quickly as possible but only related to CoD1 so teleports and these sorts of things...

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by Drofder2004 » May 5th, 2011, 6:54 pm

I started Coding using VBA (Excel & Access) for projects and then moved to VB6.
From VB6 to C/C++ and CoDScript. Have also dabbled with Python, VB.net, Javascript, CSS, HTML, and a few other little things.

Most code was originally learned through mapping (moving objects).
I then moved to making mini-mods (nothing serious). I then moved on to helping and eventually taking over the CoDJumper Mod.

Most valuable source of information = IWNation and the members there (before it became politics).
ModsOnline.com held a lot of basic information.
Asking many questions and getting involved in scripting topics.
Ryan wrote:i'd like to learn it as quickly as possible but only related to CoD1 so teleports and these sorts of things...
Possible is the keyword. Learning quickly is possible, but you must still start from the bottom.
You could simply copy what we type and try and remember it (school style learning) or you can take your time and learn it properly (by understanding).

When you learn without understanding, you end up forgetting what you learn just as quick.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by waywaaaard » May 6th, 2011, 3:02 pm

Some VB6 to Java, C, C++ and lately a lot of C# and .net environment, also some ASM, VHDL and some languagess for SPS-Programming. Helps quiet a to understand the most of the stuff :)
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Ryan
CJ Newbie
CJ Newbie
Posts: 64
Joined: March 2nd, 2008, 1:18 am
Location: Germany

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by Ryan » May 6th, 2011, 4:57 pm

how do you use scripts at all... if i put them into a pk3 file where there are other scripts, how do i execute my custom one there?

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: The 'QuakeC lessons' thread[prev. help with script telep

Post by Rezil » May 6th, 2011, 5:04 pm

If you're a mapper, you could make a small testing map and save your code as mapname.gsc, which executes when a map loads.
If you only mod, you have to link it to an existing gametype/map script. Save it as whatever.gsc, then add this line somewhere:

Code: Select all

*path in pk3*\*gsc name*::*function to execute*;
For example:

Code: Select all

maps\mp\_load::main();
will call the .gsc load from pk3\maps\mp\ and execute the function main().
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests