Raised This Month: $32 Target: $400
 8% 

Learning C++ for Coding Extentions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-20-2013 , 19:05   Learning C++ for Coding Extentions
Reply With Quote #1

I know the wiki has really good info that is focused on the extensions however.. For those of us like me that have absolutely no background in anything but pawn/sourcepawn where would you recommend starting?

http://ocw.mit.edu/courses/electrica...uary-iap-2011/

This is one place I have found and have saved the lecture notes+lab/assignments to begin reading through them and checking it out... however This is just an intro.

I also have a C++ book for dummies which i will eventually finish looking through haha...

Any where else you guys think would help?

I wont be taking any programming classes until I'm in my Bachelors program. The Associates program covers basic network administration and what not..

Again thanks for help.

EDIT: Places linked to on the MIT Page.
http://cplusplus.com/doc/tutorial/
http://en.wikiversity.org/wiki/Introduction_to_C++
http://cplus.about.com/od/learning1/...rams_in_It.htm

Last edited by Doc-Holiday; 04-20-2013 at 19:25.
Doc-Holiday is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-21-2013 , 22:13   Re: Learning C++ for Coding Extentions
Reply With Quote #2

C before c++ imo, too bad extensions are cpp :/
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 04-21-2013 at 22:14.
friagram is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-22-2013 , 00:51   Re: Re: Learning C++ for Coding Extentions
Reply With Quote #3

Quote:
Originally Posted by friagram View Post
C before c++ imo, too bad extensions are cpp :/
From many sources they say that learning C first will cause you to have to unlearn some when writing proper C++
Doc-Holiday is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-22-2013 , 04:09   Re: Learning C++ for Coding Extentions
Reply With Quote #4

Quote:
Originally Posted by Doc-Holiday View Post
From many sources they say that learning C first will cause you to have to unlearn some when writing proper C++
Indeed, learning C first is completely counter-productive. However, the Source Engine is very C-like (and a complete mess), and doesn't make a good getting-into-C++ project.

Disclaimer: My first C++ experience was writing TF2Items, a SourceMod extension.
__________________
asherkin is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-22-2013 , 04:44   Re: Learning C++ for Coding Extentions
Reply With Quote #5

Quote:
Originally Posted by asherkin View Post
Indeed, learning C first is completely counter-productive. However, the Source Engine is very C-like (and a complete mess), and doesn't make a good getting-into-C++ project.

Disclaimer: My first C++ experience was writing TF2Items, a SourceMod extension.
My goal is to be able to read and understand what is going on in and write extensions for SM.

My Project I am working on is creating a dice game score card. The came is called 10,000 or Farkle.

Rules:
To start the scoring process you must get 1000 points during 1 turn.
Winner is first to a score >= 10,000
Once a player reaches said goal. Every other player has 1 last turn to beat that score and win.

Scoring: 6x 6 sided die
1 = 100 points
5 = 50 points
3 of a kind = faceValue * 100
4 of a kind = (3 of a kind) * 2
5 of a kind = (4 of a kind) * 2
6 of a kind = (5 of a kind) * 2
1-6 straight = 1500 points
3 pairs = 1500 points
2x 3 of a kinds = 2500 points

Game Play:
You must keep 1 scoring die per roll.
Once all 6 score you may roll all 6 and keep a running total.
If no dice score you 'Farkle' that turn counts for 0 points
Once the initial 1000 points is met per player they can save their points and pass the dice to the next player at any time.

I have some of this set up where it just adds the points to the players. Eventually it will keep a running total of all the dice scored. Eventually plan to make this graphical to as the console can get hard to follow at times.



This is only a score calculator.
Attached Files
File Type: zip Farkle.zip (305.2 KB, 104 views)

Last edited by Doc-Holiday; 04-22-2013 at 09:44.
Doc-Holiday is offline
Ajaxx
Senior Member
Join Date: Oct 2009
Old 04-22-2013 , 11:40   Re: Learning C++ for Coding Extentions
Reply With Quote #6

It’s not free ($29/month) but Pluralsight (http://www.pluralsight.com/training/Courses) has some courses, that in my opinion, are great for learning the basics quick. They’re video courses that you follow along with. They have a number of C++ courses. They also have a 10 day free trial.
Ajaxx is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-23-2013 , 03:54   Re: Learning C++ for Coding Extentions
Reply With Quote #7

Ok So i was able to finally get the damn VS10 to compile an extension using the sample.

I've read the Tutorial Is there anything further on hooking various events and what not.. the tutorial kinda just assumes you know how to do that.. Most of the various extensions already posted are quite complex in what they do..

I've been looking through Dr!fter flash tools as it seems much more simpler. Just not sure where he is actually doing the detours.

Any extensions you guys recommend to review and study?

Last edited by Doc-Holiday; 04-23-2013 at 04:18.
Doc-Holiday is offline
blaize
Junior Member
Join Date: Sep 2010
Old 04-23-2013 , 04:23   Re: Learning C++ for Coding Extentions
Reply With Quote #8

Hello.
Many people think learning C before C++ is counter productive but I don't think it's really. Indeed, learning C will make you familiar with how the things work really behind. Some C concept are easy to understand (pointer, function pointer, ...) and will make you strong base for begining learn C++ (references, functors..)
Writing pure object oriented program in C++ is very human readable but can lead to huge lack of efficiency and complexity.
So, in my opinion, I think you should first take a look at how C work (just take a look, no need to learn entire libc^^) then start learning C++ and see the differences and how objects works.
Don't forget to look at the STL (http://en.cppreference.com/w/ or http://www.cplusplus.com/reference/) for the standard library and Boost (http://www.boost.org/) for a powerfull template-based library.
Writing an sourcemod extensions can just be writing an sourcemod interface for a C++ program.

Have fun!
blaize is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-23-2013 , 09:30   Re: Learning C++ for Coding Extentions
Reply With Quote #9

Quote:
Originally Posted by Doc-Holiday View Post
Ok So i was able to finally get the damn VS10 to compile an extension using the sample.

I've read the Tutorial Is there anything further on hooking various events and what not.. the tutorial kinda just assumes you know how to do that.. Most of the various extensions already posted are quite complex in what they do..
The tutorial you linked to is for converting MetaMod: Source plugins to SourceMod extensions, not for writing extensions from scratch. There is a separate tutorial for writing that.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 04-23-2013 , 17:33   Re: Re: Learning C++ for Coding Extentions
Reply With Quote #10

Quote:
Originally Posted by Powerlord View Post
The tutorial you linked to is for converting MetaMod: Source plugins to SourceMod extensions, not for writing extensions from scratch. There is a separate tutorial for writing that.
Must of clicked the wrong link but that is the one I read.
Doc-Holiday is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode