How to teach myself C++

halflifeguy

Newbie
Joined
Aug 8, 2004
Messages
893
Reaction score
0
I would love to know how to use the Source SDK, because I want to make movies like that one guy did with "A Few Good G-Men". I have fooled around with the SDK and i have figured a few things out but i will not fully understand it and be able to use it unless i know how to code and stuff like that. Is there someplace on the web that can teach you C++. I understand that this can be taken in college and doesnt seem like something to post on the internet as a "self-learn" coarse but im really getting into this stuff......
please help:bounce:
 
I don't think "A Few Good G-Men" actually used any code changes, to be honest.

Glad to see someone's taking interest in the finer points of modding, though. Coding's a rewarding path to take. My advice is to go down your local bookshop, and look for some books on things like "Learn C++ in a month" and the like. It's how I learned.

-Angry Lawyer
 
Yeah, you're better off with a book than trying to learn it from just websites and stuff.
 
ic.........
thanks men..........
will those books lead me to making movies such as that though?
 
Nope. You would have to use different variables and expressions and stuff. I don't really know about C++ but I do know PHp :p
 
The books are no good, they end up leaving you with some bad programming traits. If at all possible take a class or learn yourself through trial and error and looking at other's source code.
 
There are some CDs you can find, that have programs to teach to to code, etc. I should dig out my really really really old disc. Learn some kind of programming (Never said what kind it was). Though, it was simple and easy.
 
I'm actually very tempted to create a set of tutorials, based on the SDK, on teaching people the basics of C++. I.e. introducing variables, through fiddling with the health of an NPC, or something like that, and introducing Pointers through FIND_ENTITY_BY_CLASSNAME.

What do you guys think? Admitted, I won't be able to do it for some time (two mods to get working first), but I think it'll really help newcomers.

-Angry Lawyer
 
I'm interested. This would help beginners, and people, who are just new to editting HL2 with the SDK.
 
That would be really helpfull. That'd be good if you wouldn't put too much emphasis on C++ (explainings variables and stuff, there are good C++ books anyway), but explain the use of certain variables in the SDK and where to get some functions, like where to find usefull stuff, camera, player movements, weapons etc...
 
I'll consider writing one then. All I need is somewhere to host it.

-Angry Lawyer
 
I know all about variables and everything, but I'd rather have a tutorial that takes you through creating something from beginning to end. I learn by doing, not by trudging through the basics of the basics. As of right now I know all the basics, yet I've no idea how to apply them to actually create anything.
 
Can't forget the people who don't know about variables and everything. Perhaps 2 Part Tutorial, 1 part is about variables etc. Other part can help you create something from beginning to end.
You should be able to apply them to create something. Just be creative.
 
I can create something, but nothing with any use. "Lets display a list of numbers that stop when they get to 24, then displays the word MONKEYS! This will be really useful for the HL2 mod I'm working on!"
 
Angry Lawyer said:
I'll consider writing one then. All I need is somewhere to host it.

-Angry Lawyer
I own a domain and webspace which currently just has my blog and a few dead sites on it atm, so i can do that.
 
I'd love those, Angry Lawyer, especially tutorials on some basic things like compiling, simple file IO, and maybe explain a bit about the limitations :-D
 
I'm most likely to do something that covers the basics, and their application in the SDK, and then increase in difficulty with subsequent chapters.

The only problem is, finding time to do it.

-Angry Lawyer
 
Angry Lawyer,

I noticed that someone else offered you a spot for hosting, but I figure I may as well do the same. I own www.xombic.com and I would gladly set you up with your own domain name for the tutorials that you plan to write at a later time.

If you have any more questions please email me at: [email protected]
 
StardogChampion said:
I can create something, but nothing with any use. "Lets display a list of numbers that stop when they get to 24, then displays the word MONKEYS! This will be really useful for the HL2 mod I'm working on!"
:LOL:
Yeah... I guess so.
 
I can offer hosting as well.

Screw the NPC health stuff... Get to the pointer stuff! ;) That's the stuff I'm trying to learn right now (so this pointer points to a reference which references a pointer, which points to the Pope? did I get that right? Ugh, that's what it feels like to me at times...)

Anyways to original poster, that's probably using all FacePoser and more mapping than coding (though to be honest, I haven't watched the video.... I don't know how much it changes things)

Using Hammer you can script machinima (which is the fancy word for game-engine powered movies)
 
StardogChampion said:
I can create something, but nothing with any use. "Lets display a list of numbers that stop when they get to 24, then displays the word MONKEYS! This will be really useful for the HL2 mod I'm working on!"
Code:
#include <iostream>

int main()
{
      for (int a=1; a<=24; a++)
          std::cout << a << "\n";
      std::cout << "MONKEYS!";
return 0;
}
Sorry. :)


But I know how you feel. I am learning C++ from a couple of books, and they tell you what you can do, but not how to put it together into a useful program. Its annoying.
 
I recommend this book, it helped me learn pure C++ in a short space of time. Pure C++ isn't really that useful though, it just acts as a base for you to build upon. I recommend learning WinAPI also. However with the introduction of Longhorn quite a few things will change with regard to Windows API's.
 
I don't know about C++, but there are many excellent Java tutorials online. Try the sun/java website. www.java.sun.com Just a thought though, considering that in many colleges and university introductory computer science courses are taught in java
 
Zeus said:
http://www.seangreasley.com/

some great C++ video tutorials...also he has java...html and such
Great site, I like it better then the one I posted, though, he sounds a bit bored or something. I learned a lot more of the same thing by just listening to 1 5 minute video instead of reading about 10 paragraphs.
That, is an extremely minor problem, I'm just use to hearing people in video tutorials who are joking around at every corner, and are very exicted about doing a video tutorial. Just sounds different.
 
I haven't read the whole thread, but i'd suggest starting from PHP if you haven't dabbled in programming before.

PHP is a good and easy language to learn.

Oh and books are the best way to learn any sort of programming or markup.

I taught myself (x)html, CSS, MySql, PHP, and a bit of AS all through books.

And with books, it can be fun to learn a new language. I remember reading through the "php for dummies" book, I kept wanting to get off the book and try the stuff I learned.

Good luck :thumbs:
 
The vast majority of programs can be coded with only knowledge of C++ and the WinAPI.
 
Personally, my favourite language is Java, simple, elegant and beautiful. However I do most of my coding in C++, since it doesnt require a JVM and its faster.
 
JellyWorld said:
Personally, my favourite language is Java, simple, elegant and beautiful. However I do most of my coding in C++, since it doesnt require a JVM and its faster.

Eurgh, I hate Java in the same way I hate decaffinated coffee. It's C++ with all the good bits cut out!

-Angry Lawyer
 
This is what I did:

I started messing with the SDK code and I knew nothing about C++. I started with customizing the menu screen, playing with panels, finding tutorials...

Then, I went to Barnes and Noble, bought Sam's Teach Yourself C++ in 24 hours and I use it for reference. I actually didn't use a book until a few weeks into playing with the code.

But, I was very familiar with VB.NET coding so it's only syntax that I had to learn for C++. I am no expert at C++ but I created a Morrowind-style inventory system for Half-Life 2 (you can pickup any physics objects, with weight, and you can drop them [yes, they disappear from the map and reappear when you drop it]).

I am working in my spare time to create a Morrowind type mod... a full SP storyline and open world. Me and my friends are working on it... going well so far. I won't announce it because I don't want to get people's hopes up. It might as well be coming out in 2007. It's just for fun.
 
Tbh...coding in Source seems to be the least covered subject on the internet...even though coding is like the best part of making a mod unique...=/
 
subkamran why dont you make a short video showing your inventory system. that would be awesome.
 
ya...can u show us some screens of the inventory system..and sub I got that same book Teach yourself c++ in 24 hours...havent started reading it yet because i just got it and have been busy trying to install linux..
 
http://www.bloodshed.net/dev/devcpp.html <--- free compiler, works great!

the only thing you need to know is to add this function: system("PAUSE"); and this header: #include <iostream.h> in your programs, otherwise it'll flash the result of your program on your screen so fast that you won't even see it.
 
the only thing you need to know is to add this function: system("PAUSE"); and this header: #include <iostream.h> in your programs, otherwise it'll flash the result of your program on your screen so fast that you won't even see it.

Best not to suggest that, because that is a Windows only function.

I tend to use cin.get() for those simple things. :)
 
Back
Top