Ouroboros': "Learn C++ through Civ5, go from newbie to veteran!" Chapter 1

qgp2B0J.png
 
Section reserved for Section 4.6...

4.6 will be posted later today.

Feel free to post questions/comments now that we are basically done with section 4. I will have section 5 up soon as well as section hub buttons for fast access to all individual posts!

In the meantime here is the full code for the project through 4.6:

Code:
// File: Main.cpp
// Author: Ouroboros
// Date: 4/16/2016

// Headers
#include <iostream>

// This is our main function, the entry point of our program!
int main(int argc, char* argv[])
{
	// Let's learn about data types!
	// Declaration AND Definition of local variable data types.
	int iCivGame = 5;
	float fExampleFloat = 0.1234f;
	char* szMsgPart1 = "In Civilization ";
	char* szMsgPart2 = " floating point numbers like, ";
	char* szMsgEnd = ", are not used as frequently as integers";

	// This statement will output "Hello CivFanatics!"
	std::cout << "Hello CivFanatics!" << std::endl;
	// Also let's output another message, this time with a number!
	std::cout << "We are going to mod Civ" << 5 << std::endl;
	/* Output another message to the console,
	   This time using our locally defined variables. */
	std::cout << szMsgPart1 << iCivGame << szMsgPart2 << fExampleFloat << szMsgEnd << std::endl;

	// Tell the user that they need to press a key to exit.
	std::cout << std::endl << "Press any key to exit...";
	// An input statement that gets a single key.
	std::cin.get();
	// Return value.
	return 0;
}
 
Attention! If you have not seen the change on the first page!

Do not install the windows 7.1 sdk on any system older than windows 7.

There is an alternative set of steps that will be posted for windows 8.1 and 10.

Again the above steps will not work for those os.


Actually it appears the steps were necessary, so don't worry.

There was an additional step that is required. Will post it shortly as I am going to be updating the tutorial anyways. :)
 
Update! I believe I have finally fixed the issue with the steps before not working. I am currently in the process of verifying the fix and there are no issues.

Everything I post will be THOROUGHLY tested and organized from this point going forward in any of my tutorials! My apologies for messing up. This does however mean that you will probably have to wait a bit longer between postings of tutorial updates.

That said, I will be posting entire chapters at a time, and the revised version of the tutorial and chapter 1 will be up later today. It is nearly completed in terms of content, new graphics "panels", which look much nicer and higher quality and are easier to read (no more eyesore green font). I have created a new logo, and done major revisions to the contents of chapter 1.

I will be including standardized links instead of buttons from this point forward as it is easier and faster for me. There will be an "Info Hub" below all of the Tutorial Panels going forward inside collapsible spoiler tags. Info that will be included will be links to resources mentioned in the panel, important keywords from the section for copy/pasting, any formulas or mathematics used in the tutorial. In addition, I will be including an attachment for a .docx for the text of the panel, and all source code from the C++ projects we cover. :)

I have talked to one of the forum moderators, and they are going to help me create a new thread with the new modified content in the tutorials section. This thread will be a hub that will point to all my tutorials that I intend to write separately.

I will reserve as many posts as I need for all sections of each tutorial that I write, going forward. And place a "Tutorial End" post at the bottom, so that you know you can go ahead and leave comments or questions in that thread without interrupting the flow. :)

Again, you can expect the fix for the mentioned problem with the SDK to be posted shortly (next couple of hours) after I am done verifying everything, and you will see a new thread for my tutorials in the tutorials section within 4 to 5 hours. This thread will be closed and point there. :)
 
I am happy to report that everything is working now!

I am now able to build successfully through the Windows 7.1 SDK.

A new post that will be a new tutorial marked "Building Civ5 DLL with Windows 7.1SDK on Windows 10" will be going up in a few moments in the tutorials section of the modding forums after I finish writing the details.

I will link to it here and then have this thread closed, as I will be uploading at least 1 chapter tomorrow of my reworked series titled "Ouroboros Presents! Learn C++ through Civ5 modding!" in a separate thread.

Here is a sneak peak of what will be covered (the design is nearly finished):

Title: Ouroroboros Presents! Learn C++ through Civ5 modding!
REQUIRES: "Building Civ5 DLL with Windows 7.1SDK on Windows 10" completion.
==================================================
Chapter 1: Introduction to the C++ programming language.
Section 1: Data Types, Operators, and Input/Output.
Section 2: Loops, and task automation.
Section 3: Control structures, and flow control.
Section 4: Functions, and reusing code.
Section 5: Arrays, and storing large sets of values.
Section 6: Addresses, and Pointers.
Section 7: Creating and designing Objects.
Section 8: Stack Memory VS Heap Memory.
Section 9: Inheritance and Polymorphism.
Section 10: Preprocessors, and Macros.

Chapter 2: Introduction to the C++ Standard Library.
Section 1: Strings.
Section 2: String Streams.
Section 3: Mathematics and Random numbers.
Section 4: File Input/Output.
Section 5: Vectors, Pairs, Maps, and iterators.
Section 6: Assert, and advanced error handling.
Section 7: Algorithms: for_each, find, and search.
Section 8: Algorithms: copy, move, remove, and replace.
Section 9: Algorithms: min, max, and accumulate.
Section 10: Miscellaneous.

Chapter 3: Introduction to version control.
Section 1: Importance of versioning.
Section 2: Versioning Schemas.
Section 3: Version Control Systems.
Section 4: Setting up Git for our version control.
Section 5: Using Git and Tortoise Git.
Section 6: Using BitBucket for server versioning.

Chapter 4: Introduction to Civ5 DLL modification.
Section 1: What is a DLL, and how do I modify it?
Section 2: Plan what you need to mod.
Section 3: Commenting, documenting, and identifying, your mods.
Section 4: Methods for separating and controlling features.
Section 5: Ouroboros’ Notes on Firaxis Design elements.
Section 6: Understanding Firaxis’ use of Fixed Point mathematics.
Section 7: Creating compatible data types, arrays, and classes.
Section 8: Adding functionality for new XML table columns.
Section 9: Adding functionality for new XML tables.
Section 10: Example of simple DLL mod based on knowledge thus far.

Chapter 5: Advanced Civ5 DLL modification.
Section 1: Giving your mod LUA scripting support.
Section 2: Examples of implementing LUA after DLL modification.
Section 3: Introduction to giving your mod data persistence.
Section 4: Using Civ5 UserData files in your mod.
Section 5: Using Civ5 save game UserData files in your mod.
Section 6: Creating and integrating entirely new Objects and Classes into the DLL.
Section 7: Reserved for future tutorial.
Section 8: Reserved for future tutorial..
Section 9: Reserved for future tutorial.
Section 10: Example of complex DLL mod based on advanced knowledge thus far.

Chapter 6: Starting a Civ5 total conversion mod.
Section 1: To be designed…
…
Section 10: To be designed…

Chapter 7: Author’s notes, and additional resources.
These will be many, depending on what my further experience over the course of creating this tutorial will be.
 
My apologies for not being able to post the new instructions thread. I have it written but want to be cognizant enough to look over it before I submit it. I don't want to make a mistake with this because it could have ramifications for anyone using it.

That said, after I wake up and have my coffee the new tutorial will be up.

Look for it! ;)
 
The new thread about setting up to mod the DLL on Windows 10 is up in the Tutorials subforum! The info about how to install the 7.1 SDK in here is inaccurate and will not work, don't follow it, look there instead. I won't be posting more in here. This tutorial is being rebooted and will be posted in the Tutorials section!
 
Back
Top Bottom