Here is a direct copy of my program including the voids at the top and part of void create() inside of main.
Code:
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <windows.h>
using namespace std;
void create();
// This makes the create function, which allows me to use the creatdata funtion.
void createdata(string rac);
// Creates character data, after character is created.
void menu();
// Allows game menu to show up.
void story();
// Begins story.
void adventure1();
// Starts you on your travels.
void cleft();
// Chose to go left in adventure1
void cright();
// Chose to go right in adventure1.
void cdry();
// You entered the cave in RIGHT.
void cwet();
// You walk in the rain in RIGHT.
void adventure2();
// Sixth part of adventure.
void adventure3();
// Seventh part of adventure.
void adventure4();
// Eight part of adventure.
void adventure5();
// Ninth part of adventure.
void adventure6();
// Final adventure.
void ending();
// Final text display in game, before credits.
void credits();
// Credits appear on screen.
int main(){
string select;
SetConsoleTitle("Rise of Darkness v1.0");
HANDLE hOut;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
do
{
cout << "Welcome to the great world of Darkonia!\n";
cout << "Please select an option below to start your quest.\n\n";
cout << "Create Character [press C]\n";
cout << "Game Info [press I]\n";
cout << "EXIT [press X]\n";
cin >> select;
cout << endl;
if (select == "c" || select == "C")
{
create();
}
else if ( select == "i" || select == "I")
{
cout << "You play as the young Riako. You average eveyrday\n";
cout << "medieval knight. Your set on the task of finding\n";
cout << "the great Scroll. Do you have what it takes to survive\n";
cout << "the journey, slay the beasts, grab the scroll and make it back?\n";
cout << "If you think so, create your character type and being.\n\n\n";
cout << "No matter what race you make, it is a male and his name is\n";
cout << "Riako. Creating the character was just a little practice with code.\n\n\n";
}
else if (select == "x" || select == "X")
{
break;
}
else
{
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_INTENSITY);
cout << "Sorry, that is not a proper selection. Please choose again.\n\n\n\n" << endl;
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
}
}while (select != "x" || select != "X");
}
void create() {
string rac; // Used to choose a race
string yn; // Used to choose whether or not to use the chosen race.
cout << "Welcome to Character Creation.\n";
cout << "Select a character race.\n\n";
cout << "Human (press H)\n";
cout << "Elf (press E)\n";
cout << "Werewolf (press W)\n";
cout << "Dwarf (press D)\n";
cin >> rac;
cout << endl;
if (rac == "h" || rac == "H")
{
cout << "Humans specialize in stubborness.\n";
cout << "Since the humans are so stubborn they are able to\n";
cout << "fight hard and long. Although, humans have soft skin\n";
cout << "and fragile bodies, this makes them supceptable\n";
cout << "to lots of damage. To protect a human, money is required\n";
cout << "to buy armor and weapons.\n\n\n";
cout << "Are you sure you want to be a human? Y/N:";
cin >> yn;
if (yn == "Y"|| yn == "y")
{
cout << endl << "Data created.\n\n\n";
createdata(rac);
menu();
}
else
{
create();
}
cin.get();
}
It said that the create() was fine. Thats why I dont really get why the other couple of functions dont work.