473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Text based RPG

Making a RPG that will be required for my tech center witch is half of my school pretty much. Right now I have a good understanding of vectors with lots of help from some people in the community here. Right I want to know how to transfer over one vectors location to another vector. How do I trade/drop items from inventory to trader/ground. Right now i have the list of items that is in inventory:
Expand|Select|Wrap|Line Numbers
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <vector>
  4. #include <string>
  5. #include <fstream>
  6. #include <cmath>
  7.  
  8. using namespace std;
  9.  
  10.     struct InventoryItem
  11. {
  12.     string name;
  13.     int weight;
  14.     int price;
  15. };
  16.  
  17. int main()
  18. {
  19.  
  20.     vector<InventoryItem> MyStuff;
  21.     vector<InventoryItem> Market1;
  22.     vector<InventoryItem> drop;
  23.  
  24.     //Money
  25.     InventoryItem mon;
  26.     mon.name = "Runes";
  27.     mon.weight = 0;
  28.     mon.price = 1;
  29.     //Item 1
  30.     InventoryItem obj;
  31.     obj.name = "flour";
  32.     obj.weight = 100;
  33.     obj.price = 10;
  34.     //Item 2
  35.     InventoryItem obj2;
  36.     obj2.name = "wool";
  37.     obj2.weight = 50;
  38.     obj2.price = 20;
  39.     //Item 3
  40.     InventoryItem obj3;
  41.     obj3.name = "sword";
  42.     obj3.weight = 150;
  43.     obj3.price = 50;
  44.  
  45.  
  46.     int num;
  47.     int del;
  48.     int asdf;
  49.     string name;
  50.     int drops;
  51.  
  52.     //inventory
  53.     MyStuff.push_back(obj); //add item 1 to inventory
  54.     MyStuff.push_back(obj2); //add item 2 to inventory
  55.     MyStuff.push_back(obj3); //add item 3 to inventory
  56.     //market1
  57.     Market1.push_back(obj2);
  58.     Market1.push_back(obj);
  59.     Market1.push_back(obj3);
  60.  
  61.  
  62.     vector<InventoryItem>::const_iterator iter;
  63.     vector<InventoryItem>::iterator myIterator;
  64.  
  65.     cout << "\t\t\t\t*Inventory Wight*\n\n";
  66.     cout << "Your inventory, pounds and price:\n";
  67.  
  68.         cout << "\nYou find a market...\n";
  69.         market:
  70.         cout << "what do you want to do?\n\n";
  71.         cout << "1-look at inventory\n";
  72.         cout << "2-look at what is for sale\n";
  73.         cout << "3-leave\n";
  74.  
  75.         cout << "\nChoice: ";
  76.         cin >> num;
  77.         system("CLS");
  78.         switch ( num )
  79.         {
  80.             //inventory
  81.             case 1:
  82.                 inventory:
  83.                 asdf = 0;
  84.                 for (iter = MyStuff.begin(); iter != MyStuff.end(); ++iter)
  85.                 {
  86.                     ++asdf;
  87.                     cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  88.                 }
  89.                     cout << "\nWhat do you want to do?\n\n";
  90.                     cout << "1-drop an item\n";
  91.                     cout << "2-pick up and item on the ground\n";
  92.                     cout << "3-Back\n";
  93.                     cout << "\nChoice: ";
  94.                     cin >> num;
  95.  
  96.                     switch ( num )
  97.                     {
  98.                     case 1:
  99.                         cout << "\nWhat do you want to drop?\n";
  100.  
  101.                         asdf = 0;
  102.                         for (iter = MyStuff.begin(); iter != MyStuff.end(); ++iter)
  103.                         {
  104.                             ++asdf;
  105.                             cout << asdf << ". " << (*iter).name << "\n";
  106.                         }
  107.                         cout << "Pick Item: ";
  108.                         cin >> num;
  109.                         num = num -1;
  110.                         //DROP ITEM!!!
  111.  
  112.                         break;
  113.                     case 2:
  114.                         if (drops = 0)
  115.                         {
  116.                             //choice what to pick up
  117.                         }
  118.                         else
  119.                         {
  120.                             cout << "\nYOU HAVE NO ITEMS ON THE GROUND!\n\n";
  121.                             system("pause");
  122.                             system("CLS");
  123.                             goto inventory;
  124.                         }
  125.                         break;
  126.                     case 3:
  127.                         system("CLS");
  128.                         goto market;
  129.                         break;
  130.                     }
  131.                 break;
  132.                 //Market
  133.             case 2:
  134.                 asdf = 0;
  135.                 for (iter = Market1.begin(); iter != Market1.end(); ++iter)
  136.                     {
  137.                         ++asdf;
  138.                         cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  139.                     }
  140.  
  141.                 cout << "\nWhat do you want to do?\n";
  142.                 cout << "1-Buy an item\n";
  143.                 cout << "2-Sell an item\n";
  144.                 cout << "3-leave\n";
  145.                 cout << "Choice: ";
  146.                 cin >> num;
  147.  
  148.                 switch ( num )
  149.                 {
  150.                 case 1:
  151.  
  152.                     break;
  153.                 case 2:
  154.  
  155.                     break;
  156.                 case 3:
  157.                     system("CLS");
  158.                     goto market;
  159.                     break;
  160.                 }
  161.                 break;
  162.                 //leave
  163.             case 3:
  164.                 cout << "You walk away into the sunset.\n\n";
  165.                 break;
  166.         }
  167. system("pause");
  168.     return 0;
  169. }
I am just want a little bit of help knowing how to do this since our teacher says the rest of the class cant keep up with all the extra work i want to do. None of them know how to make a vector hold more then 1 verbal and most of them ask me for help on logic that is a peace of cake, yet when i dive into this stuff i just cant under stand HOW to do it. Please help, thank you.
Attached Files
File Type: zip Inventory System.zip (3.57 MB, 102 views)
Apr 5 '13 #1

✓ answered by weaknessforcats

You don't say what your problem is but if it's this:

Expand|Select|Wrap|Line Numbers
  1. if(num == job && job < 9)
  2.             {
  3.                 cout << (*iter2).dis << "\n";
  4.                 cout << "Is "<< (*iter2).name <<" truly what you want?\n";
  5.             }
  6.             else if (job > 9 || job < 0)
  7.             {
  8. etc...
then the "if" is true only if num == job.

If num is not equal to job then the AND expression will always be false.

If you intend that the "if" is true only when num == job AND the job is less than 9 then you code:

Expand|Select|Wrap|Line Numbers
  1. if((num == job) && (job < 9))
Thus will cause num==job to be evaluated and then job<9 and only then will the && be applied.

You may be falling into the operator precedence trap.
You may want to read up on operator precedence and how it works.

BTW: We have gone beyond vectors, which is what this thread is about. Please start new threads for subsequent problems. Bytes.com is trying to hold a thread to the subject of the first post.

49 2933
weaknessforcats
9,208 Expert Mod 8TB
Your InventoryItem struct has a string member and two int members. When you copy an InventoryItem, each member is separately copied by the compiler.

Sincs the string and the int are part of the C++ language, they know how to copy theselves so you don't need to worry about how they do that.

So to make copy of an InvnetoryItem in MyStuff and put the copy in Market1 you code:

Expand|Select|Wrap|Line Numbers
  1. Market1[3] = MyStuff[6];
This would copy element 7 in MyStuff (remember array elements count from zero) to element 4 of Market1.

You could add to Market1 by:

Expand|Select|Wrap|Line Numbers
  1. Market1.push_back(MyStuff[6]);
  2.  
If you use iterators, remember that *iter is an InventoryItem whereas iter (without the *) is the address of the InventoryItem. So anyplace you need and InventoryItem all you need to do is get the iterator to point at it and then use *iter.
Apr 5 '13 #2
I am having a dificual time with a money system I have the idea but I don't know if I should use a simple int money to store the money or if I have to use a vector to make it work.

This is all my code:
Expand|Select|Wrap|Line Numbers
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <vector>
  4. #include <string>
  5. #include <fstream>
  6. #include <cmath>
  7.  
  8. using namespace std;
  9.  
  10.     struct InventoryItem
  11. {
  12.     string name;
  13.     int weight;
  14.     int price;
  15. };
  16.  
  17. int main()
  18. {
  19.  
  20.     vector<InventoryItem> MyStuff;
  21.     vector<InventoryItem> Market1;
  22.     vector<InventoryItem> drop;
  23.     vector<InventoryItem> Money;
  24.  
  25.     //Money
  26.     InventoryItem mon;
  27.     mon.name = "Runes";
  28.     mon.weight = 0;
  29.     mon.price = 1;
  30.     //Item 1
  31.     InventoryItem obj;
  32.     obj.name = "flour";
  33.     obj.weight = 100;
  34.     obj.price = 10;
  35.     //Item 2
  36.     InventoryItem obj2;
  37.     obj2.name = "wool";
  38.     obj2.weight = 50;
  39.     obj2.price = 20;
  40.     //Item 3
  41.     InventoryItem obj3;
  42.     obj3.name = "sword";
  43.     obj3.weight = 150;
  44.     obj3.price = 50;
  45.  
  46.  
  47.     int num;
  48.     int del;
  49.     int asdf;
  50.     string name;
  51.     int drops = 0;
  52.     int pick = 3;
  53.  
  54.     //inventory
  55.     MyStuff.push_back(obj); //add item 1 to inventory
  56.     MyStuff.push_back(obj2); //add item 2 to inventory
  57.     MyStuff.push_back(obj3); //add item 3 to inventory
  58.     //market1
  59.     Market1.push_back(obj2);
  60.     Market1.push_back(obj);
  61.     Market1.push_back(obj3);
  62.     //Money
  63.     Money.push_back(mon);
  64.  
  65.  
  66.     vector<InventoryItem>::const_iterator iter;
  67.     vector<InventoryItem>::iterator myIterator;
  68.  
  69.     cout << "\t\t\t\t*Inventory Wight*\n\n";
  70.     cout << "Your inventory, pounds and price:\n";
  71.  
  72.         cout << "\nYou find a market...\n";
  73.         market:
  74.         cout << "what do you want to do?\n\n";
  75.         cout << "1-look at inventory\n";
  76.         cout << "2-look at what is for sale\n";
  77.         cout << "3-leave\n";
  78.  
  79.         cout << "\nChoice: ";
  80.         cin >> num;
  81.         system("CLS");
  82.         switch ( num )
  83.         {
  84.             //inventory
  85.             case 1:
  86.                 inventory:
  87.                 asdf = 0;
  88.                 for (iter = MyStuff.begin(); iter != MyStuff.end(); ++iter)
  89.                 {
  90.                     ++asdf;
  91.                     cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  92.                 }
  93.                     cout << "\nWhat do you want to do?\n\n";
  94.                     cout << "1-drop an item\n";
  95.                     cout << "2-pick up and item on the ground\n";
  96.                     cout << "3-Back\n";
  97.                     cout << "\nChoice: ";
  98.                     cin >> num;
  99.                     system("CLS");
  100.  
  101.                     switch ( num )
  102.                     {
  103.                     case 1:
  104.                         if ( pick == 0)
  105.                         {
  106.                             cout << "Sorry your inventory is empty\n";
  107.                             system("pause");
  108.                             system ("CLS");
  109.                             goto inventory;
  110.                         }
  111.                         else
  112.                         {
  113.                         cout << "What do you want to drop?\n";
  114.  
  115.                         asdf = 0;
  116.                         for (iter = MyStuff.begin(); iter != MyStuff.end(); ++iter)
  117.                         {
  118.                             ++asdf;
  119.                             cout << asdf << ". " << (*iter).name << "\n";
  120.                         }
  121.                         cout << "Pick Item: ";
  122.                         cin >> num;
  123.                         num = num -1;
  124.                         //DROP ITEM!!!
  125.                         drop.push_back(MyStuff[num]);
  126.                         MyStuff.erase(MyStuff.begin() + num);
  127.                         asdf = 0;
  128.                         ++drops;
  129.                         --pick;
  130.                         cout << "\nItems on the ground: \n";
  131.                         for (iter = drop.begin(); iter != drop.end(); ++iter)
  132.                         {
  133.                             ++asdf;
  134.                             cout << asdf << ". " << (*iter).name << "\n";
  135.                         }
  136.                         system("pause");
  137.                         system("CLS");
  138.                         goto  inventory;
  139.                         }
  140.                         break;
  141.                     case 2:
  142.                         if (drops != 0)
  143.                         {
  144.                             //choice what to pick up
  145.                             asdf = 0;
  146.                         for (iter = drop.begin(); iter != drop.end(); ++iter)
  147.                         {
  148.                             ++asdf;
  149.                             cout << asdf << ". " << (*iter).name << "\n";
  150.                         }
  151.                         cout << "Pick up an item: ";
  152.                         cin >> num;
  153.                         num = num - 1;
  154.                         --drops;
  155.                         pick++;
  156.                         //Pick Up Item
  157.                         MyStuff.push_back(drop[num]);
  158.                         drop.erase(drop.begin() + num);
  159.                         system("CLS");
  160.                         goto inventory;
  161.                         }
  162.                         else
  163.                         {
  164.                             cout << "\nYOU HAVE NO ITEMS ON THE GROUND!\n\n";
  165.                             system("pause");
  166.                             system("CLS");
  167.                             goto inventory;
  168.                         }
  169.                         break;
  170.                     case 3:
  171.                         system("CLS");
  172.                         goto market;
  173.                         break;
  174.                     }
  175.                 break;
  176.                 //Market
  177.             case 2:
  178.                 market1:
  179.                 cout << "What do you want to do?\n";
  180.                 cout << "1-Buy an item\n";
  181.                 cout << "2-Sell an item\n";
  182.                 cout << "3-leave\n";
  183.                 cout << "Choice: ";
  184.                 cin >> num;
  185.                 system("CLS");
  186.  
  187.                 switch ( num )
  188.                 {
  189.                 case 1:
  190.                     asdf = 0;
  191.                     for (iter = Market1.begin(); iter != Market1.end(); ++iter)
  192.                     {
  193.                         ++asdf;
  194.                         cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  195.                     }
  196.  
  197.                     cout << "\nWhat do you want to buy?";
  198.                     cout << "\nChoice: ";
  199.                     cin >> num;
  200.                     system("CLS");
  201.                     goto market1;
  202.                     break;
  203.                 case 2:
  204.                     asdf = 0;
  205.                     for (iter = MyStuff.begin(); iter != MyStuff.end(); ++iter)
  206.                     {
  207.                         ++asdf;
  208.                         cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  209.                     }
  210.  
  211.                     cout << "\nWhat do you want to sell?";
  212.                     cout << "\nChoice: ";
  213.                     cin >> num;
  214.                     system("CLS");
  215.                     goto market1;
  216.                     break;
  217.                 case 3:
  218.                     system("CLS");
  219.                     goto market;
  220.                     break;
  221.                 }
  222.                 break;
  223.                 //leave
  224.             case 3:
  225.                 cout << "You walk away into the sunset.\n\n";
  226.                 break;
  227.         }
  228. system("pause");
  229.     return 0;
  230. }
Market:
Expand|Select|Wrap|Line Numbers
  1.                 //Market
  2.             case 2:
  3.                 market1:
  4.                 cout << "What do you want to do?\n";
  5.                 cout << "1-Buy an item\n";
  6.                 cout << "2-Sell an item\n";
  7.                 cout << "3-leave\n";
  8.                 cout << "Choice: ";
  9.                 cin >> num;
  10.                 system("CLS");
  11.  
  12.                 switch ( num )
  13.                 {
  14.                 case 1:
  15.                     asdf = 0;
  16.                     for (iter = Market1.begin(); iter != Market1.end(); ++iter)
  17.                     {
  18.                         ++asdf;
  19.                         cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  20.                     }
  21.  
  22.                     cout << "\nWhat do you want to buy?";
  23.                     cout << "\nChoice: ";
  24.                     cin >> num;
  25.                     system("CLS");
  26.                     goto market1;
  27.                     break;
  28.                 case 2:
  29.                     asdf = 0;
  30.                     for (iter = MyStuff.begin(); iter != MyStuff.end(); ++iter)
  31.                     {
  32.                         ++asdf;
  33.                         cout << asdf << ". " << (*iter).name << " | Weight: " << (*iter).weight << " | Price: " << (*iter).price << "\n";
  34.                     }
  35.  
  36.                     cout << "\nWhat do you want to sell?";
  37.                     cout << "\nChoice: ";
  38.                     cin >> num;
  39.                     system("CLS");
  40.                     goto market1;
  41.                     break;
  42.                 case 3:
  43.                     system("CLS");
  44.                     goto market;
  45.                     break;
  46.                 }
  47.                 break;
Vector Money:
Expand|Select|Wrap|Line Numbers
  1. vector<InventoryItem> Money;
  2. int price;
  3.     //Money
  4.     InventoryItem mon;
  5.     mon.name = "Runes";
  6.     mon.weight = 0;
  7.     mon.price = 1;
What do I do :(
Apr 9 '13 #3
weaknessforcats
9,208 Expert Mod 8TB
I don't know why you would use a vector called Money.

You added price to the InventoryItem so that's just another member to maintain in the code that uses InventoryItem.

Because you added this member, you need to be sure that every InventoryItem you create has valid values for all three members. Later on when you use these InventryItem objects that code will expect that each object is correctly initialized.

As to an int for money, that is the correct approach. You can decide to keep the price in pennies. Then you just add, subtract, etc values of pennies. Only when you dispay the amount for the use do you need to worry that 123 must appear as $1.23.

I would write a function with an int argument that returns a sring. So you pass in 123 and get back a string containing $1.23. You would call this function from inside your display function to format the amount.

Using floating point for money is a bad idea. Beginners do it because of the handy decimal point. But floating point does rounding so your financial calculations are often off by a few cents. You use floating point for science work where extreme accuracy is not important.
Apr 10 '13 #4
What I wanted is that the runes are with no floating points I just want it to keep increasing so if i have 1000000 runes it wont turn into a smaller number like 10 (what ever name you would put for this type of money). I think I will try it I have been caught up with other tasks I am doing at the moment so I wont be working on it for a while thank you weaknessforcats for the help.
Apr 10 '13 #5
I am now starting making the back bone of the game and starting the intro. I have completely forgotten on how to call on 1 vector object from a list of objects. I have forgotten the command for it please help.
Expand|Select|Wrap|Line Numbers
  1.         cout << "You have picked the personality quiz!\n";
  2.         cout << "Now! First question to figure your mind!\n\n";
  3.         wrong:
  4.         cout << "What is your favorit color from the questions below\n";
  5.         //vector colors//
  6.         color2.push_back("Red");
  7.         color2.push_back("Yellow");
  8.         color2.push_back("Orange");
  9.         color2.push_back("Green");
  10.         color2.push_back("Pink");
  11.         color2.push_back("Blue");
  12.         color2.push_back("Purple");
  13.         color2.push_back("White");
  14.         color2.push_back("Black");
  15.         //end vector colors//
  16.         cout << "1-Red\n";
  17.         cout << "2-Yellow\n";
  18.         cout << "3-Orange\n";
  19.         cout << "4-Green\n";
  20.         cout << "5-Pink\n";
  21.         cout << "6-Blue\n";
  22.         cout << "7-Purple\n";
  23.         cout << "8-White\n";
  24.         cout << "9-Black\n";
  25.         cout << "Choice: ";
  26.         cin >> color;
  27.         for (iter = color2.begin(); iter ; ++iter)
  28.                 { 
  29.         cout << "Is "<< *iter <<" truly what you want?\n";       
  30.                 }
  31.         cout << "1-Yes\n";
  32.         cout << "2-No\n";
  33.         cout << "Choice: ";
  34.         cin >> num;
Apr 11 '13 #6
weaknessforcats
9,208 Expert Mod 8TB
A vector is implemented as an array. So MyStuff[5] is the sixth element of the vector.

The array syntax is the dot operator: Mystuff[5].name.

If you use iterators, they operate on the address of the object. So you either dereference the iterator, which gives you the object: *(iter).price, or you use the -> operator:
iter->price. These two syntaxes are equivalent. Use the dot with the object, use the arrow with the address of the object.

Was tis what you meant?
Apr 11 '13 #7
Well kind of...

Full code:

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13. //All Data Types//
  14. string Name;
  15. int num;
  16. //Personality quiz//
  17. int color;
  18. vector<string>color2;
  19. vector<string>::const_iterator iter;
  20. vector<string>::iterator myIterator;
  21. //end personality quiz//
  22. //End Data Types//
  23.  
  24. int main()
  25. {
  26.     //Intro//
  27.     cout << "Welcome adventure!";
  28.     std::getchar();//Like a system pause with no words
  29.     cout << "You will imbark on a journey of your life!";
  30.     std::getchar();
  31.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  32.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  33.     std::getchar();
  34.     cout << "By the way...\n";
  35.     cout << "What is your name?";
  36.     cout << "\nName: ";
  37.     cin >> Name;
  38.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  39.     std::getchar();
  40.     std::getchar();
  41.     system("CLS");
  42.     //Test//
  43.     //This could be for testing//
  44.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  45.     cout << "puting you, lets see what you realy made of.\n";
  46.     std::getchar();
  47.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  48.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  49.     cout << "Now to make you realy you!\n";
  50.     std::getchar();
  51.     system("CLS");
  52.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  53.     cout << "1-Personality Quiz\n";
  54.     cout << "2-Free Pick\n\n";
  55.     cout << "Choice: ";
  56.     cin >> num;
  57.     system("CLS");
  58.  
  59.     switch(num)
  60.     {
  61.     case 1:
  62.         cout << "You have picked the personality quiz!\n";
  63.         cout << "Now! First question to figure your mind!\n\n";
  64.         wrong:
  65.         cout << "What is your favorit color from the questions below\n";
  66.         //vector colors//
  67.         color2.push_back("Red");
  68.         color2.push_back("Yellow");
  69.         color2.push_back("Orange");
  70.         color2.push_back("Green");
  71.         color2.push_back("Pink");
  72.         color2.push_back("Blue");
  73.         color2.push_back("Purple");
  74.         color2.push_back("White");
  75.         color2.push_back("Black");
  76.         //end vector colors//
  77.         cout << "1-Red\n";
  78.         cout << "2-Yellow\n";
  79.         cout << "3-Orange\n";
  80.         cout << "4-Green\n";
  81.         cout << "5-Pink\n";
  82.         cout << "6-Blue\n";
  83.         cout << "7-Purple\n";
  84.         cout << "8-White\n";
  85.         cout << "9-Black\n";
  86.         cout << "Choice: ";
  87.         cin >> color;
  88.         --color;
  89.  
  90.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  91.         {
  92.             if(iter == color)
  93.             {
  94.         cout << "Is "<< *iter <<" truly what you want?\n";
  95.             }
  96.         }
  97.  
  98.         cout << "1-Yes\n";
  99.         cout << "2-No\n";
  100.         cout << "Choice: ";
  101.         cin >> num;
  102.  
  103.         switch(num)
  104.         {
  105.         case 1:
  106.             system("CLS");
  107.             goto color;
  108.         case 2:
  109.             system("CLS");
  110.             goto wrong;
  111.         }
  112.  
  113.         color:
  114.         switch(color)
  115.         {
  116.             //Personality Quiz//
  117.         case 1:
  118.             cout << "Ok Red it is.";
  119.             break;
  120.         case 2:
  121.             cout << "Ok Yellow it is.";
  122.             break;
  123.         case 3:
  124.             cout << "Ok Orange it is.";
  125.             break;
  126.         case 4:
  127.             cout << "Ok Green it is.";
  128.             break;
  129.         case 5:
  130.             cout << "Ok Pink it is.";
  131.             break;
  132.         case 6:
  133.             cout << "Ok Blue it is.";
  134.             break;
  135.         case 7:
  136.             cout << "Ok Purple it is.";
  137.             break;
  138.         case 8:
  139.             cout << "Ok White it is.";
  140.             break;
  141.         case 9:
  142.             cout << "Ok Black it is.";
  143.             break;
  144.         }    
  145.  
  146.         break;
  147.         //Free pick//
  148.     case 2:
  149.         break;
  150.     }
  151.  
  152.     system("pause");//Like a std::getchar but says to press a word to continue
  153.     return 0;
  154. }
  155.  
I need help with how to say on line 94 "Is COLOR truly what you want?" I can't find a action to only pick the number your user picks and display it or I am not thinking correctly.

Right now iter is not aloud to == color how do i make it or change the logic to say the correct thing
Apr 11 '13 #8
Well i just tested some code:
(I fixed it but funny thing is if you pick 4, then it says orange and then green if I say no) ha
Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13. //All Data Types//
  14. string Name;
  15. int num;
  16. //Personality quiz//
  17. int color;
  18. vector<string>color2;
  19. vector<string>::const_iterator iter;
  20. vector<string>::iterator myIterator;
  21. //end personality quiz//
  22. //End Data Types//
  23.  
  24. int main()
  25. {
  26.     //Intro//
  27.     cout << "Welcome adventure!";
  28.     std::getchar();//Like a system pause with no words
  29.     cout << "You will imbark on a journey of your life!";
  30.     std::getchar();
  31.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  32.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  33.     std::getchar();
  34.     cout << "By the way...\n";
  35.     cout << "What is your name?";
  36.     cout << "\nName: ";
  37.     cin >> Name;
  38.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  39.     std::getchar();
  40.     std::getchar();
  41.     system("CLS");
  42.     //Test//
  43.     //This could be for testing//
  44.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  45.     cout << "puting you, lets see what you realy made of.\n";
  46.     std::getchar();
  47.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  48.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  49.     cout << "Now to make you realy you!\n";
  50.     std::getchar();
  51.     system("CLS");
  52.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  53.     cout << "1-Personality Quiz\n";
  54.     cout << "2-Free Pick\n\n";
  55.     cout << "Choice: ";
  56.     cin >> num;
  57.     system("CLS");
  58.  
  59.     switch(num)
  60.     {
  61.     case 1:
  62.         cout << "You have picked the personality quiz!\n";
  63.         cout << "Now! First question to figure your mind!\n\n";
  64.         wrong:
  65.         cout << "What is your favorit color from the questions below\n";
  66.         //vector colors//
  67.         color2.push_back("Red");
  68.         color2.push_back("Yellow");
  69.         color2.push_back("Orange");
  70.         color2.push_back("Green");
  71.         color2.push_back("Pink");
  72.         color2.push_back("Blue");
  73.         color2.push_back("Purple");
  74.         color2.push_back("White");
  75.         color2.push_back("Black");
  76.         //end vector colors//
  77.         cout << "1-Red\n";
  78.         cout << "2-Yellow\n";
  79.         cout << "3-Orange\n";
  80.         cout << "4-Green\n";
  81.         cout << "5-Pink\n";
  82.         cout << "6-Blue\n";
  83.         cout << "7-Purple\n";
  84.         cout << "8-White\n";
  85.         cout << "9-Black\n";
  86.         cout << "Choice: ";
  87.         cin >> color;
  88.         --color;
  89.  
  90.         num = 0;
  91.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  92.         {
  93.             ++num;
  94.             if(num == color)
  95.             {
  96.         cout << "Is "<< *iter <<" truly what you want?\n";
  97.             }
  98.         }
  99.  
  100.         cout << "1-Yes\n";
  101.         cout << "2-No\n";
  102.         cout << "Choice: ";
  103.         cin >> num;
  104.  
  105.         switch(num)
  106.         {
  107.         case 1:
  108.             system("CLS");
  109.             goto color;
  110.         case 2:
  111.             system("CLS");
  112.             goto wrong;
  113.         }
  114.  
  115.         color:
  116.         switch(color)
  117.         {
  118.             //Personality Quiz//
  119.         case 0:
  120.             cout << "Ok Red it is.";
  121.             break;
  122.         case 1:
  123.             cout << "Ok Yellow it is.";
  124.             break;
  125.         case 2:
  126.             cout << "Ok Orange it is.";
  127.             break;
  128.         case 3:
  129.             cout << "Ok Green it is.";
  130.             break;
  131.         case 4:
  132.             cout << "Ok Pink it is.";
  133.             break;
  134.         case 5:
  135.             cout << "Ok Blue it is.";
  136.             break;
  137.         case 6:
  138.             cout << "Ok Purple it is.";
  139.             break;
  140.         case 7:
  141.             cout << "Ok White it is.";
  142.             break;
  143.         case 8:
  144.             cout << "Ok Black it is.";
  145.             break;
  146.         }    
  147.  
  148.         break;
  149.         //Free pick//
  150.     case 2:
  151.         break;
  152.     }
  153.  
  154.     system("pause");//Like a std::getchar but says to press a word to continue
  155.     return 0;
  156. }
  157.  
Apr 11 '13 #9
I have fixed the problem thank you for the help that you have given to me over the past few weeks sir.
Apr 11 '13 #10
I seem to have another problem with my code I have made a struct for my vector (jobs) and then made .name and .dis as my... object verbals? Both are strings but when I drop down to line 229 the iter is having a problem with jobs.begin I know I am missing just 1 thing... what?

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. struct struct1
  15. {
  16.     string name;
  17.     string dis;
  18. };
  19.  
  20. int main()
  21. {
  22.     //All Data Types//
  23.  
  24.     string Name;
  25.     int num;
  26.  
  27.     //Personality quiz//
  28.  
  29.  
  30.     //Q1//
  31.     int color;
  32.     vector<string>color2;
  33.     vector<string>::const_iterator iter;
  34.     vector<string>::iterator myIterator;
  35.  
  36.     //vector colors//
  37.     color2.push_back("Red");
  38.     color2.push_back("Yellow");
  39.     color2.push_back("Orange");
  40.     color2.push_back("Green");
  41.     color2.push_back("Pink");
  42.     color2.push_back("Blue");
  43.     color2.push_back("Purple");
  44.     color2.push_back("White");
  45.     color2.push_back("Black");
  46.     //end vector colors//
  47.  
  48.  
  49.     //Q2//
  50.     int job;
  51.     vector<struct1>jobs;
  52.  
  53.     //jobs//
  54.     struct1 job0;
  55.     job0.name = "miner";
  56.     job0.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  57.  
  58.     struct1 job1;
  59.     job1.name = "Lumber Jack";
  60.     job1.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  61.  
  62.     struct1 job2;
  63.     job2.name = "Gardner";
  64.     job2.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  65.  
  66.     struct1 job3;
  67.     job3.name = "Blacksmith";
  68.     job3.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  69.  
  70.     struct1 job4;
  71.     job4.name = "Fishermen";
  72.     job4.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  73.  
  74.     struct1 job5;
  75.     job5.name = "Farmer";
  76.     job5.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  77.  
  78.     struct1 job6;
  79.     job6.name = "Guard";
  80.     job6.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  81.  
  82.     struct1 job7;
  83.     job7.name = "Tavern Keeper";
  84.     job7.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  85.  
  86.     struct1 job8;
  87.     job8.name = "Assassin";
  88.     job8.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  89.  
  90.     struct1 job9;
  91.     job9.name = "None";
  92.     job9.dis = "... use your imagination";
  93.     //end jobs//
  94.  
  95.     //Vector//
  96.     jobs.push_back(job0);
  97.     jobs.push_back(job1);
  98.     jobs.push_back(job2);
  99.     jobs.push_back(job3);
  100.     jobs.push_back(job4);
  101.     jobs.push_back(job5);
  102.     jobs.push_back(job6);
  103.     jobs.push_back(job7);
  104.     jobs.push_back(job8);
  105.     jobs.push_back(job9);
  106.     //end Vector//
  107.  
  108.  
  109.     //Q3//
  110.  
  111.  
  112.  
  113.     //end personality quiz//
  114.     //End Data Types//
  115.  
  116.     //Intro//
  117.     cout << "Welcome adventure!";
  118.     std::getchar();//Like a system pause with no words
  119.     cout << "You will imbark on a journey of your life!";
  120.     std::getchar();
  121.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  122.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  123.     std::getchar();
  124.     cout << "By the way...\n";
  125.     cout << "What is your name?";
  126.     cout << "\nName: ";
  127.     cin >> Name;
  128.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  129.     std::getchar();
  130.     std::getchar();
  131.     system("CLS");
  132.     //Test//
  133.     //This could be for testing//
  134.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  135.     cout << "puting you, lets see what you realy made of.\n";
  136.     std::getchar();
  137.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  138.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  139.     cout << "Now to make you realy you!\n";
  140.     std::getchar();
  141.     system("CLS");
  142.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  143.     cout << "1-Personality Quiz\n";
  144.     cout << "2-Free Pick\n\n";
  145.     cout << "Choice: ";
  146.     cin >> num;
  147.     system("CLS");
  148.  
  149.     switch(num)
  150.     {
  151.         //Personality Quiz//
  152.         //Q1//
  153.     case 1:
  154.         cout << "You have picked the personality quiz!\n";
  155.         cout << "Now! First question to figure your mind!\n\n";
  156.         wrong:
  157.         cout << "What is your favorit color from the questions below\n";
  158.  
  159.         cout << "1-Red\n";
  160.         cout << "2-Yellow\n";
  161.         cout << "3-Orange\n";
  162.         cout << "4-Green\n";
  163.         cout << "5-Pink\n";
  164.         cout << "6-Blue\n";
  165.         cout << "7-Purple\n";
  166.         cout << "8-White\n";
  167.         cout << "9-Black\n";
  168.         cout << "Choice: ";
  169.         cin >> color;
  170.         --color;
  171.  
  172.         num = 0;
  173.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  174.         {
  175.             if(num == color)
  176.             {
  177.         cout << "Is "<< *iter <<" truly what you want?\n";
  178.             }
  179.             ++num;
  180.         }
  181.  
  182.         cout << "1-Yes\n";
  183.         cout << "2-No\n";
  184.         cout << "Choice: ";
  185.         cin >> num;
  186.  
  187.         switch(num)
  188.         {
  189.         case 1:
  190.             system("CLS");
  191.             break;
  192.         case 2:
  193.             system("CLS");
  194.             goto wrong;
  195.         }
  196.         num = 0;
  197.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  198.         {
  199.             if(num == color)
  200.             {
  201.         cout << "Ok " << *iter << " it is.";
  202.             }
  203.             ++num; 
  204.         }
  205.  
  206.         //Q2//
  207.         std::getchar();
  208.         std::getchar();
  209.         system("CLS");
  210.  
  211.         wrong2:
  212.         cout << "Question 2\n\n";
  213.         cout << "If you had to pick a job from this list what would it be?\n\n";
  214.         cout << "1-Mining\n";
  215.         cout << "2-Lumber Jack\n";
  216.         cout << "3-Gardener\n";
  217.         cout << "4-Blacksmith\n";
  218.         cout << "5-Fishermen\n";
  219.         cout << "6-Farmer\n";
  220.         cout << "7-Guard\n";
  221.         cout << "8-Tavern Keeper\n";
  222.         cout << "9-Assassin\n";
  223.         cout << "10-None\n";
  224.         cout << "Choice: ";
  225.         cin >> job;
  226.         --job;
  227.  
  228.         num = 0;
  229.         for (iter = jobs.begin(); iter != jobs.end(); ++iter)
  230.         {
  231.             if(num == job && job < 9)
  232.             {
  233.                 cout << (*iter).dis;
  234.                 cout << "Is "<< (*iter).name <<" truly what you want?\n";
  235.             }
  236.             else if (num == job && job == 9)
  237.             {
  238.                 cout << "You sure you never had a job?\n";
  239.             }
  240.             else if (job > 9)
  241.             {
  242.                 cout << "Not a real answer!\n";
  243.                 system("pause");
  244.                 system("CLS");
  245.                 goto wrong2;
  246.             }
  247.             ++num;
  248.         }
  249.         cout << "1-Yes\n";
  250.         cout << "2-No\n";
  251.         cout << "Choice: ";
  252.         cin >> num;
  253.  
  254.         switch(num)
  255.         {
  256.         case 1:
  257.             system("CLS");
  258.             break;
  259.         case 2:
  260.             system("CLS");
  261.             goto wrong2;
  262.         }
  263.  
  264.         //Q3//
  265.  
  266.         break;
  267.         //End Personality Quiz//
  268.         //Free pick//
  269.     case 2:
  270.         break;
  271.         //End Free Pick//
  272.     }
  273.  
  274.     system("pause");//Like a std::getchar but says to press a word to continue
  275.     return 0;
  276. }
Apr 12 '13 #11
Never mind I have fix the problem again, a friend of mine looked over the code and I did not make an iter to go with jobs.
lines 33 and 34:

Expand|Select|Wrap|Line Numbers
  1. vector<string>color2;
  2.     vector<string>::const_iterator iter;
  3.     vector<string>::iterator myIterator;
  4.     vector<struct1>::const_iterator iter2;
  5.     vector<struct1>::iterator myIterator2;
Apr 12 '13 #12
I am having a small issue when my code hits line 232-238:

It has an error and I have know clue how to fix it

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. struct struct1
  15. {
  16.     string name;
  17.     string dis;
  18. };
  19.  
  20. int main()
  21. {
  22.     //All Data Types//
  23.  
  24.     string Name;
  25.     int num;
  26.  
  27.     vector<string>::const_iterator iter;
  28.     vector<string>::iterator myIterator;
  29.     vector<struct1>::const_iterator iter2;
  30.     vector<struct1>::iterator myIterator2;
  31.  
  32.  
  33.     //Personality quiz//
  34.  
  35.  
  36.     //Q1//
  37.     int color;
  38.     vector<string>color2;
  39.     //vector colors//
  40.     color2.push_back("Red");
  41.     color2.push_back("Yellow");
  42.     color2.push_back("Orange");
  43.     color2.push_back("Green");
  44.     color2.push_back("Pink");
  45.     color2.push_back("Blue");
  46.     color2.push_back("Purple");
  47.     color2.push_back("White");
  48.     color2.push_back("Black");
  49.     //end vector colors//
  50.  
  51.  
  52.     //Q2//
  53.     int job;
  54.     vector<struct1>jobs;
  55.  
  56.     //jobs//
  57.     struct1 job0;
  58.     job0.name = "miner";
  59.     job0.dis = "A miner uses a spade and pick to find ore, heavy built from mining in the dark.";
  60.  
  61.     struct1 job1;
  62.     job1.name = "Lumber Jack";
  63.     job1.dis = "Cuts down trees for a living, heavy built from climing trees and useing the axe.";
  64.  
  65.     struct1 job2;
  66.     job2.name = "Gardner";
  67.     job2.dis = "Tends to plants and loves nature, very agile and quite flimsy.";
  68.  
  69.     struct1 job3;
  70.     job3.name = "Blacksmith";
  71.     job3.dis = "Makes armor and weapons, heavy built from hammering steal.";
  72.  
  73.     struct1 job4;
  74.     job4.name = "Hunts";
  75.     job4.dis = ".";
  76.  
  77.     struct1 job5;
  78.     job5.name = "Farmer";
  79.     job5.dis = ".";
  80.  
  81.     struct1 job6;
  82.     job6.name = "Guard";
  83.     job6.dis = ".";
  84.  
  85.     struct1 job7;
  86.     job7.name = "Tavern Keeper";
  87.     job7.dis = ".";
  88.  
  89.     struct1 job8;
  90.     job8.name = "Assassin";
  91.     job8.dis = ".";
  92.  
  93.     struct1 job9;
  94.     job9.name = "None";
  95.     job9.dis = "... use your imagination";
  96.     //end jobs//
  97.  
  98.     //Vector//
  99.     jobs.push_back(job0);
  100.     jobs.push_back(job1);
  101.     jobs.push_back(job2);
  102.     jobs.push_back(job3);
  103.     jobs.push_back(job4);
  104.     jobs.push_back(job5);
  105.     jobs.push_back(job6);
  106.     jobs.push_back(job7);
  107.     jobs.push_back(job8);
  108.     jobs.push_back(job9);
  109.     //end Vector//
  110.  
  111.  
  112.     //Q3//
  113.  
  114.  
  115.  
  116.     //end personality quiz//
  117.     //End Data Types//
  118.  
  119.     //Intro//
  120.     cout << "Welcome adventure!";
  121.     std::getchar();//Like a system pause with no words
  122.     cout << "You will imbark on a journey of your life!";
  123.     std::getchar();
  124.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  125.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  126.     std::getchar();
  127.     cout << "By the way...\n";
  128.     cout << "What is your name?";
  129.     cout << "\nName: ";
  130.     cin >> Name;
  131.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  132.     std::getchar();
  133.     std::getchar();
  134.     system("CLS");
  135.     //Test//
  136.     //This could be for testing//
  137.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  138.     cout << "puting you, lets see what you realy made of.\n";
  139.     std::getchar();
  140.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  141.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  142.     cout << "Now to make you realy you!\n";
  143.     std::getchar();
  144.     system("CLS");
  145.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  146.     cout << "1-Personality Quiz\n";
  147.     cout << "2-Free Pick\n\n";
  148.     cout << "Choice: ";
  149.     cin >> num;
  150.     system("CLS");
  151.  
  152.     switch(num)
  153.     {
  154.         //Personality Quiz//
  155.         //Q1//
  156.     case 1:
  157.         cout << "You have picked the personality quiz!\n";
  158.         cout << "Now! First question to figure your mind!\n\n";
  159.         wrong:
  160.         cout << "What is your favorit color from the questions below\n";
  161.  
  162.         cout << "1-Red\n";
  163.         cout << "2-Yellow\n";
  164.         cout << "3-Orange\n";
  165.         cout << "4-Green\n";
  166.         cout << "5-Pink\n";
  167.         cout << "6-Blue\n";
  168.         cout << "7-Purple\n";
  169.         cout << "8-White\n";
  170.         cout << "9-Black\n";
  171.         cout << "Choice: ";
  172.         cin >> color;
  173.         --color;
  174.  
  175.         num = 0;
  176.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  177.         {
  178.             if(num == color)
  179.             {
  180.         cout << "Is "<< *iter <<" truly what you want?\n";
  181.             }
  182.             ++num;
  183.         }
  184.  
  185.         cout << "1-Yes\n";
  186.         cout << "2-No\n";
  187.         cout << "Choice: ";
  188.         cin >> num;
  189.  
  190.         switch(num)
  191.         {
  192.         case 1:
  193.             system("CLS");
  194.             break;
  195.         case 2:
  196.             system("CLS");
  197.             goto wrong;
  198.         }
  199.         num = 0;
  200.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  201.         {
  202.             if(num == color)
  203.             {
  204.         cout << "Ok " << *iter << " it is.";
  205.             }
  206.             ++num; 
  207.         }
  208.  
  209.         //Q2//
  210.         std::getchar();
  211.         std::getchar();
  212.         system("CLS");
  213.  
  214.         wrong2:
  215.         cout << "Question 2\n\n";
  216.         cout << "If you had to pick a job from this list what would it be?\n\n";
  217.         cout << "1-Mining\n";
  218.         cout << "2-Lumber Jack\n";
  219.         cout << "3-Gardener\n";
  220.         cout << "4-Blacksmith\n";
  221.         cout << "5-Fishermen\n";
  222.         cout << "6-Farmer\n";
  223.         cout << "7-Guard\n";
  224.         cout << "8-Tavern Keeper\n";
  225.         cout << "9-Assassin\n";
  226.         cout << "10-None\n";
  227.         cout << "Choice: ";
  228.         cin >> job;
  229.         --job;
  230.  
  231.         num = 0;
  232.         for (iter2 = jobs.begin(); iter2 != jobs.end(); ++iter)
  233.         {
  234.             if(num == job && job < 9)
  235.             {
  236.                 cout << (*iter2).dis << "\n";
  237.                 cout << "Is "<< (*iter2).name <<" truly what you want?\n";
  238.             }
  239.             else if (job > 9 || job < 0)
  240.             {
  241.                 cout << "Not a real answer!\n";
  242.                 system("pause");
  243.                 system("CLS");
  244.                 goto wrong2;
  245.             }
  246.             ++num;
  247.         }
  248.         cout << "1-Yes\n";
  249.         cout << "2-No\n";
  250.         cout << "Choice: ";
  251.         cin >> num;
  252.  
  253.         switch(num)
  254.         {
  255.         case 1:
  256.             system("CLS");
  257.             break;
  258.         case 2:
  259.             system("CLS");
  260.             goto wrong2;
  261.         }
  262.  
  263.         //Q3//
  264.  
  265.         break;
  266.         //End Personality Quiz//
  267.         //Free pick//
  268.     case 2:
  269.         break;
  270.         //End Free Pick//
  271.     }
  272.  
  273.     system("pause");//Like a std::getchar but says to press a word to continue
  274.     return 0;
  275. }
Apr 12 '13 #13
weaknessforcats
9,208 Expert Mod 8TB
You don't say what your problem is but if it's this:

Expand|Select|Wrap|Line Numbers
  1. if(num == job && job < 9)
  2.             {
  3.                 cout << (*iter2).dis << "\n";
  4.                 cout << "Is "<< (*iter2).name <<" truly what you want?\n";
  5.             }
  6.             else if (job > 9 || job < 0)
  7.             {
  8. etc...
then the "if" is true only if num == job.

If num is not equal to job then the AND expression will always be false.

If you intend that the "if" is true only when num == job AND the job is less than 9 then you code:

Expand|Select|Wrap|Line Numbers
  1. if((num == job) && (job < 9))
Thus will cause num==job to be evaluated and then job<9 and only then will the && be applied.

You may be falling into the operator precedence trap.
You may want to read up on operator precedence and how it works.

BTW: We have gone beyond vectors, which is what this thread is about. Please start new threads for subsequent problems. Bytes.com is trying to hold a thread to the subject of the first post.
Apr 13 '13 #14
I am a little confused on the BTW, is this not about my RPG not just the vectors?
Apr 13 '13 #15
Microsoft Visual C++ Debug Library

Program: C:\C++\RPG\Debug\RPG.exe
File: c:\program files (x86\microsoft visual studio
10.0/vc/include/vector
Line: 99 (I picked miner for a choice)

Expression: vector iterator not incrementable
Apr 13 '13 #16
weaknessforcats
9,208 Expert Mod 8TB
vector iterators are incrementable unless they are const. Is this a const_iterator?

On the BTW: Threads are supposed to be about one C++ subject since the threds are kept around for others to read. At some point the title of the first post may change to to reflect the subject of the post in C++ terms.

The single-subject is a guideline and not a requirement so if you want to keep this thread going forever, then go ahead and do that. I'd rather you continue posting.
Apr 13 '13 #17
thank you haha I just wanted to make sure that its OK if I posted about many things of my RPG and need to know if I was conflicting on something.

BTW will you guys be adding pages so that I don't have to scroll all the way down? and all I have to do is press last post. (I understand that by pressing reply it does that)
Apr 13 '13 #18
weaknessforcats
9,208 Expert Mod 8TB
Not that I know of. Pressing "reply" is a reply to the post you are on and not the one at the end of the thread.
Apr 13 '13 #19
It says to Post your reply I click it and it sends me to the bottom of the thread to replay to the post i clicked on, but a little off topic, thanks for the help.
Apr 13 '13 #20
So should I not have a const_iterator?
Expand|Select|Wrap|Line Numbers
  1.     vector<string>::const_iterator iter; // colors
  2.     vector<string>::iterator myIterator;
  3.     vector<struct1>::const_iterator iter2; // jobs
  4.     vector<struct1>::iterator myIterator2;
Apr 13 '13 #21
weaknessforcats
9,208 Expert Mod 8TB
The idea behind a const object is that you can't change the value of the object. This is bad if you need to change it but it is good when you call a function using a const argument because if the object gets screwed up you know that function didn't do it.

The const_iterator behaves like the object it points at is const even though maybe it's not. Also, part of const-ness is you can't change the value of the object so the const_iterator won't let you change it either, say by trying to increment it.

Once you start using const you will find that if you just twitch, the code won't compile. This discourages the average programmer from using const. The upside is that if it does compile it will probably work.

Most of the "const" stuff you will see will be function arguments.
Apr 13 '13 #22
I have found my silly mistake with jobs, I messed up on the for loop and did ++iter, not ++iter2. That messed up the loop and made it brake. Took me an hour to fine ha.
Apr 18 '13 #23
I as able to up data my RPG to be a little smaller and have added question 3 (There is not problems with this code):

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. struct struct1
  15. {
  16.     string name;
  17.     string dis;
  18. };
  19.  
  20. int main()
  21. {
  22.     //All Data Types//
  23.  
  24.     string Name;
  25.     int num;
  26.  
  27.     vector<string>::const_iterator iter;
  28.     vector<string>::iterator myIterator;
  29.     vector<struct1>::const_iterator iter2;
  30.     vector<struct1>::iterator myIterator2;
  31.  
  32.  
  33.     //Personality quiz//
  34.  
  35.  
  36.     //Q1//
  37.     int color;
  38.     vector<string>color2;
  39.     //vector colors//
  40.     color2.push_back("Red");
  41.     color2.push_back("Yellow");
  42.     color2.push_back("Orange");
  43.     color2.push_back("Green");
  44.     color2.push_back("Pink");
  45.     color2.push_back("Blue");
  46.     color2.push_back("Purple");
  47.     color2.push_back("White");
  48.     color2.push_back("Black");
  49.     //end vector colors//
  50.  
  51.  
  52.     //Q2//
  53.     int job;
  54.     vector<struct1>jobs;
  55.  
  56.     //jobs//
  57.     struct1 job0;
  58.     job0.name = "Miner";
  59.     job0.dis = "Uses a spade and pick to find ore, heavy built from mining in the dark.";
  60.  
  61.     struct1 job1;
  62.     job1.name = "Lumber Jack";
  63.     job1.dis = "Cuts down trees for a living, heavy built from climing trees and useing the axe.";
  64.  
  65.     struct1 job2;
  66.     job2.name = "Gardner";
  67.     job2.dis = "Tends to plants and loves nature, very agile and quite flimsy.";
  68.  
  69.     struct1 job3;
  70.     job3.name = "Blacksmith";
  71.     job3.dis = "Makes armor and weapons, heavy built from hammering steal.";
  72.  
  73.     struct1 job4;
  74.     job4.name = "Hunter";
  75.     job4.dis = "Agile and has a talent of sneeking up to animals with ease.";
  76.  
  77.     struct1 job5;
  78.     job5.name = "Farmer";
  79.     job5.dis = "is a mix between a Gardner and Hunter.";
  80.  
  81.     struct1 job6;
  82.     job6.name = "Guard";
  83.     job6.dis = "is a battle ready person ready to serve and protect.";
  84.  
  85.     struct1 job7;
  86.     job7.name = "Tavern Keeper";
  87.     job7.dis = ".";
  88.  
  89.     struct1 job8;
  90.     job8.name = "Assassin";
  91.     job8.dis = "is an expert at stelth and can be as cunning as a fox.";
  92.  
  93.     struct1 job9;
  94.     job9.name = "None";
  95.     job9.dis = "... use your imagination";
  96.     //end jobs//
  97.  
  98.     //Vector//
  99.     jobs.push_back(job0);
  100.     jobs.push_back(job1);
  101.     jobs.push_back(job2);
  102.     jobs.push_back(job3);
  103.     jobs.push_back(job4);
  104.     jobs.push_back(job5);
  105.     jobs.push_back(job6);
  106.     jobs.push_back(job7);
  107.     jobs.push_back(job8);
  108.     jobs.push_back(job9);
  109.     //end Vector//
  110.  
  111.  
  112.     //Q3//
  113.     int weapon;
  114.     vector<struct1>Weapon;
  115.     //Weapons//
  116.     struct1 weap;
  117.     weap.name = ".";
  118.     weap.dis = ".";
  119.     struct1 weap1;
  120.     weap1.name = ".";
  121.     weap1.dis = ".";
  122.     struct1 weap2;
  123.     weap2.name = ".";
  124.     weap2.dis = ".";
  125.     struct1 weap3;
  126.     weap3.name = ".";
  127.     weap3.dis = ".";
  128.     struct1 weap4;
  129.     weap4.name = ".";
  130.     weap4.dis = ".";
  131.     struct1 weap5;
  132.     weap5.name = ".";
  133.     weap5.dis = ".";
  134.     //end Weapons//
  135.     //Vector Weapons//
  136.     Weapon.push_back(weap);
  137.     Weapon.push_back(weap1);
  138.     Weapon.push_back(weap2);
  139.     Weapon.push_back(weap3);
  140.     Weapon.push_back(weap4);
  141.     Weapon.push_back(weap5);
  142.     //End Vector Weapons//
  143.  
  144.     //end personality quiz//
  145.     //End Data Types//
  146.  
  147.     //Intro//
  148.     cout << "Welcome adventure!";
  149.     std::getchar();//Like a system pause with no words
  150.     cout << "You will imbark on a journey of your life!";
  151.     std::getchar();
  152.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  153.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  154.     std::getchar();
  155.     cout << "By the way...\n";
  156.     cout << "What is your name?";
  157.     cout << "\nName: ";
  158.     cin >> Name;
  159.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  160.     std::getchar();
  161.     std::getchar();
  162.     system("CLS");
  163.     //Test//
  164.     //This could be for testing//
  165.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  166.     cout << "puting you, lets see what you realy made of.\n";
  167.     std::getchar();
  168.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  169.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  170.     cout << "Now to make you realy you!\n";
  171.     std::getchar();
  172.     system("CLS");
  173.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  174.     cout << "1-Personality Quiz\n";
  175.     cout << "2-Free Pick\n\n";
  176.     cout << "Choice: ";
  177.     cin >> num;
  178.     system("CLS");
  179.  
  180.     switch(num)
  181.     {
  182.         //Personality Quiz//
  183.         //Q1//
  184.     case 1:
  185.         cout << "You have picked the personality quiz!\n";
  186.         cout << "Now! First question to figure your mind!\n\n";
  187.         wrong:
  188.         cout << "What is your favorit color from the questions below\n\n";
  189.  
  190.         num = 1;
  191.         for(iter = color2.begin(); iter != color2.end(); ++iter)
  192.         {
  193.             cout << num << "- " << *iter << "\n";
  194.             ++num;
  195.         }
  196.         cout << "Choice: ";
  197.         cin >> color;
  198.         --color;
  199.  
  200.         num = 0;
  201.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  202.         {
  203.             if(num == color)
  204.             {
  205.                 cout << "Is "<< *iter <<" truly what you want?\n";
  206.             }
  207.             ++num;
  208.         }
  209.  
  210.         cout << "1-Yes\n";
  211.         cout << "2-No\n";
  212.         cout << "Choice: ";
  213.         cin >> num;
  214.  
  215.         switch(num)
  216.         {
  217.         case 1:
  218.             system("CLS");
  219.             break;
  220.         case 2:
  221.             system("CLS");
  222.             goto wrong;
  223.         }
  224.         num = 0;
  225.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  226.         {
  227.             if(num == color)
  228.             {
  229.                 cout << "Ok " << *iter << " it is.";
  230.             }
  231.             ++num;
  232.         }
  233.  
  234.         //Q2//
  235.         std::getchar();
  236.         std::getchar();
  237.         system("CLS");
  238.  
  239. wrong2:
  240.  
  241.         cout << "Question 2\n\n";
  242.         cout << "If you had to pick a job from this list what would it be?\n\n";
  243.         num = 1;
  244.         for(iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  245.         {
  246.             cout << num << "-" << (*iter2).name << "\n";
  247.             ++num;
  248.         }
  249.         cout << "Choice: ";
  250.         cin >> job;
  251.         --job;
  252.  
  253.         num = 0;
  254.         for (iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  255.         {
  256.             if(num == job)
  257.             {
  258.                 cout << "A " << (*iter2).name << " " <<(*iter2).dis << "\n\n";
  259.             }
  260.             ++num;
  261.         }
  262.  
  263.         cout << "1-Yes\n";
  264.         cout << "2-No\n";
  265.         cout << "Choice: ";
  266.         cin >> num;
  267.  
  268.         switch(num)
  269.         {
  270.         case 1:
  271.             system("CLS");
  272.             break;
  273.         case 2:
  274.             system("CLS");
  275.             goto wrong2;
  276.         }
  277.  
  278.         //Q3//
  279. wrong3:
  280.         cout << "Question 3!\n\n";
  281.  
  282.         cout << "What type of weapon do you use??\n\n";
  283.  
  284.         num = 1;
  285.         for(iter2 = Weapon.begin(); iter2 !=Weapon.end(); ++iter2)
  286.         {
  287.             cout <<num <<"-" << (*iter2).name << "\n";
  288.             ++num;
  289.         }
  290.         cout << "Choice: ";
  291.         cin >> weapon;
  292.  
  293.         num = 0;
  294.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  295.         {
  296.             if(num == job)
  297.             {
  298.                 cout << "A " << (*iter2).name << ", " <<(*iter2).dis << "\n\n";
  299.             }
  300.             ++num;
  301.         }
  302.  
  303.         cout << "1-Yes\n";
  304.         cout << "2-No\n";
  305.         cout << "Choice: ";
  306.         cin >> num;
  307.  
  308.         switch(num)
  309.         {
  310.         case 1:
  311.             system("CLS");
  312.             break;
  313.         case 2:
  314.             system("CLS");
  315.             goto wrong3;
  316.         }
  317.         break;
  318.         //End Personality Quiz//
  319.         //Free pick//
  320.     case 2:
  321.         break;
  322.         //End Free Pick//
  323.     }
  324.  
  325.     system("pause");//Like a std::getchar but says to press a word to continue
  326.     return 0;
  327. }
Apr 18 '13 #24
I have been having some fun and doubled my code to around 600 lines, I have now 7 questions and will be starting on the "free choice".

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. struct struct1
  15. {
  16.     string name;
  17.     string dis;
  18. };
  19.  
  20. int main()
  21. {
  22.     //All Data Types//
  23.  
  24.     string Name;
  25.     int num;
  26.  
  27.     vector<string>::const_iterator iter;
  28.     vector<string>::iterator myIterator;
  29.     vector<struct1>::const_iterator iter2;
  30.     vector<struct1>::iterator myIterator2;
  31.  
  32.     //Stats//
  33.     //(STR)Strength: A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.
  34.     //(CON)Constitution: A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.
  35.     //(DEX)Dexterity: A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).
  36.     //(INT)Intelligence: A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at "level up". In some games, it controls the rate at which experience points are earned, or the amount needed to level up.
  37.     //(CHA)Charisma: A measure of a character's social skills, and sometimes their physical appearance. Charisma generally influences prices while trading, and NPC reactions.
  38.     //(WIS)Wisdom: A measure of a character's common sense and/or spirituality. Wisdom often controls a character's ability to cast certain spells, communicate to mystical entities, or discern other characters' motives or feelings.
  39.     //(WIL)Willpower: A measure of the character's mental resistance (against pain, fear etc.) when falling victim to mind-altering magic, torture, or insanity. Some games combine willpower and wisdom.
  40.     //(PER)Perception: A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.
  41.     //(LUC)Luck: A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).
  42.     int STR;
  43.     int CON;
  44.     int DEX;
  45.     int INT;
  46.     int CHA;
  47.     int WIS;
  48.     int WIL;
  49.     int PER;
  50.     int LUC;
  51.     //Vector Stats//
  52.     vector<struct1>stats;
  53.  
  54.     struct1 stats0;
  55.     stats0.name = "(STR)Strength";
  56.     stats0.dis = "A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.";
  57.     struct1 stats1;
  58.     stats1.name = "(CON)Constitution";
  59.     stats1.dis = "A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.";
  60.     struct1 stats2;
  61.     stats2.name = "(DEX)Dexterity";
  62.     stats2.dis = "A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).";
  63.     struct1 stats3;
  64.     stats3.name = "(INT)Intelligence";
  65.     stats3.dis = "A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at 'level up'. In some games, it controls the rate at which experience points are earned, or the amount needed to level up.";
  66.     struct1 stats4;
  67.     stats4.name = "(CHA)Charisma";
  68.     stats4.dis = "A measure of a character's social skills, and sometimes their physical appearance. Charisma generally influences prices while trading, and NPC reactions.";
  69.     struct1 stats5;
  70.     stats5.name = "(WIS)Wisdom";
  71.     stats5.dis = "A measure of a character's common sense and/or spirituality. Wisdom often controls a character's ability to cast certain spells, communicate to mystical entities, or discern other characters' motives or feelings.";
  72.     struct1 stats6;
  73.     stats6.name = "(WIL)Willpower";
  74.     stats6.dis = "A measure of the character's mental resistance (against pain, fear etc.) when falling victim to mind-altering magic, torture, or insanity. Some games combine willpower and wisdom.";
  75.     struct1 stats7;
  76.     stats7.name = "(PER)Perception";
  77.     stats7.dis = "A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.";
  78.     struct1 stats8;
  79.     stats8.name = "(LUC)Luck";
  80.     stats8.dis = "A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).";
  81.     //End Vector Stats//
  82.     //End Stats//
  83.  
  84.     //Weapon Skill Stats//
  85.     int One_Handed;
  86.     int Two_Handed;
  87.     int Polearms;
  88.     int Archery;
  89.     int Crossbows;
  90.     int Throwing;
  91.     int Sorcery;
  92.     //End Weapon Skill Stats//
  93.  
  94.     //Personality quiz//
  95.     //Q1//
  96.     int color;
  97.     vector<string>color2;
  98.     //vector colors//
  99.     color2.push_back("Red");
  100.     color2.push_back("Yellow");
  101.     color2.push_back("Orange");
  102.     color2.push_back("Green");
  103.     color2.push_back("Pink");
  104.     color2.push_back("Blue");
  105.     color2.push_back("Purple");
  106.     color2.push_back("White");
  107.     color2.push_back("Black");
  108.     //end vector colors//
  109.  
  110.  
  111.     //Q2//
  112.     int job;
  113.     vector<struct1>jobs;
  114.  
  115.     //jobs//
  116.     struct1 job0;
  117.     job0.name = "Miner";
  118.     job0.dis = "Uses a spade and pick to find ore, heavy built from mining in the dark.";
  119.  
  120.     struct1 job1;
  121.     job1.name = "Lumber Jack";
  122.     job1.dis = "Cuts down trees for a living, heavy built from climing trees and useing the axe.";
  123.  
  124.     struct1 job2;
  125.     job2.name = "Gardner";
  126.     job2.dis = "Tends to plants and loves nature, very agile and quite flimsy.";
  127.  
  128.     struct1 job3;
  129.     job3.name = "Blacksmith";
  130.     job3.dis = "Makes armor and weapons, heavy built from hammering steal.";
  131.  
  132.     struct1 job4;
  133.     job4.name = "Hunter";
  134.     job4.dis = "Agile and has a talent of sneeking up to animals with ease.";
  135.  
  136.     struct1 job5;
  137.     job5.name = "Farmer";
  138.     job5.dis = "is a mix between a Gardner and Hunter.";
  139.  
  140.     struct1 job6;
  141.     job6.name = "Guard";
  142.     job6.dis = "is a battle ready person ready to serve and protect.";
  143.  
  144.     struct1 job7;
  145.     job7.name = "Tavern Keeper";
  146.     job7.dis = ".";
  147.  
  148.     struct1 job8;
  149.     job8.name = "Assassin";
  150.     job8.dis = "is an expert at stelth and can be as cunning as a fox.";
  151.  
  152.     struct1 job9;
  153.     job9.name = "None";
  154.     job9.dis = "... use your imagination";
  155.     //end jobs//
  156.  
  157.     //Vector//
  158.     jobs.push_back(job0);
  159.     jobs.push_back(job1);
  160.     jobs.push_back(job2);
  161.     jobs.push_back(job3);
  162.     jobs.push_back(job4);
  163.     jobs.push_back(job5);
  164.     jobs.push_back(job6);
  165.     jobs.push_back(job7);
  166.     jobs.push_back(job8);
  167.     jobs.push_back(job9);
  168.     //end Vector//
  169.  
  170.  
  171.     //Q3//
  172.     int weapon;
  173.     vector<struct1>Weapon;
  174.     //Weapons//
  175.     struct1 weap;
  176.     weap.name = "One Handed Weapons";
  177.     weap.dis = "Consists of daggers, short swords, certain maces and battle axes";
  178.     struct1 weap1;
  179.     weap1.name = "Two Handed Weapons";
  180.     weap1.dis = ".";
  181.     struct1 weap2;
  182.     weap2.name = "Polearms";
  183.     weap2.dis = ".";
  184.     struct1 weap3;
  185.     weap3.name = "Archery";
  186.     weap3.dis = ".";
  187.     struct1 weap4;
  188.     weap4.name = "Crossbows";
  189.     weap4.dis = ".";
  190.     struct1 weap5;
  191.     weap5.name = "Throwing";
  192.     weap5.dis = ".";
  193.     struct1 weap6;
  194.     weap6.name = "Sorcery Weapons";
  195.     weap6.dis = ".";
  196.  
  197.     //end Weapons//
  198.     //Vector Weapons//
  199.     Weapon.push_back(weap);
  200.     Weapon.push_back(weap1);
  201.     Weapon.push_back(weap2);
  202.     Weapon.push_back(weap3);
  203.     Weapon.push_back(weap4);
  204.     Weapon.push_back(weap5);
  205.     Weapon.push_back(weap6);
  206.     //End Vector Weapons//
  207.     //Q4//
  208.     int society;
  209.     string clas [6] = {"Royal Blood", "Baron/Lady", "Knight", "Squire", "Peasant", "Serf"};
  210.     //Q5//
  211.     int age;
  212.     //Q6//
  213.     int moat;
  214.     string emoat [16] = {"Exhaustion", "Confusion", "Ecstatic", "Guilty", "Suspiciousness", "Anger", "Hysterical", "Frustrated", "Sadness", "Confident", "Embarrassed", "Happyness", "Mischievous", "Disgusted", "Frightened", "Crazyness"};
  215.     //Q7//
  216.     int gender;
  217.     //Q8//
  218.     //Q9//
  219.     //Q10//
  220.     //end personality quiz//
  221.     //End Data Types//
  222.  
  223.     //Intro//
  224.     cout << "Welcome adventure!";
  225.     std::getchar();//Like a system pause with no words
  226.     cout << "You will imbark on a journey of your life!";
  227.     std::getchar();
  228.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  229.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  230.     std::getchar();
  231.     cout << "By the way...\n";
  232.     cout << "What is your name?";
  233.     cout << "\nName: ";
  234.     cin >> Name;
  235.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  236.     std::getchar();
  237.     std::getchar();
  238.     system("CLS");
  239.     //Test//
  240.     //This could be for testing//
  241.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  242.     cout << "puting you, lets see what you realy made of.\n";
  243.     std::getchar();
  244.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  245.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  246.     cout << "Now to make you realy you!\n";
  247.     std::getchar();
  248.     system("CLS");
  249. pick:
  250.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  251.     cout << "1-Personality Quiz\n";
  252.     cout << "2-Free Pick\n\n";
  253.     cout << "Choice: ";
  254.     cin >> num;
  255.     system("CLS");
  256.  
  257.     switch(num)
  258.     {
  259.         //Personality Quiz//
  260. //Q1//
  261.     case 1:
  262.         cout << "You have picked the personality quiz!\n";
  263.         cout << "Is this what you want?\n\n";
  264.         cout << "1-Yes\n";
  265.         cout << "2-No\n";
  266.         cout << "Choice: ";
  267.         cin >> num;
  268.         switch(num)
  269.         {
  270.         case 1:
  271.             system("CLS");
  272.             break;
  273.         case 2:
  274.             system("CLS");
  275.             goto pick;
  276.         }
  277.         cout << "Now! First question to figure your mind!\n\n";
  278. wrong:
  279.         cout << "What is your favorit color from the questions below\n\n";
  280.  
  281.         num = 1;
  282.         for(iter = color2.begin(); iter != color2.end(); ++iter)
  283.         {
  284.             cout << num << "- " << *iter << "\n";
  285.             ++num;
  286.         }
  287.         cout << "Choice: ";
  288.         cin >> color;
  289.         --color;
  290.  
  291.         num = 0;
  292.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  293.         {
  294.             if(num == color)
  295.             {
  296.                 cout << "Is "<< *iter <<" truly what you want?\n";
  297.             }
  298.             ++num;
  299.         }
  300.  
  301.         cout << "1-Yes\n";
  302.         cout << "2-No\n";
  303.         cout << "Choice: ";
  304.         cin >> num;
  305.  
  306.         switch(num)
  307.         {
  308.         case 1:
  309.             system("CLS");
  310.             break;
  311.         case 2:
  312.             system("CLS");
  313.             goto wrong;
  314.         }
  315. //Q2//
  316. wrong2:
  317.         cout << "Question 2!\n\n";
  318.         cout << "If you had to pick a job from this list what would it be?\n\n";
  319.         num = 1;
  320.         for(iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  321.         {
  322.             cout << num << "-" << (*iter2).name << "\n";
  323.             ++num;
  324.         }
  325.         cout << "Choice: ";
  326.         cin >> job;
  327.         --job;
  328.  
  329.         num = 0;
  330.         for (iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  331.         {
  332.             if(num == job)
  333.             {
  334.                 cout << "A " << (*iter2).name << " " <<(*iter2).dis << "\n\n";
  335.             }
  336.             ++num;
  337.         }
  338.  
  339.         cout << "1-Yes\n";
  340.         cout << "2-No\n";
  341.         cout << "Choice: ";
  342.         cin >> num;
  343.  
  344.         switch(num)
  345.         {
  346.         case 1:
  347.             system("CLS");
  348.             break;
  349.         case 2:
  350.             system("CLS");
  351.             goto wrong2;
  352.         }
  353.  
  354. //Q3//
  355. wrong3:
  356.         cout << "Question 3!\n\n";
  357.  
  358.         cout << "What type of weapon do you use??\n\n";
  359.  
  360.         num = 1;
  361.         for(iter2 = Weapon.begin(); iter2 !=Weapon.end(); ++iter2)
  362.         {
  363.             cout <<num <<"-" << (*iter2).name << "\n";
  364.             ++num;
  365.         }
  366.         cout << "Choice: ";
  367.         cin >> weapon;
  368.         --weapon;
  369.  
  370.         num = 0;
  371.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  372.         {
  373.             if(num == weapon)
  374.             {
  375.                 cout << (*iter2).name << ", " <<(*iter2).dis << "\n\n";
  376.  
  377.             }
  378.             ++num;
  379.         }
  380.  
  381.         cout << "1-Yes\n";
  382.         cout << "2-No\n";
  383.         cout << "Choice: ";
  384.         cin >> num;
  385.  
  386.         switch(num)
  387.         {
  388.         case 1:
  389.             system("CLS");
  390.             break;
  391.         case 2:
  392.             system("CLS");
  393.             goto wrong3;
  394.         }
  395.  
  396. //Q4//
  397. wrong4:
  398.         cout << "Question 4!\n\n";
  399.  
  400.         cout << "What class do you reside under?\n";
  401.         num= 1;
  402.         for (int i = 0; i < 6; i++)
  403.         {
  404.             cout << num << "-";
  405.             cout << clas[i] << endl;                  
  406.             ++num;
  407.         }
  408.         cout << "Choice: ";
  409.         cin >> society;
  410.         --society;
  411.  
  412.         cout << clas[society]<< " is the rank you have chosen do you truely want this?\n";
  413.         cout << "1-Yes\n";
  414.         cout << "2-No\n";
  415.         cout << "Choice: ";
  416.         cin >> num;
  417.  
  418.         switch(num)
  419.         {
  420.         case 1:
  421.             system("CLS");
  422.             break;
  423.         case 2:
  424.             system("CLS");
  425.             goto wrong4;
  426.         }
  427.         //What class/rank in society are you?//
  428.         //peasant, king, lord, urchin(poor child), slave, 
  429. //Q5//
  430. wrong5:
  431.         cout << "Question 5!\n\n";
  432.  
  433.         cout << "What is your age?\n\n";
  434.  
  435.         cout << "Choice: ";
  436.         cin >> age;
  437.  
  438.         if (age < 1 || age > 120)
  439.         {
  440.             cout << "You can't be that age!";
  441.             std::getchar();
  442.             std::getchar();
  443.             system("CLS");
  444.             goto wrong5;
  445.         }
  446.         else if (age >= 1 && age <= 12)
  447.         {
  448.             cout << "So young to go on an adventure, are you telling the truth?\n";
  449.         }
  450.         else if (age > 12 && age < 20)
  451.         {
  452.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  453.         }
  454.         else if (age >= 20 && age < 40)
  455.         {
  456.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  457.         }
  458.         else if (age >= 40 && age < 80)
  459.         {
  460.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  461.         }
  462.         else if (age >= 80 && age <= 120)
  463.         {
  464.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  465.         }
  466.  
  467.         cout << "1-Yes\n";
  468.         cout << "2-No\n";
  469.         cout << "Choice: ";
  470.         cin >> num;
  471.         switch(num)
  472.             {
  473.             case 1:
  474.                 system("CLS");
  475.                 break;
  476.             case 2:
  477.                 system("CLS");
  478.                 goto wrong5;
  479.                 break;
  480.             }
  481. //Q6//
  482. wrong6:
  483.         cout << "Question 6!\n\n";
  484.  
  485.         cout << "Emotions define a character, what is yours?\n";
  486.         num= 1;
  487.         for (int i = 0; i < 16; i++)
  488.         {
  489.             cout << num << "-";
  490.             cout << emoat[i] << endl;                  
  491.             ++num;
  492.         }
  493.         cout << "Choice: ";
  494.         cin >> moat;
  495.         --moat;
  496.         cout << emoat[moat] << " discribes what you are inside, are you mistaken?\n";
  497.         cout << "1-Yes\n";
  498.         cout << "2-No\n";
  499.         cout << "Choice: ";
  500.         cin >> num;
  501.         switch(num)
  502.             {
  503.             case 1:
  504.                 system("CLS");
  505.                 break;
  506.             case 2:
  507.                 system("CLS");
  508.                 goto wrong6;
  509.                 break;
  510.             }
  511. //Q7//
  512. wrong7:
  513.         cout << "Question 7!\n\n";
  514.  
  515.         cout << "What is your gender?\n";
  516.         cout << "1-Male\n";
  517.         cout << "2-Female\n";
  518.         cout << "3-Hidden\n";
  519.         cout << "Choice: ";
  520.         cin >> gender;
  521.         cout << "\n";
  522.  
  523.         if (gender == 1)
  524.         {
  525.             cout << "Male side.";
  526.         }
  527.         else if (gender == 2)
  528.         {
  529.             cout << "Female side.";
  530.         }
  531.         else if (gender == 3)
  532.         {
  533.             cout << "You have no side, you are a mystery.";
  534.         }
  535.         else
  536.         {
  537.             cout << "That is not posible please pick another number";
  538.             std::getchar();
  539.             std::getchar();
  540.             system("CLS");
  541.             goto wrong7;
  542.         }
  543.         cout << "\nIs this what you are?\n";
  544.         cout << "1-Yes\n";
  545.         cout << "2-No\n";
  546.         cout << "Choice: ";
  547.         cin >> num;
  548.         switch(num)
  549.             {
  550.             case 1:
  551.                 system("CLS");
  552.                 break;
  553.             case 2:
  554.                 system("CLS");
  555.                 goto wrong7;
  556.                 break;
  557.             }
  558. //Q8//
  559.  
  560. //Q9//
  561.  
  562. //Q10//
  563.  
  564.         break;
  565.         //End Personality Quiz//
  566.         //Free pick//
  567.     case 2:
  568.         cout << "You have chosen to freely pick your charicters stats.\n";
  569.         cout << "Is this what you want?\n\n";
  570.         cout << "1-Yes\n";
  571.         cout << "2-No\n";
  572.         cout << "choice: ";
  573.         cin >> num;
  574.         switch(num)
  575.             {
  576.             case 1:
  577.                 system("CLS");
  578.                 break;
  579.             case 2:
  580.                 system("CLS");
  581.                 goto pick;
  582.                 break;
  583.             }
  584. age:
  585.         cout << "What is your age?\n\n";
  586.  
  587.         cout << "Choice: ";
  588.         cin >> age;
  589.  
  590.         if (age < 1 || age > 120)
  591.         {
  592.             cout << "You can't be that age!";
  593.             std::getchar();
  594.             std::getchar();
  595.             system("CLS");
  596.             goto wrong5;
  597.         }
  598.         else if (age >= 1 && age <= 12)
  599.         {
  600.             cout << "So young to go on an adventure, are you telling the truth?\n";
  601.         }
  602.         else if (age > 12 && age < 20)
  603.         {
  604.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  605.         }
  606.         else if (age >= 20 && age < 40)
  607.         {
  608.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  609.         }
  610.         else if (age >= 40 && age < 80)
  611.         {
  612.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  613.         }
  614.         else if (age >= 80 && age <= 120)
  615.         {
  616.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  617.         }
  618.  
  619.         cout << "1-Yes\n";
  620.         cout << "2-No\n";
  621.         cout << "Choice: ";
  622.         cin >> num;
  623.         switch(num)
  624.             {
  625.             case 1:
  626.                 system("CLS");
  627.                 break;
  628.             case 2:
  629.                 system("CLS");
  630.                 goto age;
  631.                 break;
  632.             }
  633. gender:
  634.         cout << "What is your gender?\n";
  635.         cout << "1-Male\n";
  636.         cout << "2-Female\n";
  637.         cout << "3-Hidden\n";
  638.         cout << "Choice: ";
  639.         cin >> gender;
  640.         cout << "\n";
  641.  
  642.         if (gender == 1)
  643.         {
  644.             cout << "Male side.";
  645.         }
  646.         else if (gender == 2)
  647.         {
  648.             cout << "Female side.";
  649.         }
  650.         else if (gender == 3)
  651.         {
  652.             cout << "You have no side, you are a mystery.";
  653.         }
  654.         else
  655.         {
  656.             cout << "That is not posible please pick another number";
  657.             std::getchar();
  658.             std::getchar();
  659.             system("CLS");
  660.             goto wrong7;
  661.         }
  662.         cout << "\nIs this what you are?\n";
  663.         cout << "1-Yes\n";
  664.         cout << "2-No\n";
  665.         cout << "Choice: ";
  666.         cin >> num;
  667.         switch(num)
  668.             {
  669.             case 1:
  670.                 system("CLS");
  671.                 break;
  672.             case 2:
  673.                 system("CLS");
  674.                 goto gender;
  675.                 break;
  676.             }
  677.  
  678.         break;
  679.     }
  680.         //End Free Pick//
  681.  
  682.     system("pause");//Like a std::getchar but says to press a word to continue
  683.     return 0;
  684. }
Apr 20 '13 #25
I am now having a small issue how would I be able to make my text that displays on screen, if in a vector how would i indent it. IE:

Expand|Select|Wrap|Line Numbers
  1. //Vector Race//
  2.     vector<struct1>Race;
  3.  
  4.     //struct1 Race*;
  5.     //Race*.name = "";
  6.     //Race*.dis = "";
  7.  
  8.     struct1 Race0;
  9.     Race0.name = "Elves";
  10.     Race0.dis = "Elves are slightly shorter than humans, and have a much lighter build. They lackthe strength and stamina of the larger races, but are far more agile, both in   body and mind. Elves tend to make their homes deep within secluded forests, but always remain in touch with the world around them. The easiest way to recognize an elf is by their pointy ears. Because of their affinity with nature, Elves    posses the ability to blend in with their surroundings, can see in the dark, and are difficult to control through magic. They tend to have strong morals, and   can instinctively sense evil creatures. While their intelligence allows them to pursue almost any type of magical or religious training they desire, Elves are  limited in their choices of other vocations. Elves are physically weaker than   the humans we talked about above, but they have incredible magical strength thatcan help make up for that. Elves also love nature - so it's unlikely you'll haveone that's squeamish about things like getting dirty or being stuck out         overnight in the woods. They can see in the dark, so no wild boars will be      catching them off guard. That being said, your elfin character could have       problems with crowds, and towns in general. It's hard to go from the quiet of   nature to the bustling streets of Rune.";
  11.     struct1 Race1;
  12.     Race1.name = "Humans";
  13.     Race1.dis = "Averaging between five and six feet in height, Humans are the most populous race in the world. The Humans have established settlements on every continent, and their appearances vary widely depending on ancestry. Almost any hair, eye, or skin color that you can imagine can be found on a group of Humans somewhere. Although they have no special biological talents like the other races, Humans are far more versatile, able to be trained in almost all classes. The Humans were the first to discover how to focus magical energies, and as a result they can utilize items to enhance their attributes more effectively than any other race. Additionally, the Human religions encourage a very personal connection with the Powers, and allow quicker reincarnation to occur.";
  14.     struct1 Race2;
  15.     Race2.name = "Half-Orcs";
  16.     Race2.dis = "Half-orcs often exist at the social margins. Bestial in appearance and traditionally feared by those non-orcs they encounter, half-orcs tend to be tenacious and driven to prove themselves. Some hope to show that they are different from their brutish orc kin, struggling to find the better angels of their nature, while others embrace their monstrous heritage to become terrifying exemplars of ferocity in combat. One way or another, almost all half-orcs crave respect—whether it's given freely or must be taken by force. Derided as mongrels by humans and weaklings by orcs, half-orcs have bitterness beaten into them from birth, as well as the burning will to endure and overcome. With their physical size and strength, half-orcs represent raw and primal power, yet whether that power gets used for good or evil depends entirely on the individual.";
  17.     struct1 Race3;
  18.     Race3.name = "Dwarves";
  19.     Race3.dis = "Dwarves are short, stocky demi-humans, known for their foul tempers. They often prefer building their cities underground, and enjoy working with the earth. Dwarves are excellent miners, and possess more detailed knowledge on gems and metalsmithing than any other race. They can easily be identified by the long beards that both males and females alike wear proudly. While Dwarves are not as smart as some of the other races, they are usually wiser due to their long lifespans. Their great physical strength and stamina makes them resistant to the effects of poison, disease, and magic, and centuries of working underground have given the Dwarves a keen ability to see in the dark. While they are excellent fighters, Dwarves are not very dexterous and often distrust the use of magical spells.";
  20.     struct1 Race4;
  21.     Race4.name = "Drow";
  22.     Race4.dis = "A Drow is an outcast Elf who, against normal Elven nature, worships the forces of darkness. Reviled by most, the Drow work in secret, learning as much as they can about black magic. They tend to dwell in underground lairs or in deep, dark forests, and avoid contact with other races unless it will help them further their knowledge of evil. They are stockier than other Elves, and tend to have darker skin as well. Although few Elves are willing to admit it, Drow possess some of the same abilities that they do. They can see in the dark, and are able to locate hidden creatures with ease. Drow are difficult to control through magical means, and in addition can avoid the effects of the necromantic forces that they know so well. However, Drow are highly vulnerable to the forces of goodness, and are often easily dispatched by holy weapons and spells.";
  23.     struct1 Race5;
  24.     Race5.name = "Gnome";
  25.     Race5.dis = "Gnomes have been the enemies of Dwarves for many centuries. The two races are descended from a common ancestor, and the conflict between them originally arose when the Gnomes wished to focus on mechanical innovation rather than subterranean exploration. They found that their interests corresponded closely with those of the Humans, and left the Dwarven cities to live with humankind. As there has been increased interaction between the races, Gnomes have gradually learned to become more tolerant of their distant cousins. While Gnomes are much shorter than Humans, their wiry forms are more strong and durable. They have an incredible ability to regenerate, and are resistant to poison, disease, and magical attacks. Their intelligence and quickness make them well-suited for many different professions, although they are not as skilled in fighting as some of the other races.";
  26.     struct1 Race6;
  27.     Race6.name = "Halfling";
  28.     Race6.dis = "Halflings are the most diminutive humanoid race, averaging about four feet in height. Like the elves, they tend to live in secluded communities, and are very much in tune with nature. While Halflings lack physical strength and stamina, they are quite dexterous and intelligent, relying on their wits and skill to survive. They are also one of the hairiest races of all, sprouting tufts all over their bodies. Because they are so small and agile, Halflings can move much faster than most of the larger races, often getting in two attacks before an opponent can make one. They also have the ability to avoid detection, and can easily find creatures that are attempting to hide. Because of their strong connection with the natural world, Halflings are resistant to all magical attacks.";
  29.     struct1 Race7;
  30.     Race7.name = "Minotaur";
  31.     Race7.dis = "Minotaurs are an elite, somewhat aloof group of humanoid creatures, who believe themselves to be far better than other races. They were originally created as a magical experiment designed to make the perfect race, and their ancestry is revealed by the fact that they have the head and tail of a bull. Minotaurs are covered with thick, warm fur, and thrive on the arctic continent of Avros. Standing almost seven feet tall, Minotaurs are resistant to disease, poison, and bashing weapons. While they are by nature excellent fighters, their arrogance sometimes causes them to underestimate their opponents. Minotaurs also refuse to train in classes that they consider beneath them, and are somewhat limited in their choice of profession.";
  32.     struct1 Race8;
  33.     Race8.name = "Ogres";
  34.     Race8.dis = "Ogres are the largest and strongest of the races, averaging over seven feet in height. They resemble enormous humans, but tend to be almost hairless. While Ogres often organize into tightly-knit communities, they tend not to interact much with the other races. Their cities are usually located in mountainous or hilly areas, and their buildings are made from stones so large that no other people would be able to move them. Because of their massive size and strength, Ogres make excellent fighters, and they are always greatly feared by their enemies. Their thick skins provide them a bonus to their armor resistance which increases as they gain in experience and makes them resistant to extreme heat and cold. They also tend to be a bit dull-witted and thus somewhat open to mental attacks. Their lack of intellect also prevents Ogres from using magic very well, and their massive size makes them ineffective as thieves.";
  35.  
  36.     Race.push_back(Race0);
  37.     Race.push_back(Race1);
  38.     Race.push_back(Race2);
  39.     Race.push_back(Race3);
  40.     Race.push_back(Race4);
  41.     Race.push_back(Race5);
  42.     Race.push_back(Race6);
  43.     Race.push_back(Race7);
  44.     Race.push_back(Race8);
  45.     //End Vector Race//
Apr 20 '13 #26
weaknessforcats
9,208 Expert Mod 8TB
At this stage I would take the easy way out and pre-format the display so that the indent is really just some embedded spaces.

Later on, you can get fancy.
Apr 20 '13 #27
Now I am trying to void all of my vectors so that I can call on them when ever, for example, if I want to call on my list of races:

Expand|Select|Wrap|Line Numbers
  1.  struct1 Race0;
  2.     Race0.name = "Elves";
  3.     Race0.dis = "Elves are slightly shorter than humans, and have a much lighter build. They lackthe strength and stamina of the larger races, but are far more agile, both in   body and mind. Elves tend to make their homes deep within secluded forests, but always remain in touch with the world around them. The easiest way to recognize an elf is by their pointy ears. Because of their affinity with nature, Elves    posses the ability to blend in with their surroundings, can see in the dark, and are difficult to control through magic. They tend to have strong morals, and   can instinctively sense evil creatures. While their intelligence allows them to pursue almost any type of magical or religious training they desire, Elves are  limited in their choices of other vocations. Elves are physically weaker than   the humans we talked about above, but they have incredible magical strength thatcan help make up for that. Elves also love nature - so it's unlikely you'll haveone that's squeamish about things like getting dirty or being stuck out         overnight in the woods. They can see in the dark, so no wild boars will be      catching them off guard. That being said, your elfin character could have       problems with crowds, and towns in general. It's hard to go from the quiet of   nature to the bustling streets of Rune.";
  4.     struct1 Race1;
  5.     Race1.name = "Humans";
  6.     Race1.dis = "Averaging between five and six feet in height, Humans are the most populous race in the world. The Humans have established settlements on every continent, and their appearances vary widely depending on ancestry. Almost any hair, eye, or skin color that you can imagine can be found on a group of Humans somewhere. Although they have no special biological talents like the other races, Humans are far more versatile, able to be trained in almost all classes. The Humans were the first to discover how to focus magical energies, and as a result they can utilize items to enhance their attributes more effectively than any other race. Additionally, the Human religions encourage a very personal connection with the Powers, and allow quicker reincarnation to occur.";
  7.     struct1 Race2;
  8.     Race2.name = "Half-Orcs";
  9.     Race2.dis = "Half-orcs often exist at the social margins. Bestial in appearance and traditionally feared by those non-orcs they encounter, half-orcs tend to be tenacious and driven to prove themselves. Some hope to show that they are different from their brutish orc kin, struggling to find the better angels of their nature, while others embrace their monstrous heritage to become terrifying exemplars of ferocity in combat. One way or another, almost all half-orcs crave respect—whether it's given freely or must be taken by force. Derided as mongrels by humans and weaklings by orcs, half-orcs have bitterness beaten into them from birth, as well as the burning will to endure and overcome. With their physical size and strength, half-orcs represent raw and primal power, yet whether that power gets used for good or evil depends entirely on the individual.";
  10.     struct1 Race3;
  11.     Race3.name = "Dwarves";
  12.     Race3.dis = "Dwarves are short, stocky demi-humans, known for their foul tempers. They often prefer building their cities underground, and enjoy working with the earth. Dwarves are excellent miners, and possess more detailed knowledge on gems and metalsmithing than any other race. They can easily be identified by the long beards that both males and females alike wear proudly. While Dwarves are not as smart as some of the other races, they are usually wiser due to their long lifespans. Their great physical strength and stamina makes them resistant to the effects of poison, disease, and magic, and centuries of working underground have given the Dwarves a keen ability to see in the dark. While they are excellent fighters, Dwarves are not very dexterous and often distrust the use of magical spells.";
  13.     struct1 Race4;
  14.     Race4.name = "Drow";
  15.     Race4.dis = "A Drow is an outcast Elf who, against normal Elven nature, worships the forces of darkness. Reviled by most, the Drow work in secret, learning as much as they can about black magic. They tend to dwell in underground lairs or in deep, dark forests, and avoid contact with other races unless it will help them further their knowledge of evil. They are stockier than other Elves, and tend to have darker skin as well. Although few Elves are willing to admit it, Drow possess some of the same abilities that they do. They can see in the dark, and are able to locate hidden creatures with ease. Drow are difficult to control through magical means, and in addition can avoid the effects of the necromantic forces that they know so well. However, Drow are highly vulnerable to the forces of goodness, and are often easily dispatched by holy weapons and spells.";
  16.     struct1 Race5;
  17.     Race5.name = "Gnome";
  18.     Race5.dis = "Gnomes have been the enemies of Dwarves for many centuries. The two races are descended from a common ancestor, and the conflict between them originally arose when the Gnomes wished to focus on mechanical innovation rather than subterranean exploration. They found that their interests corresponded closely with those of the Humans, and left the Dwarven cities to live with humankind. As there has been increased interaction between the races, Gnomes have gradually learned to become more tolerant of their distant cousins. While Gnomes are much shorter than Humans, their wiry forms are more strong and durable. They have an incredible ability to regenerate, and are resistant to poison, disease, and magical attacks. Their intelligence and quickness make them well-suited for many different professions, although they are not as skilled in fighting as some of the other races.";
  19.     struct1 Race6;
  20.     Race6.name = "Halfling";
  21.     Race6.dis = "Halflings are the most diminutive humanoid race, averaging about four feet in height. Like the elves, they tend to live in secluded communities, and are very much in tune with nature. While Halflings lack physical strength and stamina, they are quite dexterous and intelligent, relying on their wits and skill to survive. They are also one of the hairiest races of all, sprouting tufts all over their bodies. Because they are so small and agile, Halflings can move much faster than most of the larger races, often getting in two attacks before an opponent can make one. They also have the ability to avoid detection, and can easily find creatures that are attempting to hide. Because of their strong connection with the natural world, Halflings are resistant to all magical attacks.";
  22.     struct1 Race7;
  23.     Race7.name = "Minotaur";
  24.     Race7.dis = "Minotaurs are an elite, somewhat aloof group of humanoid creatures, who believe themselves to be far better than other races. They were originally created as a magical experiment designed to make the perfect race, and their ancestry is revealed by the fact that they have the head and tail of a bull. Minotaurs are covered with thick, warm fur, and thrive on the arctic continent of Avros. Standing almost seven feet tall, Minotaurs are resistant to disease, poison, and bashing weapons. While they are by nature excellent fighters, their arrogance sometimes causes them to underestimate their opponents. Minotaurs also refuse to train in classes that they consider beneath them, and are somewhat limited in their choice of profession.";
  25.     struct1 Race8;
  26.     Race8.name = "Ogres";
  27.     Race8.dis = "Ogres are the largest and strongest of the races, averaging over seven feet in height. They resemble enormous humans, but tend to be almost hairless. While Ogres often organize into tightly-knit communities, they tend not to interact much with the other races. Their cities are usually located in mountainous or hilly areas, and their buildings are made from stones so large that no other people would be able to move them. Because of their massive size and strength, Ogres make excellent fighters, and they are always greatly feared by their enemies. Their thick skins provide them a bonus to their armor resistance which increases as they gain in experience and makes them resistant to extreme heat and cold. They also tend to be a bit dull-witted and thus somewhat open to mental attacks. Their lack of intellect also prevents Ogres from using magic very well, and their massive size makes them ineffective as thieves.";
  28.  
How do i make it so it is a void?

Expand|Select|Wrap|Line Numbers
  1. void race0(string);
Expand|Select|Wrap|Line Numbers
  1. void race0(string)
  2. {
  3.     num = 0;
  4.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  5.         {
  6.             if(num == race)
  7.             {
  8.                 cout << (*iter2).dis << "\n\n";
  9.  
  10.             }
  11.             ++num;
  12.         }
  13. }
Apr 21 '13 #28
weaknessforcats
9,208 Expert Mod 8TB
I don't understand what you are trying to do.

void in C++ means "no type". The only place you ever use it is as a return type on your functions. The void return tells the compiler that the function will return "no type" and so the function cannot be used on the right sde of an assignment operator.

Maybe you could explain further.
Apr 21 '13 #29
Then how could I have a function stated only once and be repeated when ever I want to call it up. So is I have my stats, and I want to call it up and it would take less code.

I wanted to use void because I did not need a any thing changed when it was called, just to be called.
Apr 21 '13 #30
Expand|Select|Wrap|Line Numbers
  1. //VOID STATS!!!!!//
  2.         cout << "Stats!\n\n";
  3.  
  4.         num = 1;
  5.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  6.         {
  7.             cout << (*iter2).name;
  8.             switch(num)
  9.             {
  10.             case 1:
  11.                 cout << " = " << STR;
  12.                 break;
  13.             case 2:
  14.                 cout << " = " << CON;
  15.                 break;
  16.             case 3:
  17.                 cout << " = " << DEX;
  18.                 break;
  19.             case 4:
  20.                 cout << " = " << INT;
  21.                 break;
  22.             case 5:
  23.                 cout << " = " << CHA;
  24.                 break;
  25.             case 6:
  26.                 cout << " = " << WIS;
  27.                 break;
  28.             case 7:
  29.                 cout << " = " << WIL;
  30.                 break;
  31.             case 8:
  32.                 cout << " = " << PER;
  33.                 break;
  34.             case 9:
  35.                 cout << " = " << LUC;
  36.             }
  37.             ++num;
  38.             cout << "\n";
  39.         }
  40. //END VOID STATS
  41.         cout << "1-Definition\n";
  42.         cout << "2-Add\n";
  43.         cout << "3-Subtract\n";
  44.         cout << "4-Done\n";
  45.         cout << "Choice: ";
  46.         cin >> num;
  47.         system("CLS");
  48.         switch(num)
  49.         {
  50.         case 1:
  51.             cout << "What one do you wish to define?\n\n";
  52.             //VOID STATS//
  53.             cout << "Choice: ";
  54.             cin >> num;
  55.             break;
  56.         case 2:
  57.             cout << "What one do you wish to add?\n\n";
  58.             //VOID STATS//
  59.             cout << "Choice: ";
  60.             cin >> num;
  61.             break;
  62.         case 3:
  63.             cout << "What one do you wish to subtract?\n\n";
  64.             //VOID STATS//
  65.             cout << "Choice: ";
  66.             cin >> num;
  67.             break;
  68.         case 4:
  69.             cout << "You have now compleated your stats!";
  70.             std::getchar();
  71.             std::getchar();
  72.             system("CLS");
  73.             break;
  74.         }
  75. //VOID STATS!!!!!//
  76.         cout << "Stats!\n\n";
  77.  
  78.         num = 1;
  79.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  80.         {
  81.             cout << (*iter2).name;
  82.             switch(num)
  83.             {
  84.             case 1:
  85.                 cout << " = " << One_Handed;
  86.                 break;
  87.             case 2:
  88.                 cout << " = " << Two_Handed;
  89.                 break;
  90.             case 3:
  91.                 cout << " = " << Polearms;
  92.                 break;
  93.             case 4:
  94.                 cout << " = " << Archery;
  95.                 break;
  96.             case 5:
  97.                 cout << " = " << Crossbows;
  98.                 break;
  99.             case 6:
  100.                 cout << " = " << Throwing;
  101.                 break;
  102.             case 7:
  103.                 cout << " = " << Sorcery;
  104.                 break;
  105.             }
  106.             ++num;
  107.             cout << "\n";
  108.         }
  109. //END VOID STATS
  110.         cout << "1-Definition\n";
  111.         cout << "2-Add\n";
  112.         cout << "3-Subtract\n";
  113.         cout << "4-Done\n";
  114.         cout << "Choice: ";
  115.         cin >> num;
  116.         system("CLS");
  117.         switch(num)
  118.         {
  119.         case 1:
  120.             cout << "What one do you wish to define?\n\n";
  121.             //VOID SKILLS//
  122.             cout << "Choice: ";
  123.             cin >> num;
  124.             break;
  125.         case 2:
  126.             cout << "What one do you wish to add?\n\n";
  127.             //VOID SKILLS//
  128.             cout << "Choice: ";
  129.             cin >> num;
  130.             break;
  131.         case 3:
  132.             cout << "What one do you wish to subtract?\n\n";
  133.             //VOID SKILLS//
  134.             cout << "Choice: ";
  135.             cin >> num;
  136.             break;
  137.         case 4:
  138.             cout << "You have now compleated your skills!";
  139.             std::getchar();
  140.             std::getchar();
  141.             system("CLS");
  142.             break;
  143.         }
  144.  
  145.  
  146.         break;
  147.     }
Apr 21 '13 #31
weaknessforcats
9,208 Expert Mod 8TB
Functions are not repeated when you call them.

They are coded once and if you call them 500 times in your program, the same code is used each time.


When you build a program, three steps are involved:
1) preprocessor step where all the lines beginning with a # are processed.
2) compile step where the code in one file is converted to machine language. A program can require many files.
3) link step where your function calls are resolved.

It is in the link step where all of your calls get pointed to the one copy of the function code. The result becomes your .exe.
Apr 21 '13 #32
Well I don't want the void to return anything and still want to use one is there a way to make the iter2 to be transferred over? I have gotten all of the int's into the void but the const_iterator's and vector's are not having an easy time.

Like this:

Expand|Select|Wrap|Line Numbers
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8. void display(const vector<string>& inventory);
  9.  
  10. int main()
  11. {
  12.     vector<string> inventory;
  13.     inventory.push_back("sword");
  14.     inventory.push_back("armor");
  15.     inventory.push_back("shield");
  16.  
  17.     display(inventory);
  18.  
  19.     system("pause");
  20.     return 0;
  21. }
  22.  
  23. void display(const vector<string>& vec)
  24. {
  25.     cout << "Your items:\n";
  26.     for (vector<string>::const_iterator iter = vec.begin(); iter != vec.end(); ++iter)
  27.     {
  28.         cout << *iter << endl;
  29.     }
  30. }
Defining Void:

Expand|Select|Wrap|Line Numbers
  1. void stats0(string, int STR, int CON, int DEX,int INT,int CHA, int WIS,int WIL, int PER, int LUC, vector<struct1>stats, int num, vector<struct1>::const_iterator iter2, vector<struct1>::iterator myIterator2);
Void:

Expand|Select|Wrap|Line Numbers
  1. void stats0(string, int STR, int CON, int DEX,int INT,int CHA, int WIS,int WIL, int PER, int LUC, vector<struct1>stats, vector<struct1>::const_iterator iter2, vector<struct1>::iterator myIterator2, int num)
  2. {
  3.     num = 1;
  4.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  5.         {
  6.             cout << (*iter2).name;
  7.             switch(num)
  8.             {
  9.             case 1:
  10.                 cout << " = " << STR;
  11.                 break;
  12.             case 2:
  13.                 cout << " = " << CON;
  14.                 break;
  15.             case 3:
  16.                 cout << " = " << DEX;
  17.                 break;
  18.             case 4:
  19.                 cout << " = " << INT;
  20.                 break;
  21.             case 5:
  22.                 cout << " = " << CHA;
  23.                 break;
  24.             case 6:
  25.                 cout << " = " << WIS;
  26.                 break;
  27.             case 7:
  28.                 cout << " = " << WIL;
  29.                 break;
  30.             case 8:
  31.                 cout << " = " << PER;
  32.                 break;
  33.             case 9:
  34.                 cout << " = " << LUC;
  35.             }
  36.             ++num;
  37.             cout << "\n";
  38.         }
  39. }
Full Code:

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13. //Voids//
  14.     void age0(int);
  15.     void gender0(string);
  16.     void race0(string);
  17.     void skills0(string);
  18.     void stats0(string, int STR, int CON, int DEX,int INT,int CHA, int WIS,int WIL, int PER, int LUC, vector<struct1>stats, int num, vector<struct1>::const_iterator iter2, vector<struct1>::iterator myIterator2);
  19. //End Void//
  20.  
  21. struct struct1
  22. {
  23.     string name;
  24.     string dis;
  25. };
  26.  
  27. int main()
  28. {
  29.     //All Data Types//
  30.     string Name;
  31.     int num;
  32.     int num2;
  33.  
  34.     vector<string>::const_iterator iter;
  35.     vector<string>::iterator myIterator;
  36.     vector<struct1>::const_iterator iter2;
  37.     vector<struct1>::iterator myIterator2;
  38.  
  39.     //Stats//
  40.     //(STR)Strength: A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.
  41.     //(CON)Constitution: A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.
  42.     //(DEX)Dexterity: A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).
  43.     //(INT)Intelligence: A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at "level up". In some games, it controls the rate at which experience points are earned, or the amount needed to level up.
  44.     //(CHA)Charisma: A measure of a character's social skills, and sometimes their physical appearance. Charisma generally influences prices while trading, and NPC reactions.
  45.     //(WIS)Wisdom: A measure of a character's common sense and/or spirituality. Wisdom often controls a character's ability to cast certain spells, communicate to mystical entities, or discern other characters' motives or feelings.
  46.     //(WIL)Willpower: A measure of the character's mental resistance (against pain, fear etc.) when falling victim to mind-altering magic, torture, or insanity. Some games combine willpower and wisdom.
  47.     //(PER)Perception: A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.
  48.     //(LUC)Luck: A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).
  49.     int STR = 0;
  50.     int CON = 0;
  51.     int DEX = 0;
  52.     int INT = 0;
  53.     int CHA = 0;
  54.     int WIS = 0;
  55.     int WIL = 0;
  56.     int PER = 0;
  57.     int LUC = 0;
  58.     int MAX_STATS = 0;
  59.     //Vector Stats//
  60.     vector<struct1>stats;
  61.  
  62.     struct1 stats0;
  63.     stats0.name = "(STR)Strength";
  64.     stats0.dis = "A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.";
  65.     struct1 stats1;
  66.     stats1.name = "(CON)Constitution";
  67.     stats1.dis = "A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.";
  68.     struct1 stats2;
  69.     stats2.name = "(DEX)Dexterity";
  70.     stats2.dis = "A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).";
  71.     struct1 stats3;
  72.     stats3.name = "(INT)Intelligence";
  73.     stats3.dis = "A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at 'level up'. In some games, it controls the rate at which experience points are earned, or the amount needed to level up.";
  74.     struct1 stats4;
  75.     stats4.name = "(CHA)Charisma";
  76.     stats4.dis = "A measure of a character's social skills, and sometimes their physical appearance. Charisma generally influences prices while trading, and NPC reactions.";
  77.     struct1 stats5;
  78.     stats5.name = "(WIS)Wisdom";
  79.     stats5.dis = "A measure of a character's common sense and/or spirituality. Wisdom often controls a character's ability to cast certain spells, communicate to mystical entities, or discern other characters' motives or feelings.";
  80.     struct1 stats6;
  81.     stats6.name = "(WIL)Willpower";
  82.     stats6.dis = "A measure of the character's mental resistance (against pain, fear etc.) when falling victim to mind-altering magic, torture, or insanity. Some games combine willpower and wisdom.";
  83.     struct1 stats7;
  84.     stats7.name = "(PER)Perception";
  85.     stats7.dis = "A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.";
  86.     struct1 stats8;
  87.     stats8.name = "(LUC)Luck";
  88.     stats8.dis = "A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).";
  89.  
  90.     stats.push_back(stats0);
  91.     stats.push_back(stats1);
  92.     stats.push_back(stats2);
  93.     stats.push_back(stats3);
  94.     stats.push_back(stats4);
  95.     stats.push_back(stats5);
  96.     stats.push_back(stats6);
  97.     stats.push_back(stats7);
  98.     stats.push_back(stats8);
  99.     //End Vector Stats//
  100.     //End Stats//
  101.  
  102.     //Race//
  103.     int race;
  104.     //Vector Race//
  105.     vector<struct1>Race;
  106.  
  107.     //struct1 Race*;
  108.     //Race*.name = "";
  109.     //Race*.dis = "";
  110.  
  111.     struct1 Race0;
  112.     Race0.name = "Elves";
  113.     Race0.dis = "Elves are slightly shorter than humans, and have a much lighter build. They lackthe strength and stamina of the larger races, but are far more agile, both in   body and mind. Elves tend to make their homes deep within secluded forests, but always remain in touch with the world around them. The easiest way to recognize an elf is by their pointy ears. Because of their affinity with nature, Elves    posses the ability to blend in with their surroundings, can see in the dark, and are difficult to control through magic. They tend to have strong morals, and   can instinctively sense evil creatures. While their intelligence allows them to pursue almost any type of magical or religious training they desire, Elves are  limited in their choices of other vocations. Elves are physically weaker than   the humans we talked about above, but they have incredible magical strength thatcan help make up for that. Elves also love nature - so it's unlikely you'll haveone that's squeamish about things like getting dirty or being stuck out         overnight in the woods. They can see in the dark, so no wild boars will be      catching them off guard. That being said, your elfin character could have       problems with crowds, and towns in general. It's hard to go from the quiet of   nature to the bustling streets of Rune.";
  114.     struct1 Race1;
  115.     Race1.name = "Humans";
  116.     Race1.dis = "Averaging between five and six feet in height, Humans are the most populous racein the world. The Humans have established settlements on every continent, and their appearances vary widely depending on ancestry. Almost any hair, eye, or skin color that you can imagine can be found on a group of Humans somewhere. Although they have no special biological talents like the other races, Humans are far more versatile, able to be trained in almost all classes. The Humans were the first to discover how to focus magical energies, and as a result they can utilize items to enhance their attributes more effectively than any other race. Additionally, the Human religions encourage a very personal connection with the Powers, and allow quicker reincarnation to occur.";
  117.     struct1 Race2;
  118.     Race2.name = "Half-Orcs";
  119.     Race2.dis = "Half-orcs often exist at the social margins. Bestial in appearance and traditionally feared by those non-orcs they encounter, half-orcs tend to be tenacious and driven to prove themselves. Some hope to show that they are different from their brutish orc kin, struggling to find the better angels of their nature, while others embrace their monstrous heritage to become terrifying exemplars of ferocity in combat. One way or another, almost all half-orcs crave respect—whether it's given freely or must be taken by force. Derided as mongrels by humans and weaklings by orcs, half-orcs have bitterness beaten into them from birth, as well as the burning will to endure and overcome. With their physical size and strength, half-orcs represent raw and primal power, yet whether that power gets used for good or evil depends entirely on the individual.";
  120.     struct1 Race3;
  121.     Race3.name = "Dwarves";
  122.     Race3.dis = "Dwarves are short, stocky demi-humans, known for their foul tempers. They often prefer building their cities underground, and enjoy working with the earth. Dwarves are excellent miners, and possess more detailed knowledge on gems and metalsmithing than any other race. They can easily be identified by the long beards that both males and females alike wear proudly. While Dwarves are not as smart as some of the other races, they are usually wiser due to their long lifespans. Their great physical strength and stamina makes them resistant to the effects of poison, disease, and magic, and centuries of working underground have given the Dwarves a keen ability to see in the dark. While they are excellent fighters, Dwarves are not very dexterous and often distrust the use of magical spells.";
  123.     struct1 Race4;
  124.     Race4.name = "Drow";
  125.     Race4.dis = "A Drow is an outcast Elf who, against normal Elven nature, worships the forces of darkness. Reviled by most, the Drow work in secret, learning as much as they can about black magic. They tend to dwell in underground lairs or in deep, dark forests, and avoid contact with other races unless it will help them further their knowledge of evil. They are stockier than other Elves, and tend to have darker skin as well. Although few Elves are willing to admit it, Drow possess some of the same abilities that they do. They can see in the dark, and are able to locate hidden creatures with ease. Drow are difficult to control through magical means, and in addition can avoid the effects of the necromantic forces that they know so well. However, Drow are highly vulnerable to the forces of goodness, and are often easily dispatched by holy weapons and spells.";
  126.     struct1 Race5;
  127.     Race5.name = "Gnome";
  128.     Race5.dis = "Gnomes have been the enemies of Dwarves for many centuries. The two races are descended from a common ancestor, and the conflict between them originally arose when the Gnomes wished to focus on mechanical innovation rather than subterranean exploration. They found that their interests corresponded closely with those of the Humans, and left the Dwarven cities to live with humankind. As there has been increased interaction between the races, Gnomes have gradually learned to become more tolerant of their distant cousins. While Gnomes are much shorter than Humans, their wiry forms are more strong and durable. They have an incredible ability to regenerate, and are resistant to poison, disease, and magical attacks. Their intelligence and quickness make them well-suited for many different professions, although they are not as skilled in fighting as some of the other races.";
  129.     struct1 Race6;
  130.     Race6.name = "Halfling";
  131.     Race6.dis = "Halflings are the most diminutive humanoid race, averaging about four feet in height. Like the elves, they tend to live in secluded communities, and are very much in tune with nature. While Halflings lack physical strength and stamina, they are quite dexterous and intelligent, relying on their wits and skill to survive. They are also one of the hairiest races of all, sprouting tufts all over their bodies. Because they are so small and agile, Halflings can move much faster than most of the larger races, often getting in two attacks before an opponent can make one. They also have the ability to avoid detection, and can easily find creatures that are attempting to hide. Because of their strong connection with the natural world, Halflings are resistant to all magical attacks.";
  132.     struct1 Race7;
  133.     Race7.name = "Minotaur";
  134.     Race7.dis = "Minotaurs are an elite, somewhat aloof group of humanoid creatures, who believe themselves to be far better than other races. They were originally created as a magical experiment designed to make the perfect race, and their ancestry is revealed by the fact that they have the head and tail of a bull. Minotaurs are covered with thick, warm fur, and thrive on the arctic continent of Avros. Standing almost seven feet tall, Minotaurs are resistant to disease, poison, and bashing weapons. While they are by nature excellent fighters, their arrogance sometimes causes them to underestimate their opponents. Minotaurs also refuse to train in classes that they consider beneath them, and are somewhat limited in their choice of profession.";
  135.     struct1 Race8;
  136.     Race8.name = "Ogres";
  137.     Race8.dis = "Ogres are the largest and strongest of the races, averaging over seven feet in height. They resemble enormous humans, but tend to be almost hairless. While Ogres often organize into tightly-knit communities, they tend not to interact much with the other races. Their cities are usually located in mountainous or hilly areas, and their buildings are made from stones so large that no other people would be able to move them. Because of their massive size and strength, Ogres make excellent fighters, and they are always greatly feared by their enemies. Their thick skins provide them a bonus to their armor resistance which increases as they gain in experience and makes them resistant to extreme heat and cold. They also tend to be a bit dull-witted and thus somewhat open to mental attacks. Their lack of intellect also prevents Ogres from using magic very well, and their massive size makes them ineffective as thieves.";
  138.  
  139.     Race.push_back(Race0);
  140.     Race.push_back(Race1);
  141.     Race.push_back(Race2);
  142.     Race.push_back(Race3);
  143.     Race.push_back(Race4);
  144.     Race.push_back(Race5);
  145.     Race.push_back(Race6);
  146.     Race.push_back(Race7);
  147.     Race.push_back(Race8);
  148.     //End Vector Race//
  149.     //End Race//
  150.  
  151.     //Personality quiz//
  152.     //Q1//
  153.     int color;
  154.     vector<string>color2;
  155.     //vector colors//
  156.     color2.push_back("Red");
  157.     color2.push_back("Yellow");
  158.     color2.push_back("Orange");
  159.     color2.push_back("Green");
  160.     color2.push_back("Pink");
  161.     color2.push_back("Blue");
  162.     color2.push_back("Purple");
  163.     color2.push_back("White");
  164.     color2.push_back("Black");
  165.     //end vector colors//
  166.  
  167.  
  168.     //Q2//
  169.     int job;
  170.     vector<struct1>jobs;
  171.  
  172.     //jobs//
  173.     struct1 job0;
  174.     job0.name = "Miner";
  175.     job0.dis = "Uses a spade and pick to find ore, heavy built from mining in the dark.";
  176.  
  177.     struct1 job1;
  178.     job1.name = "Lumber Jack";
  179.     job1.dis = "Cuts down trees for a living, heavy built from climing trees and useing the axe.";
  180.  
  181.     struct1 job2;
  182.     job2.name = "Gardner";
  183.     job2.dis = "Tends to plants and loves nature, very agile and quite flimsy.";
  184.  
  185.     struct1 job3;
  186.     job3.name = "Blacksmith";
  187.     job3.dis = "Makes armor and weapons, heavy built from hammering steal.";
  188.  
  189.     struct1 job4;
  190.     job4.name = "Hunter";
  191.     job4.dis = "Agile and has a talent of sneeking up to animals with ease.";
  192.  
  193.     struct1 job5;
  194.     job5.name = "Farmer";
  195.     job5.dis = "is a mix between a Gardner and Hunter.";
  196.  
  197.     struct1 job6;
  198.     job6.name = "Guard";
  199.     job6.dis = "is a battle ready person ready to serve and protect.";
  200.  
  201.     struct1 job7;
  202.     job7.name = "Tavern Keeper";
  203.     job7.dis = ".";
  204.  
  205.     struct1 job8;
  206.     job8.name = "Assassin";
  207.     job8.dis = "is an expert at stelth and can be as cunning as a fox.";
  208.  
  209.     struct1 job9;
  210.     job9.name = "None";
  211.     job9.dis = "... use your imagination";
  212.     //end jobs//
  213.  
  214.     //Vector//
  215.     jobs.push_back(job0);
  216.     jobs.push_back(job1);
  217.     jobs.push_back(job2);
  218.     jobs.push_back(job3);
  219.     jobs.push_back(job4);
  220.     jobs.push_back(job5);
  221.     jobs.push_back(job6);
  222.     jobs.push_back(job7);
  223.     jobs.push_back(job8);
  224.     jobs.push_back(job9);
  225.     //end Vector//
  226.  
  227.  
  228.     //Q3//
  229.     int weapon;
  230.     vector<struct1>Weapon;
  231.     //Weapons//
  232.     struct1 weap;
  233.     weap.name = "One Handed Weapons";
  234.     weap.dis = "Consists of daggers, short swords, certain maces and battle axes";
  235.     struct1 weap1;
  236.     weap1.name = "Two Handed Weapons";
  237.     weap1.dis = ".";
  238.     struct1 weap2;
  239.     weap2.name = "Polearms";
  240.     weap2.dis = ".";
  241.     struct1 weap3;
  242.     weap3.name = "Archery";
  243.     weap3.dis = ".";
  244.     struct1 weap4;
  245.     weap4.name = "Crossbows";
  246.     weap4.dis = ".";
  247.     struct1 weap5;
  248.     weap5.name = "Throwing";
  249.     weap5.dis = ".";
  250.     struct1 weap6;
  251.     weap6.name = "Sorcery Weapons";
  252.     weap6.dis = ".";
  253.     //Weapon Skill Stats//
  254.     int One_Handed = 0;
  255.     int Two_Handed = 0;
  256.     int Polearms = 0;
  257.     int Archery = 0;
  258.     int Crossbows = 0;
  259.     int Throwing = 0;
  260.     int Sorcery = 0;
  261.     int MAX_SKILL = 0;
  262.     //End Weapon Skill Stats//
  263.     //end Weapons//
  264.     //Vector Weapons//
  265.     Weapon.push_back(weap);
  266.     Weapon.push_back(weap1);
  267.     Weapon.push_back(weap2);
  268.     Weapon.push_back(weap3);
  269.     Weapon.push_back(weap4);
  270.     Weapon.push_back(weap5);
  271.     Weapon.push_back(weap6);
  272.     //End Vector Weapons//
  273.     //Q4//
  274.     int society;
  275.     string clas [6] = {"Royal Blood", "Baron/Lady", "Knight", "Squire", "Peasant", "Serf"};
  276.     //Q5//
  277.     int age;
  278.     //Q6//
  279.     int moat;
  280.     string emoat [16] = {"Exhaustion", "Confusion", "Ecstatic", "Guilty", "Suspiciousness", "Anger", "Hysterical", "Frustrated", "Sadness", "Confident", "Embarrassed", "Happyness", "Mischievous", "Disgusted", "Frightened", "Crazyness"};
  281.     //Q7//
  282.     int gender;
  283.     //Q8//
  284.     //Q9//
  285.     //Q10//
  286.     //end personality quiz//
  287.     //End Data Types//
  288.  
  289.     //Intro//
  290.     cout << "Welcome adventure!";
  291.     std::getchar();//Like a system pause with no words
  292.     cout << "You will imbark on a journey of your life!";
  293.     std::getchar();
  294.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  295.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  296.     std::getchar();
  297.     cout << "By the way...\n";
  298.     cout << "What is your name?";
  299.     cout << "\nName: ";
  300.     cin >> Name;
  301.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  302.     std::getchar();
  303.     std::getchar();
  304.     system("CLS");
  305.     //Test//
  306.     //This could be for testing//
  307.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  308.     cout << "puting you, lets see what you realy made of.\n";
  309.     std::getchar();
  310.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  311.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  312.     cout << "Now to make you realy you!\n";
  313.     std::getchar();
  314.     system("CLS");
  315. pick:
  316.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  317.     cout << "1-Personality Quiz\n";
  318.     cout << "2-Free Pick\n\n";
  319.     cout << "Choice: ";
  320.     cin >> num;
  321.     system("CLS");
  322.  
  323.     switch(num)
  324.     {
  325.         //Personality Quiz//
  326. //Q1//
  327.     case 1:
  328.         cout << "You have picked the personality quiz!\n";
  329.         cout << "Is this what you want?\n\n";
  330.         cout << "1-Yes\n";
  331.         cout << "2-No\n";
  332.         cout << "Choice: ";
  333.         cin >> num;
  334.         switch(num)
  335.         {
  336.         case 1:
  337.             system("CLS");
  338.             break;
  339.         case 2:
  340.             system("CLS");
  341.             goto pick;
  342.         }
  343.         cout << "Now! First question to figure your mind!\n\n";
  344. wrong:
  345.         cout << "What is your favorit color from the questions below\n\n";
  346.  
  347.         num = 1;
  348.         for(iter = color2.begin(); iter != color2.end(); ++iter)
  349.         {
  350.             cout << num << "- " << *iter << "\n";
  351.             ++num;
  352.         }
  353.         cout << "Choice: ";
  354.         cin >> color;
  355.         --color;
  356.  
  357.         num = 0;
  358.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  359.         {
  360.             if(num == color)
  361.             {
  362.                 cout << "Is "<< *iter <<" truly what you want?\n";
  363.             }
  364.             ++num;
  365.         }
  366.  
  367.         cout << "1-Yes\n";
  368.         cout << "2-No\n";
  369.         cout << "Choice: ";
  370.         cin >> num;
  371.  
  372.         switch(num)
  373.         {
  374.         case 1:
  375.             system("CLS");
  376.             break;
  377.         case 2:
  378.             system("CLS");
  379.             goto wrong;
  380.         }
  381. //Q2//
  382. wrong2:
  383.         cout << "Question 2!\n\n";
  384.         cout << "If you had to pick a job from this list what would it be?\n\n";
  385.         num = 1;
  386.         for(iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  387.         {
  388.             cout << num << "-" << (*iter2).name << "\n";
  389.             ++num;
  390.         }
  391.         cout << "Choice: ";
  392.         cin >> job;
  393.         --job;
  394.  
  395.         num = 0;
  396.         for (iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  397.         {
  398.             if(num == job)
  399.             {
  400.                 cout << "A " << (*iter2).name << " " <<(*iter2).dis << "\n\n";
  401.             }
  402.             ++num;
  403.         }
  404.  
  405.         cout << "1-Yes\n";
  406.         cout << "2-No\n";
  407.         cout << "Choice: ";
  408.         cin >> num;
  409.  
  410.         switch(num)
  411.         {
  412.         case 1:
  413.             system("CLS");
  414.             break;
  415.         case 2:
  416.             system("CLS");
  417.             goto wrong2;
  418.         }
  419.  
  420. //Q3//
  421. wrong3:
  422.         cout << "Question 3!\n\n";
  423.  
  424.         cout << "What type of weapon do you use??\n\n";
  425.  
  426.         num = 1;
  427.         for(iter2 = Weapon.begin(); iter2 !=Weapon.end(); ++iter2)
  428.         {
  429.             cout <<num <<"-" << (*iter2).name << "\n";
  430.             ++num;
  431.         }
  432.         cout << "Choice: ";
  433.         cin >> weapon;
  434.         --weapon;
  435.  
  436.         num = 0;
  437.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  438.         {
  439.             if(num == weapon)
  440.             {
  441.                 cout << (*iter2).name << ", " <<(*iter2).dis << "\n\n";
  442.  
  443.             }
  444.             ++num;
  445.         }
  446.  
  447.         cout << "1-Yes\n";
  448.         cout << "2-No\n";
  449.         cout << "Choice: ";
  450.         cin >> num;
  451.  
  452.         switch(num)
  453.         {
  454.         case 1:
  455.             system("CLS");
  456.             break;
  457.         case 2:
  458.             system("CLS");
  459.             goto wrong3;
  460.         }
  461.  
  462. //Q4//
  463. wrong4:
  464.         cout << "Question 4!\n\n";
  465.  
  466.         cout << "What class do you reside under?\n";
  467.         num= 1;
  468.         for (int i = 0; i < 6; i++)
  469.         {
  470.             cout << num << "-";
  471.             cout << clas[i] << endl;                  
  472.             ++num;
  473.         }
  474.         cout << "Choice: ";
  475.         cin >> society;
  476.         --society;
  477.  
  478.         cout << clas[society]<< " is the rank you have chosen do you truely want this?\n";
  479.         cout << "1-Yes\n";
  480.         cout << "2-No\n";
  481.         cout << "Choice: ";
  482.         cin >> num;
  483.  
  484.         switch(num)
  485.         {
  486.         case 1:
  487.             system("CLS");
  488.             break;
  489.         case 2:
  490.             system("CLS");
  491.             goto wrong4;
  492.         }
  493.         //What class/rank in society are you?//
  494.         //peasant, king, lord, urchin(poor child), slave, 
  495. //Q5//
  496. wrong5:
  497.         cout << "Question 5!\n\n";
  498.  
  499.         cout << "What is your age?\n\n";
  500.  
  501.         cout << "Choice: ";
  502.         cin >> age;
  503.  
  504.         if (age < 1 || age > 120)
  505.         {
  506.             cout << "You can't be that age!";
  507.             std::getchar();
  508.             std::getchar();
  509.             system("CLS");
  510.             goto wrong5;
  511.         }
  512.         else if (age >= 1 && age <= 12)
  513.         {
  514.             cout << "So young to go on an adventure, are you telling the truth?\n";
  515.         }
  516.         else if (age > 12 && age < 20)
  517.         {
  518.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  519.         }
  520.         else if (age >= 20 && age < 40)
  521.         {
  522.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  523.         }
  524.         else if (age >= 40 && age < 80)
  525.         {
  526.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  527.         }
  528.         else if (age >= 80 && age <= 120)
  529.         {
  530.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  531.         }
  532.  
  533.         cout << "1-Yes\n";
  534.         cout << "2-No\n";
  535.         cout << "Choice: ";
  536.         cin >> num;
  537.         switch(num)
  538.             {
  539.             case 1:
  540.                 system("CLS");
  541.                 break;
  542.             case 2:
  543.                 system("CLS");
  544.                 goto wrong5;
  545.                 break;
  546.             }
  547. //Q6//
  548. wrong6:
  549.         cout << "Question 6!\n\n";
  550.  
  551.         cout << "Emotions define a character, what is yours?\n";
  552.         num= 1;
  553.         for (int i = 0; i < 16; i++)
  554.         {
  555.             cout << num << "-";
  556.             cout << emoat[i] << endl;                  
  557.             ++num;
  558.         }
  559.         cout << "Choice: ";
  560.         cin >> moat;
  561.         --moat;
  562.         cout << emoat[moat] << " discribes what you are inside, are you mistaken?\n";
  563.         cout << "1-Yes\n";
  564.         cout << "2-No\n";
  565.         cout << "Choice: ";
  566.         cin >> num;
  567.         switch(num)
  568.             {
  569.             case 1:
  570.                 system("CLS");
  571.                 break;
  572.             case 2:
  573.                 system("CLS");
  574.                 goto wrong6;
  575.                 break;
  576.             }
  577. //Q7//
  578. wrong7:
  579.         cout << "Question 7!\n\n";
  580.  
  581.         cout << "What is your gender?\n";
  582.         cout << "1-Male\n";
  583.         cout << "2-Female\n";
  584.         cout << "3-Hidden\n";
  585.         cout << "Choice: ";
  586.         cin >> gender;
  587.         cout << "\n";
  588.  
  589.         if (gender == 1)
  590.         {
  591.             cout << "Male side.";
  592.         }
  593.         else if (gender == 2)
  594.         {
  595.             cout << "Female side.";
  596.         }
  597.         else if (gender == 3)
  598.         {
  599.             cout << "You have no side, you are a mystery.";
  600.         }
  601.         else
  602.         {
  603.             cout << "That is not posible please pick another number";
  604.             std::getchar();
  605.             std::getchar();
  606.             system("CLS");
  607.             goto wrong7;
  608.         }
  609.         cout << "\nIs this what you are?\n";
  610.         cout << "1-Yes\n";
  611.         cout << "2-No\n";
  612.         cout << "Choice: ";
  613.         cin >> num;
  614.         switch(num)
  615.             {
  616.             case 1:
  617.                 system("CLS");
  618.                 break;
  619.             case 2:
  620.                 system("CLS");
  621.                 goto wrong7;
  622.                 break;
  623.             }
  624. //Q8//
  625.  
  626. //Q9//
  627.  
  628. //Q10//
  629.  
  630.         break;
  631.         //End Personality Quiz//
  632.         //Free pick//
  633.     case 2:
  634.         cout << "You have chosen to freely pick your charicters stats.\n";
  635.         cout << "Is this what you want?\n\n";
  636.         cout << "1-Yes\n";
  637.         cout << "2-No\n";
  638.         cout << "choice: ";
  639.         cin >> num;
  640.         switch(num)
  641.             {
  642.             case 1:
  643.                 system("CLS");
  644.                 break;
  645.             case 2:
  646.                 system("CLS");
  647.                 goto pick;
  648.                 break;
  649.             }
  650. age:
  651.         cout << "What is your age?\n\n";
  652.  
  653.         cout << "Choice: ";
  654.         cin >> age;
  655.  
  656.         if (age < 1 || age > 120)
  657.         {
  658.             cout << "You can't be that age!";
  659.             std::getchar();
  660.             std::getchar();
  661.             system("CLS");
  662.             goto wrong5;
  663.         }
  664.         else if (age >= 1 && age <= 12)
  665.         {
  666.             cout << "So young to go on an adventure, are you telling the truth?\n";
  667.         }
  668.         else if (age > 12 && age < 20)
  669.         {
  670.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  671.         }
  672.         else if (age >= 20 && age < 40)
  673.         {
  674.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  675.         }
  676.         else if (age >= 40 && age < 80)
  677.         {
  678.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  679.         }
  680.         else if (age >= 80 && age <= 120)
  681.         {
  682.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  683.         }
  684.  
  685.         cout << "1-Yes\n";
  686.         cout << "2-No\n";
  687.         cout << "Choice: ";
  688.         cin >> num;
  689.         switch(num)
  690.             {
  691.             case 1:
  692.                 system("CLS");
  693.                 break;
  694.             case 2:
  695.                 system("CLS");
  696.                 goto age;
  697.                 break;
  698.             }
  699. gender:
  700.         cout << "What is your gender?\n";
  701.         cout << "1-Male\n";
  702.         cout << "2-Female\n";
  703.         cout << "3-Hidden\n";
  704.         cout << "Choice: ";
  705.         cin >> gender;
  706.         cout << "\n";
  707.  
  708.         if (gender == 1)
  709.         {
  710.             cout << "Male side.";
  711.         }
  712.         else if (gender == 2)
  713.         {
  714.             cout << "Female side.";
  715.         }
  716.         else if (gender == 3)
  717.         {
  718.             cout << "You have no side, you are a mystery.";
  719.         }
  720.         else
  721.         {
  722.             cout << "That is not posible please pick another number";
  723.             std::getchar();
  724.             std::getchar();
  725.             system("CLS");
  726.             goto wrong7;
  727.         }
  728.         cout << "\nIs this what you are?\n";
  729.         cout << "1-Yes\n";
  730.         cout << "2-No\n";
  731.         cout << "Choice: ";
  732.         cin >> num;
  733.         switch(num)
  734.             {
  735.             case 1:
  736.                 system("CLS");
  737.                 break;
  738.             case 2:
  739.                 system("CLS");
  740.                 goto gender;
  741.                 break;
  742.             }
  743. race:
  744.         cout << "What is the race that you choice?\n\n";
  745.         num = 1;
  746.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  747.         {
  748.             cout << num << "-" << (*iter2).name << "\n";
  749.             ++num;
  750.         }
  751.         cout << "Choice: ";
  752.         cin >> race;
  753.         --race;
  754.  
  755.         num = 0;
  756.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  757.         {
  758.             if(num == race)
  759.             {
  760.                 cout << (*iter2).dis << "\n\n";
  761.  
  762.             }
  763.             ++num;
  764.         }
  765.         cout << "\nIs this who you are?\n";
  766.         cout << "1-Yes\n";
  767.         cout << "2-No\n";
  768.         cout << "Choice: ";
  769.         cin >> num;
  770.         switch(num)
  771.             {
  772.             case 1:
  773.                 system("CLS");
  774.                 break;
  775.             case 2:
  776.                 system("CLS");
  777.                 goto race;
  778.                 break;
  779.             }
  780.         cout << "Your age is " << age << ", your gender is ";
  781.         if (gender == 1)
  782.         {
  783.             cout << "Male";
  784.         }
  785.         else if (gender == 2)
  786.         {
  787.             cout << "Female";
  788.         }
  789.         else if (gender == 3)
  790.         {
  791.             cout << "a mystery";
  792.         }
  793.         cout << ", your race is the ";
  794.         num = 0;
  795.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  796.         {
  797.             if(num == race)
  798.             {
  799.                 cout << (*iter2).name << "\n\n";
  800.  
  801.             }
  802.             ++num;
  803.         }
  804.         std::getchar();
  805.         std::getchar();
  806.         system("CLS");
  807. //VOID STATS!!!!!//
  808. defin:
  809.         cout << "Stats!\n\n";
  810.  
  811.         num = 1;
  812.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  813.         {
  814.             cout << (*iter2).name;
  815.             switch(num)
  816.             {
  817.             case 1:
  818.                 cout << " = " << STR;
  819.                 break;
  820.             case 2:
  821.                 cout << " = " << CON;
  822.                 break;
  823.             case 3:
  824.                 cout << " = " << DEX;
  825.                 break;
  826.             case 4:
  827.                 cout << " = " << INT;
  828.                 break;
  829.             case 5:
  830.                 cout << " = " << CHA;
  831.                 break;
  832.             case 6:
  833.                 cout << " = " << WIS;
  834.                 break;
  835.             case 7:
  836.                 cout << " = " << WIL;
  837.                 break;
  838.             case 8:
  839.                 cout << " = " << PER;
  840.                 break;
  841.             case 9:
  842.                 cout << " = " << LUC;
  843.             }
  844.             ++num;
  845.             cout << "\n";
  846.         }
  847. //END VOID STATS
  848.         cout << "\n1-Definition\n";
  849.         cout << "2-Add\n";
  850.         cout << "3-Subtract\n";
  851.         cout << "4-Done\n";
  852.         cout << "Choice: ";
  853.         cin >> num2;
  854.         system("CLS");
  855.         switch(num2)
  856.         {
  857.         case 1:
  858. defin1:
  859.             cout << "What one do you wish to define?\n\n";
  860.             //VOID STATS!!!!!//
  861.         num = 1;
  862.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  863.         {
  864.             cout << num << "-" <<(*iter2).name;
  865.             ++num;
  866.             cout << "\n";
  867.         }
  868.         cout << num << "-" << "Exit\n\n";
  869. //END VOID STATS
  870.             cout << "Choice: ";
  871.             cin >> num2;
  872.  
  873.             if (num == num2)
  874.             {
  875.                 system("CLS");
  876.                 goto defin;
  877.             }
  878.             --num2;
  879.             num = 0;
  880.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  881.             {
  882.                 if(num == num2)
  883.                 {
  884.                     cout << (*iter2).dis << "\n\n";
  885.                 }
  886.                 ++num;
  887.             }
  888.             std::getchar();
  889.             std::getchar();
  890.             system("CLS");
  891.             goto defin1;
  892.  
  893.             break;
  894.         case 2:
  895.             cout << "What one do you wish to add?\n\n";
  896.             //VOID STATS!!!!!//
  897.             num = 1;
  898.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  899.         {
  900.             cout << num << "-" <<(*iter2).name;
  901.             ++num;
  902.             cout << "\n";
  903.         }
  904.         cout << "\n";
  905.         cout << "Choice: ";
  906.         cin >> num2;
  907.         system("CLS");
  908.         cout << "How much do you want to add?\n\n";
  909.         --num2;
  910.         num = 0;
  911.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  912.         {
  913.             if(num == num2)
  914.             {
  915.                 cout << (*iter2).name;
  916.                 switch(num2)
  917.                 {
  918.                 case 1:
  919.                     cout << " = " << STR;
  920.                     break;
  921.                 case 2:
  922.                     cout << " = " << CON;
  923.                     break;
  924.                 case 3:
  925.                     cout << " = " << DEX;
  926.                     break;
  927.                 case 4:
  928.                     cout << " = " << INT;
  929.                     break;
  930.                 case 5:
  931.                     cout << " = " << CHA;
  932.                     break;
  933.                 case 6:
  934.                     cout << " = " << WIS;
  935.                     break;
  936.                 case 7:
  937.                     cout << " = " << WIL;
  938.                     break;
  939.                 case 8:
  940.                     cout << " = " << PER;
  941.                     break;
  942.                 case 9:
  943.                     cout << " = " << LUC;
  944.                 }
  945.             }
  946.             ++num;
  947.         }
  948. //END VOID STATS
  949.         cout << "\n\n";
  950.         cout << "Points left: ";
  951.         cout << MAX_STATS;
  952.         cout << "\n\n";
  953.         cout << "Choice: ";
  954.         cin >> num2;
  955.  
  956.         if (num2 <= MAX_STATS)
  957.         {
  958.             MAX_STATS = MAX_STATS - num2;
  959.         }
  960.         else 
  961.         {
  962.  
  963.         }
  964.         break;
  965.         case 3:
  966.             cout << "What one do you wish to subtract?\n\n";
  967.             //VOID STATS!!!!!//
  968.         num = 1;
  969.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  970.         {
  971.             cout << num << "-" <<(*iter2).name;
  972.             ++num;
  973.             cout << "\n";
  974.         }
  975. //END VOID STATS
  976.             cout << "Choice: ";
  977.             cin >> num;
  978.             break;
  979.         case 4:
  980.             cout << "You have now compleated your stats!";
  981.             std::getchar();
  982.             std::getchar();
  983.             system("CLS");
  984.             break;
  985.         }
  986. //VOID SKILLS!!!!!//
  987.         cout << "Skills!\n\n";
  988.  
  989.         num = 1;
  990.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  991.         {
  992.             cout << (*iter2).name;
  993.             switch(num)
  994.             {
  995.             case 1:
  996.                 cout << " = " << One_Handed;
  997.                 break;
  998.             case 2:
  999.                 cout << " = " << Two_Handed;
  1000.                 break;
  1001.             case 3:
  1002.                 cout << " = " << Polearms;
  1003.                 break;
  1004.             case 4:
  1005.                 cout << " = " << Archery;
  1006.                 break;
  1007.             case 5:
  1008.                 cout << " = " << Crossbows;
  1009.                 break;
  1010.             case 6:
  1011.                 cout << " = " << Throwing;
  1012.                 break;
  1013.             case 7:
  1014.                 cout << " = " << Sorcery;
  1015.                 break;
  1016.             }
  1017.             ++num;
  1018.             cout << "\n";
  1019.         }
  1020. //END VOID SKILLS//
  1021.         cout << "1-Definition\n";
  1022.         cout << "2-Add\n";
  1023.         cout << "3-Subtract\n";
  1024.         cout << "4-Done\n";
  1025.         cout << "Choice: ";
  1026.         cin >> num;
  1027.         system("CLS");
  1028.         switch(num)
  1029.         {
  1030.         case 1:
  1031.             cout << "What one do you wish to define?\n\n";
  1032.             //VOID SKILLS!!!!!//
  1033.         cout << "Skills!\n\n";
  1034.  
  1035.         num = 1;
  1036.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1037.         {
  1038.             cout << (*iter2).name;
  1039.             switch(num)
  1040.             {
  1041.             case 1:
  1042.                 cout << " = " << One_Handed;
  1043.                 break;
  1044.             case 2:
  1045.                 cout << " = " << Two_Handed;
  1046.                 break;
  1047.             case 3:
  1048.                 cout << " = " << Polearms;
  1049.                 break;
  1050.             case 4:
  1051.                 cout << " = " << Archery;
  1052.                 break;
  1053.             case 5:
  1054.                 cout << " = " << Crossbows;
  1055.                 break;
  1056.             case 6:
  1057.                 cout << " = " << Throwing;
  1058.                 break;
  1059.             case 7:
  1060.                 cout << " = " << Sorcery;
  1061.                 break;
  1062.             }
  1063.             ++num;
  1064.             cout << "\n";
  1065.         }
  1066. //END VOID SKILLS//
  1067.             cout << "Choice: ";
  1068.             cin >> num;
  1069.             break;
  1070.         case 2:
  1071.             cout << "What one do you wish to add?\n\n";
  1072.             //VOID SKILLS!!!!!//
  1073.         num = 1;
  1074.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1075.         {
  1076.             cout << (*iter2).name;
  1077.             switch(num)
  1078.                 {
  1079.                 case 1:
  1080.                     cout << " = " << One_Handed;
  1081.                     break;
  1082.                 case 2:
  1083.                     cout << " = " << Two_Handed;
  1084.                     break;
  1085.                 case 3:
  1086.                     cout << " = " << Polearms;
  1087.                     break;
  1088.                 case 4:
  1089.                     cout << " = " << Archery;
  1090.                     break;
  1091.                 case 5:
  1092.                     cout << " = " << Crossbows;
  1093.                     break;
  1094.                 case 6:
  1095.                     cout << " = " << Throwing;
  1096.                     break;
  1097.                 case 7:
  1098.                     cout << " = " << Sorcery;
  1099.                     break;
  1100.                 }
  1101.                 ++num;
  1102.                 cout << "\n";
  1103.             }
  1104. //END VOID STATS
  1105.             cout << "Choice: ";
  1106.             cin >> num;
  1107.             break;
  1108.         case 3:
  1109.             cout << "What one do you wish to subtract?\n\n";
  1110.             //VOID SKILLS!!!!!//
  1111.         num = 1;
  1112.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1113.         {
  1114.             cout << (*iter2).name;
  1115.             switch(num)
  1116.             {
  1117.             case 1:
  1118.                 cout << " = " << One_Handed;
  1119.                 break;
  1120.             case 2:
  1121.                 cout << " = " << Two_Handed;
  1122.                 break;
  1123.             case 3:
  1124.                 cout << " = " << Polearms;
  1125.                 break;
  1126.             case 4:
  1127.                 cout << " = " << Archery;
  1128.                 break;
  1129.             case 5:
  1130.                 cout << " = " << Crossbows;
  1131.                 break;
  1132.             case 6:
  1133.                 cout << " = " << Throwing;
  1134.                 break;
  1135.             case 7:
  1136.                 cout << " = " << Sorcery;
  1137.                 break;
  1138.             }
  1139.             ++num;
  1140.             cout << "\n";
  1141.         }
  1142. //END VOID STATS
  1143.             cout << "Choice: ";
  1144.             cin >> num;
  1145.             break;
  1146.         case 4:
  1147.             cout << "You have now compleated your skills!";
  1148.             std::getchar();
  1149.             std::getchar();
  1150.             system("CLS");
  1151.             break;
  1152.         }
  1153.  
  1154.  
  1155.         break;
  1156.     }
  1157.         //End Free Pick//
  1158.  
  1159.     system("pause");//Like a std::getchar but says to press a word to continue
  1160.     return 0;
  1161. }
  1162.  
  1163. void skills0(string)
  1164. {
  1165. }
  1166.  
  1167. void stats0(string, int STR, int CON, int DEX,int INT,int CHA, int WIS,int WIL, int PER, int LUC, vector<struct1>stats, vector<struct1>::const_iterator iter2, vector<struct1>::iterator myIterator2, int num)
  1168. {
  1169.     num = 1;
  1170.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1171.         {
  1172.             cout << (*iter2).name;
  1173.             switch(num)
  1174.             {
  1175.             case 1:
  1176.                 cout << " = " << STR;
  1177.                 break;
  1178.             case 2:
  1179.                 cout << " = " << CON;
  1180.                 break;
  1181.             case 3:
  1182.                 cout << " = " << DEX;
  1183.                 break;
  1184.             case 4:
  1185.                 cout << " = " << INT;
  1186.                 break;
  1187.             case 5:
  1188.                 cout << " = " << CHA;
  1189.                 break;
  1190.             case 6:
  1191.                 cout << " = " << WIS;
  1192.                 break;
  1193.             case 7:
  1194.                 cout << " = " << WIL;
  1195.                 break;
  1196.             case 8:
  1197.                 cout << " = " << PER;
  1198.                 break;
  1199.             case 9:
  1200.                 cout << " = " << LUC;
  1201.             }
  1202.             ++num;
  1203.             cout << "\n";
  1204.         }
  1205. }
Apr 22 '13 #33
weaknessforcats
9,208 Expert Mod 8TB
I am not understanding what you mean by "the void". Could you post an example of what you call "the void"?
Apr 23 '13 #34
I am having a problem, I want to change a number in stats.num but it will not change do I have to remove all the stats from inventory and restate them to get my new answer?

Expand|Select|Wrap|Line Numbers
  1. // RPG.cpp//
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13. struct struct1
  14. {
  15.     string name;
  16.     string dis;
  17.     int num;
  18. };
  19.  
  20. //Void//
  21.  
  22. //Ends Void//
  23.  
  24. int main()
  25. {
  26.     //All Data Types//
  27.     //Voids//
  28.     void age0(int);
  29.     void gender0(string);
  30.     void race0(string);
  31.     //End Void//
  32.     string Name;
  33.     int num;
  34.     int num2;
  35.  
  36.     vector<string>::const_iterator iter;
  37.     vector<string>::iterator myIterator;
  38.     vector<struct1>::const_iterator iter2;
  39.     vector<struct1>::iterator myIterator2;
  40.  
  41.     //Stats//
  42.     //(STR)Strength: A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.
  43.     //(CON)Constitution: A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.
  44.     //(DEX)Dexterity: A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).
  45.     //(INT)Intelligence: A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at "level up". In some games, it controls the rate at which experience points are earned, or the amount needed to level up.
  46.     //(CHA)Charisma: A measure of a character's social skills, and sometimes their physical appearance. Charisma generally influences prices while trading, and NPC reactions.
  47.     //(WIS)Wisdom: A measure of a character's common sense and/or spirituality. Wisdom often controls a character's ability to cast certain spells, communicate to mystical entities, or discern other characters' motives or feelings.
  48.     //(WIL)Willpower: A measure of the character's mental resistance (against pain, fear etc.) when falling victim to mind-altering magic, torture, or insanity. Some games combine willpower and wisdom.
  49.     //(PER)Perception: A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.
  50.     //(LUC)Luck: A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).
  51.     //Vector Stats//
  52.     vector<struct1>stats;
  53.  
  54.     struct1 stats0;
  55.     stats0.name = "(STR)Strength";
  56.     stats0.dis = "A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.";
  57.     stats0.num = 0;
  58.  
  59.     struct1 stats1;
  60.     stats1.name = "(CON)Constitution";
  61.     stats1.dis = "A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.";
  62.     stats1.num = 0;
  63.  
  64.     struct1 stats2;
  65.     stats2.name = "(DEX)Dexterity";
  66.     stats2.dis = "A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).";
  67.     stats2.num = 0;
  68.  
  69.     struct1 stats3;
  70.     stats3.name = "(INT)Intelligence";
  71.     stats3.dis = "A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at 'level up'. In some games, it controls the rate at which experience points are earned, or the amount needed to level up.";
  72.     stats3.num = 0;
  73.  
  74.     struct1 stats4;
  75.     stats4.name = "(CHA)Charisma";
  76.     stats4.dis = "A measure of a character's social skills, and sometimes their physical appearance. Charisma generally influences prices while trading, and NPC reactions.";
  77.     stats4.num = 0;
  78.  
  79.     struct1 stats5;
  80.     stats5.name = "(WIS)Wisdom";
  81.     stats5.dis = "A measure of a character's common sense and/or spirituality. Wisdom often controls a character's ability to cast certain spells, communicate to mystical entities, or discern other characters' motives or feelings.";
  82.     stats5.num = 0;
  83.  
  84.     struct1 stats6;
  85.     stats6.name = "(WIL)Willpower";
  86.     stats6.dis = "A measure of the character's mental resistance (against pain, fear etc.) when falling victim to mind-altering magic, torture, or insanity. Some games combine willpower and wisdom.";
  87.     stats6.num = 0;
  88.  
  89.     struct1 stats7;
  90.     stats7.name = "(PER)Perception";
  91.     stats7.dis = "A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.";
  92.     stats7.num = 0;
  93.  
  94.     struct1 stats8;
  95.     stats8.name = "(LUC)Luck";
  96.     stats8.dis = "A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).";
  97.     stats8.num = 0;
  98.  
  99.     struct1 stats9;
  100.     stats9.name = "MAX_STATS";
  101.     stats9.dis = "Max number of points to add.";
  102.     stats9.num = 0;
  103.  
  104.     stats.push_back(stats0);
  105.     stats.push_back(stats1);
  106.     stats.push_back(stats2);
  107.     stats.push_back(stats3);
  108.     stats.push_back(stats4);
  109.     stats.push_back(stats5);
  110.     stats.push_back(stats6);
  111.     stats.push_back(stats7);
  112.     stats.push_back(stats8);
  113.     //End Vector Stats//
  114.     //End Stats//
  115.  
  116.     //Race//
  117.     int race;
  118.     //Vector Race//
  119.     vector<struct1>Race;
  120.  
  121.     //struct1 Race*;
  122.     //Race*.name = "";
  123.     //Race*.dis = "";
  124.  
  125.     struct1 Race0;
  126.     Race0.name = "Elves";
  127.     Race0.dis = "Elves are slightly shorter than humans, and have a much lighter build. They lackthe strength and stamina of the larger races, but are far more agile, both in   body and mind. Elves tend to make their homes deep within secluded forests, but always remain in touch with the world around them. The easiest way to recognize an elf is by their pointy ears. Because of their affinity with nature, Elves    posses the ability to blend in with their surroundings, can see in the dark, and are difficult to control through magic. They tend to have strong morals, and   can instinctively sense evil creatures. While their intelligence allows them to pursue almost any type of magical or religious training they desire, Elves are  limited in their choices of other vocations. Elves are physically weaker than   the humans we talked about above, but they have incredible magical strength thatcan help make up for that. Elves also love nature - so it's unlikely you'll haveone that's squeamish about things like getting dirty or being stuck out         overnight in the woods. They can see in the dark, so no wild boars will be      catching them off guard. That being said, your elfin character could have       problems with crowds, and towns in general. It's hard to go from the quiet of   nature to the bustling streets of Rune.";
  128.     struct1 Race1;
  129.     Race1.name = "Humans";
  130.     Race1.dis = "Averaging between five and six feet in height, Humans are the most populous racein the world. The Humans have established settlements on every continent, and their appearances vary widely depending on ancestry. Almost any hair, eye, or skin color that you can imagine can be found on a group of Humans somewhere. Although they have no special biological talents like the other races, Humans are far more versatile, able to be trained in almost all classes. The Humans were the first to discover how to focus magical energies, and as a result they can utilize items to enhance their attributes more effectively than any other race. Additionally, the Human religions encourage a very personal connection with the Powers, and allow quicker reincarnation to occur.";
  131.     struct1 Race2;
  132.     Race2.name = "Half-Orcs";
  133.     Race2.dis = "Half-orcs often exist at the social margins. Bestial in appearance and traditionally feared by those non-orcs they encounter, half-orcs tend to be tenacious and driven to prove themselves. Some hope to show that they are different from their brutish orc kin, struggling to find the better angels of their nature, while others embrace their monstrous heritage to become terrifying exemplars of ferocity in combat. One way or another, almost all half-orcs crave respect—whether it's given freely or must be taken by force. Derided as mongrels by humans and weaklings by orcs, half-orcs have bitterness beaten into them from birth, as well as the burning will to endure and overcome. With their physical size and strength, half-orcs represent raw and primal power, yet whether that power gets used for good or evil depends entirely on the individual.";
  134.     struct1 Race3;
  135.     Race3.name = "Dwarves";
  136.     Race3.dis = "Dwarves are short, stocky demi-humans, known for their foul tempers. They often prefer building their cities underground, and enjoy working with the earth. Dwarves are excellent miners, and possess more detailed knowledge on gems and metalsmithing than any other race. They can easily be identified by the long beards that both males and females alike wear proudly. While Dwarves are not as smart as some of the other races, they are usually wiser due to their long lifespans. Their great physical strength and stamina makes them resistant to the effects of poison, disease, and magic, and centuries of working underground have given the Dwarves a keen ability to see in the dark. While they are excellent fighters, Dwarves are not very dexterous and often distrust the use of magical spells.";
  137.     struct1 Race4;
  138.     Race4.name = "Drow";
  139.     Race4.dis = "A Drow is an outcast Elf who, against normal Elven nature, worships the forces of darkness. Reviled by most, the Drow work in secret, learning as much as they can about black magic. They tend to dwell in underground lairs or in deep, dark forests, and avoid contact with other races unless it will help them further their knowledge of evil. They are stockier than other Elves, and tend to have darker skin as well. Although few Elves are willing to admit it, Drow possess some of the same abilities that they do. They can see in the dark, and are able to locate hidden creatures with ease. Drow are difficult to control through magical means, and in addition can avoid the effects of the necromantic forces that they know so well. However, Drow are highly vulnerable to the forces of goodness, and are often easily dispatched by holy weapons and spells.";
  140.     struct1 Race5;
  141.     Race5.name = "Gnome";
  142.     Race5.dis = "Gnomes have been the enemies of Dwarves for many centuries. The two races are descended from a common ancestor, and the conflict between them originally arose when the Gnomes wished to focus on mechanical innovation rather than subterranean exploration. They found that their interests corresponded closely with those of the Humans, and left the Dwarven cities to live with humankind. As there has been increased interaction between the races, Gnomes have gradually learned to become more tolerant of their distant cousins. While Gnomes are much shorter than Humans, their wiry forms are more strong and durable. They have an incredible ability to regenerate, and are resistant to poison, disease, and magical attacks. Their intelligence and quickness make them well-suited for many different professions, although they are not as skilled in fighting as some of the other races.";
  143.     struct1 Race6;
  144.     Race6.name = "Halfling";
  145.     Race6.dis = "Halflings are the most diminutive humanoid race, averaging about four feet in height. Like the elves, they tend to live in secluded communities, and are very much in tune with nature. While Halflings lack physical strength and stamina, they are quite dexterous and intelligent, relying on their wits and skill to survive. They are also one of the hairiest races of all, sprouting tufts all over their bodies. Because they are so small and agile, Halflings can move much faster than most of the larger races, often getting in two attacks before an opponent can make one. They also have the ability to avoid detection, and can easily find creatures that are attempting to hide. Because of their strong connection with the natural world, Halflings are resistant to all magical attacks.";
  146.     struct1 Race7;
  147.     Race7.name = "Minotaur";
  148.     Race7.dis = "Minotaurs are an elite, somewhat aloof group of humanoid creatures, who believe themselves to be far better than other races. They were originally created as a magical experiment designed to make the perfect race, and their ancestry is revealed by the fact that they have the head and tail of a bull. Minotaurs are covered with thick, warm fur, and thrive on the arctic continent of Avros. Standing almost seven feet tall, Minotaurs are resistant to disease, poison, and bashing weapons. While they are by nature excellent fighters, their arrogance sometimes causes them to underestimate their opponents. Minotaurs also refuse to train in classes that they consider beneath them, and are somewhat limited in their choice of profession.";
  149.     struct1 Race8;
  150.     Race8.name = "Ogres";
  151.     Race8.dis = "Ogres are the largest and strongest of the races, averaging over seven feet in height. They resemble enormous humans, but tend to be almost hairless. While Ogres often organize into tightly-knit communities, they tend not to interact much with the other races. Their cities are usually located in mountainous or hilly areas, and their buildings are made from stones so large that no other people would be able to move them. Because of their massive size and strength, Ogres make excellent fighters, and they are always greatly feared by their enemies. Their thick skins provide them a bonus to their armor resistance which increases as they gain in experience and makes them resistant to extreme heat and cold. They also tend to be a bit dull-witted and thus somewhat open to mental attacks. Their lack of intellect also prevents Ogres from using magic very well, and their massive size makes them ineffective as thieves.";
  152.  
  153.     Race.push_back(Race0);
  154.     Race.push_back(Race1);
  155.     Race.push_back(Race2);
  156.     Race.push_back(Race3);
  157.     Race.push_back(Race4);
  158.     Race.push_back(Race5);
  159.     Race.push_back(Race6);
  160.     Race.push_back(Race7);
  161.     Race.push_back(Race8);
  162.     //End Vector Race//
  163.     //End Race//
  164.  
  165.     //Personality quiz//
  166.     //Q1//
  167.     int color;
  168.     vector<string>color2;
  169.     //vector colors//
  170.     color2.push_back("Red");
  171.     color2.push_back("Yellow");
  172.     color2.push_back("Orange");
  173.     color2.push_back("Green");
  174.     color2.push_back("Pink");
  175.     color2.push_back("Blue");
  176.     color2.push_back("Purple");
  177.     color2.push_back("White");
  178.     color2.push_back("Black");
  179.     //end vector colors//
  180.  
  181.  
  182.     //Q2//
  183.     int job;
  184.     vector<struct1>jobs;
  185.  
  186.     //jobs//
  187.     struct1 job0;
  188.     job0.name = "Miner";
  189.     job0.dis = "Uses a spade and pick to find ore, heavy built from mining in the dark.";
  190.  
  191.     struct1 job1;
  192.     job1.name = "Lumber Jack";
  193.     job1.dis = "Cuts down trees for a living, heavy built from climing trees and useing the axe.";
  194.  
  195.     struct1 job2;
  196.     job2.name = "Gardner";
  197.     job2.dis = "Tends to plants and loves nature, very agile and quite flimsy.";
  198.  
  199.     struct1 job3;
  200.     job3.name = "Blacksmith";
  201.     job3.dis = "Makes armor and weapons, heavy built from hammering steal.";
  202.  
  203.     struct1 job4;
  204.     job4.name = "Hunter";
  205.     job4.dis = "Agile and has a talent of sneeking up to animals with ease.";
  206.  
  207.     struct1 job5;
  208.     job5.name = "Farmer";
  209.     job5.dis = "is a mix between a Gardner and Hunter.";
  210.  
  211.     struct1 job6;
  212.     job6.name = "Guard";
  213.     job6.dis = "is a battle ready person ready to serve and protect.";
  214.  
  215.     struct1 job7;
  216.     job7.name = "Tavern Keeper";
  217.     job7.dis = ".";
  218.  
  219.     struct1 job8;
  220.     job8.name = "Assassin";
  221.     job8.dis = "is an expert at stelth and can be as cunning as a fox.";
  222.  
  223.     struct1 job9;
  224.     job9.name = "None";
  225.     job9.dis = "... use your imagination";
  226.     //end jobs//
  227.  
  228.     //Vector//
  229.     jobs.push_back(job0);
  230.     jobs.push_back(job1);
  231.     jobs.push_back(job2);
  232.     jobs.push_back(job3);
  233.     jobs.push_back(job4);
  234.     jobs.push_back(job5);
  235.     jobs.push_back(job6);
  236.     jobs.push_back(job7);
  237.     jobs.push_back(job8);
  238.     jobs.push_back(job9);
  239.     //end Vector//
  240.  
  241.  
  242.     //Q3//
  243.     int weapon;
  244.     vector<struct1>Weapon;
  245.     //Weapons//
  246.     struct1 weap;
  247.     weap.name = "One Handed Weapons";
  248.     weap.dis = "Consists of daggers, short swords, certain maces and battle axes";
  249.     weap.num = 0;
  250.  
  251.     struct1 weap1;
  252.     weap1.name = "Two Handed Weapons";
  253.     weap1.dis = ".";
  254.     weap1.num = 0;
  255.  
  256.     struct1 weap2;
  257.     weap2.name = "Polearms";
  258.     weap2.dis = ".";
  259.     weap2.num = 0;
  260.  
  261.     struct1 weap3;
  262.     weap3.name = "Archery";
  263.     weap3.dis = ".";
  264.     weap3.num = 0;
  265.  
  266.     struct1 weap4;
  267.     weap4.name = "Crossbows";
  268.     weap4.dis = ".";
  269.     weap4.num = 0;
  270.  
  271.     struct1 weap5;
  272.     weap5.name = "Throwing";
  273.     weap5.dis = ".";
  274.     weap5.num = 0;
  275.  
  276.     struct1 weap6;
  277.     weap6.name = "Sorcery Weapons";
  278.     weap6.dis = ".";
  279.     weap6.num = 0;
  280.  
  281.     struct1 weap7;
  282.     weap7.name = "MAX_SKILL";
  283.     weap7.dis = ".";
  284.     weap7.num = 0;
  285.     //end Weapons//
  286.     //Vector Weapons//
  287.     Weapon.push_back(weap);
  288.     Weapon.push_back(weap1);
  289.     Weapon.push_back(weap2);
  290.     Weapon.push_back(weap3);
  291.     Weapon.push_back(weap4);
  292.     Weapon.push_back(weap5);
  293.     Weapon.push_back(weap6);
  294.     Weapon.push_back(weap7);
  295.     //End Vector Weapons//
  296.     //Q4//
  297.     int society;
  298.     string clas [6] = {"Royal Blood", "Baron/Lady", "Knight", "Squire", "Peasant", "Serf"};
  299.     //Q5//
  300.     int age;
  301.     //Q6//
  302.     int moat;
  303.     string emoat [16] = {"Exhaustion", "Confusion", "Ecstatic", "Guilty", "Suspiciousness", "Anger", "Hysterical", "Frustrated", "Sadness", "Confident", "Embarrassed", "Happyness", "Mischievous", "Disgusted", "Frightened", "Crazyness"};
  304.     //Q7//
  305.     int gender;
  306.     //Q8//
  307.     int gardian;
  308.     //Q9//
  309.  
  310.     //Q10//
  311.  
  312.     //end personality quiz//
  313.     //End Data Types//
  314.  
  315.     //Intro//
  316.     cout << "Welcome adventure!";
  317.     std::getchar();//Like a system pause with no words
  318.     cout << "You will imbark on a journey of your life!";
  319.     std::getchar();
  320.     cout << "\nOn your journey you face hard decision in life or death situations.\n";
  321.     cout << "Solve conplex puzzles and save the world like every one else whats to do.\n";
  322.     std::getchar();
  323.     cout << "By the way...\n";
  324.     cout << "What is your name?";
  325.     cout << "\nName: ";
  326.     cin >> Name;
  327.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  328.     std::getchar();
  329.     std::getchar();
  330.     system("CLS");
  331.     //Test//
  332.     //This could be for testing//
  333.     cout << "Befor we get started and I kick you out on the some random place I feal like\n";
  334.     cout << "puting you, lets see what you realy made of.\n";
  335.     std::getchar();
  336.     cout << "Some rules first! When you run into a problem please right down the were it\n";
  337.     cout << "happend, or take a screen shot when something goes wrong. Thats pritty much it\n";
  338.     cout << "Now to make you realy you!\n";
  339.     std::getchar();
  340.     system("CLS");
  341. pick:
  342.     cout << "Do you want to take a personality quiz\nor freely pick what you want?\n\n";
  343.     cout << "1-Personality Quiz\n";
  344.     cout << "2-Free Pick\n\n";
  345.     cout << "Choice: ";
  346.     cin >> num;
  347.     system("CLS");
  348.  
  349.     switch(num)
  350.     {
  351.         //Personality Quiz//
  352. //Q1//
  353.     case 1:
  354.         cout << "You have picked the personality quiz!\n";
  355.         cout << "Is this what you want?\n\n";
  356.         cout << "1-Yes\n";
  357.         cout << "2-No\n";
  358.         cout << "Choice: ";
  359.         cin >> num;
  360.         switch(num)
  361.         {
  362.         case 1:
  363.             system("CLS");
  364.             break;
  365.         case 2:
  366.             system("CLS");
  367.             goto pick;
  368.         }
  369.         cout << "Now! First question to figure your mind!\n\n";
  370. wrong:
  371.         cout << "What is your favorit color from the questions below\n\n";
  372.  
  373.         num = 1;
  374.         for(iter = color2.begin(); iter != color2.end(); ++iter)
  375.         {
  376.             cout << num << "- " << *iter << "\n";
  377.             ++num;
  378.         }
  379.         cout << "Choice: ";
  380.         cin >> color;
  381.         --color;
  382.  
  383.         num = 0;
  384.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  385.         {
  386.             if(num == color)
  387.             {
  388.                 cout << "Is "<< *iter <<" truly what you want?\n";
  389.             }
  390.             ++num;
  391.         }
  392.  
  393.         cout << "1-Yes\n";
  394.         cout << "2-No\n";
  395.         cout << "Choice: ";
  396.         cin >> num;
  397.  
  398.         switch(num)
  399.         {
  400.         case 1:
  401.             system("CLS");
  402.             break;
  403.         case 2:
  404.             system("CLS");
  405.             goto wrong;
  406.         }
  407. //Q2//
  408. wrong2:
  409.         cout << "Question 2!\n\n";
  410.         cout << "If you had to pick a job from this list what would it be?\n\n";
  411.         num = 1;
  412.         for(iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  413.         {
  414.             cout << num << "-" << (*iter2).name << "\n";
  415.             ++num;
  416.         }
  417.         cout << "Choice: ";
  418.         cin >> job;
  419.         --job;
  420.  
  421.         num = 0;
  422.         for (iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  423.         {
  424.             if(num == job)
  425.             {
  426.                 cout << "A " << (*iter2).name << " " <<(*iter2).dis << "\n\n";
  427.             }
  428.             ++num;
  429.         }
  430.  
  431.         cout << "1-Yes\n";
  432.         cout << "2-No\n";
  433.         cout << "Choice: ";
  434.         cin >> num;
  435.  
  436.         switch(num)
  437.         {
  438.         case 1:
  439.             system("CLS");
  440.             break;
  441.         case 2:
  442.             system("CLS");
  443.             goto wrong2;
  444.         }
  445.  
  446. //Q3//
  447. wrong3:
  448.         cout << "Question 3!\n\n";
  449.  
  450.         cout << "What type of weapon do you use??\n\n";
  451.  
  452.         num = 1;
  453.         for(iter2 = Weapon.begin(); iter2 !=Weapon.end(); ++iter2)
  454.         {
  455.             cout <<num <<"-" << (*iter2).name << "\n";
  456.             ++num;
  457.         }
  458.         cout << "Choice: ";
  459.         cin >> weapon;
  460.         --weapon;
  461.  
  462.         num = 0;
  463.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  464.         {
  465.             if(num == weapon)
  466.             {
  467.                 cout << (*iter2).name << ", " <<(*iter2).dis << "\n\n";
  468.  
  469.             }
  470.             ++num;
  471.         }
  472.  
  473.         cout << "1-Yes\n";
  474.         cout << "2-No\n";
  475.         cout << "Choice: ";
  476.         cin >> num;
  477.  
  478.         switch(num)
  479.         {
  480.         case 1:
  481.             system("CLS");
  482.             break;
  483.         case 2:
  484.             system("CLS");
  485.             goto wrong3;
  486.         }
  487.  
  488. //Q4//
  489. wrong4:
  490.         cout << "Question 4!\n\n";
  491.  
  492.         cout << "What class do you reside under?\n";
  493.         num= 1;
  494.         for (int i = 0; i < 6; i++)
  495.         {
  496.             cout << num << "-";
  497.             cout << clas[i] << endl;                  
  498.             ++num;
  499.         }
  500.         cout << "Choice: ";
  501.         cin >> society;
  502.         --society;
  503.  
  504.         cout << clas[society]<< " is the rank you have chosen do you truely want this?\n";
  505.         cout << "1-Yes\n";
  506.         cout << "2-No\n";
  507.         cout << "Choice: ";
  508.         cin >> num;
  509.  
  510.         switch(num)
  511.         {
  512.         case 1:
  513.             system("CLS");
  514.             break;
  515.         case 2:
  516.             system("CLS");
  517.             goto wrong4;
  518.         }
  519.         //What class/rank in society are you?//
  520.         //peasant, king, lord, urchin(poor child), slave, 
  521. //Q5//
  522. wrong5:
  523.         cout << "Question 5!\n\n";
  524.  
  525.         cout << "What is your age?\n\n";
  526.  
  527.         cout << "Choice: ";
  528.         cin >> age;
  529.  
  530.         if (age < 1 || age > 120)
  531.         {
  532.             cout << "You can't be that age!";
  533.             std::getchar();
  534.             std::getchar();
  535.             system("CLS");
  536.             goto wrong5;
  537.         }
  538.         else if (age >= 1 && age <= 12)
  539.         {
  540.             cout << "So young to go on an adventure, are you telling the truth?\n";
  541.         }
  542.         else if (age > 12 && age < 20)
  543.         {
  544.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  545.         }
  546.         else if (age >= 20 && age < 40)
  547.         {
  548.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  549.         }
  550.         else if (age >= 40 && age < 80)
  551.         {
  552.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  553.         }
  554.         else if (age >= 80 && age <= 120)
  555.         {
  556.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  557.         }
  558.  
  559.         cout << "1-Yes\n";
  560.         cout << "2-No\n";
  561.         cout << "Choice: ";
  562.         cin >> num;
  563.         switch(num)
  564.             {
  565.             case 1:
  566.                 system("CLS");
  567.                 break;
  568.             case 2:
  569.                 system("CLS");
  570.                 goto wrong5;
  571.                 break;
  572.             }
  573. //Q6//
  574. wrong6:
  575.         cout << "Question 6!\n\n";
  576.  
  577.         cout << "Emotions define a character, what is yours?\n";
  578.         num= 1;
  579.         for (int i = 0; i < 16; i++)
  580.         {
  581.             cout << num << "-";
  582.             cout << emoat[i] << endl;                  
  583.             ++num;
  584.         }
  585.         cout << "Choice: ";
  586.         cin >> moat;
  587.         --moat;
  588.         cout << emoat[moat] << " discribes what you are inside, are you mistaken?\n";
  589.         cout << "1-Yes\n";
  590.         cout << "2-No\n";
  591.         cout << "Choice: ";
  592.         cin >> num;
  593.         switch(num)
  594.             {
  595.             case 1:
  596.                 system("CLS");
  597.                 break;
  598.             case 2:
  599.                 system("CLS");
  600.                 goto wrong6;
  601.                 break;
  602.             }
  603. //Q7//
  604. wrong7:
  605.         cout << "Question 7!\n\n";
  606.  
  607.         cout << "What is your gender?\n";
  608.         cout << "1-Male\n";
  609.         cout << "2-Female\n";
  610.         cout << "3-Hidden\n";
  611.         cout << "Choice: ";
  612.         cin >> gender;
  613.         cout << "\n";
  614.  
  615.         if (gender == 1)
  616.         {
  617.             cout << "Male side.";
  618.         }
  619.         else if (gender == 2)
  620.         {
  621.             cout << "Female side.";
  622.         }
  623.         else if (gender == 3)
  624.         {
  625.             cout << "You have no side, you are a mystery.";
  626.         }
  627.         else
  628.         {
  629.             cout << "That is not posible please pick another number";
  630.             std::getchar();
  631.             std::getchar();
  632.             system("CLS");
  633.             goto wrong7;
  634.         }
  635.         cout << "\nIs this what you are?\n";
  636.         cout << "1-Yes\n";
  637.         cout << "2-No\n";
  638.         cout << "Choice: ";
  639.         cin >> num;
  640.         switch(num)
  641.             {
  642.             case 1:
  643.                 system("CLS");
  644.                 break;
  645.             case 2:
  646.                 system("CLS");
  647.                 goto wrong7;
  648.                 break;
  649.             }
  650. //Q8//
  651.         if (age >= 20)
  652.         {
  653.             cout << "When you were young who did you look up to?\n\n";
  654.         }
  655.         else if (age < 20)
  656.         {
  657.             cout << "Who do you look up to at such a young age?\n\n";
  658.         }
  659. wrong8:
  660.         cout << "Do you look up to your\n\n";
  661.  
  662.         cout << "Choice: ";
  663.         cin >> gardian;
  664.         switch(num)
  665.             {
  666.             case 1:
  667.                 system("CLS");
  668.                 break;
  669.             case 2:
  670.                 system("CLS");
  671.                 goto wrong8;
  672.                 break;
  673.             }
  674. //Q9//
  675. wrong9:
  676.         cout << "What is your animal\n\n";
  677.         num = 0;
  678.         while (num != 9)
  679.         {
  680.             ++num;
  681.             cout << num << "- ";
  682.             switch (num)
  683.             {
  684.             case 1:
  685.                 cout << "Frog\n";
  686.                 break;
  687.             case 2:
  688.                 cout << "Rat\n";
  689.                 break;
  690.             case 3:
  691.                 cout << "Dragon\n";
  692.                 break;
  693.             case 4:
  694.                 cout << "Snake\n";
  695.                 break;
  696.             case 5:
  697.                 cout << "Dog\n";
  698.                 break;
  699.             }
  700.  
  701.         }
  702.         switch(num)
  703.             {
  704.             case 1:
  705.                 system("CLS");
  706.                 break;
  707.             case 2:
  708.                 system("CLS");
  709.                 goto wrong9;
  710.                 break;
  711.             }
  712. //Q10//
  713. wrong10:
  714.         switch(num)
  715.             {
  716.             case 1:
  717.                 system("CLS");
  718.                 break;
  719.             case 2:
  720.                 system("CLS");
  721.                 goto wrong10;
  722.                 break;
  723.             }
  724.         //End Personality Quiz//
  725.         //Free pick//
  726.     case 2:
  727.         cout << "You have chosen to freely pick your charicters stats.\n";
  728.         cout << "Is this what you want?\n\n";
  729.         cout << "1-Yes\n";
  730.         cout << "2-No\n";
  731.         cout << "choice: ";
  732.         cin >> num;
  733.         switch(num)
  734.             {
  735.             case 1:
  736.                 system("CLS");
  737.                 break;
  738.             case 2:
  739.                 system("CLS");
  740.                 goto pick;
  741.                 break;
  742.             }
  743. age:
  744.         cout << "What is your age?\n\n";
  745.  
  746.         cout << "Choice: ";
  747.         cin >> age;
  748.  
  749.         if (age < 1 || age > 120)
  750.         {
  751.             cout << "You can't be that age!";
  752.             std::getchar();
  753.             std::getchar();
  754.             system("CLS");
  755.             goto wrong5;
  756.         }
  757.         else if (age >= 1 && age <= 12)
  758.         {
  759.             cout << "So young to go on an adventure, are you telling the truth?\n";
  760.         }
  761.         else if (age > 12 && age < 20)
  762.         {
  763.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  764.         }
  765.         else if (age >= 20 && age < 40)
  766.         {
  767.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  768.         }
  769.         else if (age >= 40 && age < 80)
  770.         {
  771.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  772.         }
  773.         else if (age >= 80 && age <= 120)
  774.         {
  775.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  776.         }
  777.  
  778.         cout << "1-Yes\n";
  779.         cout << "2-No\n";
  780.         cout << "Choice: ";
  781.         cin >> num;
  782.         switch(num)
  783.             {
  784.             case 1:
  785.                 system("CLS");
  786.                 break;
  787.             case 2:
  788.                 system("CLS");
  789.                 goto age;
  790.                 break;
  791.             }
  792. gender:
  793.         cout << "What is your gender?\n";
  794.         cout << "1-Male\n";
  795.         cout << "2-Female\n";
  796.         cout << "3-Hidden\n";
  797.         cout << "Choice: ";
  798.         cin >> gender;
  799.         cout << "\n";
  800.  
  801.         if (gender == 1)
  802.         {
  803.             cout << "Male side.";
  804.         }
  805.         else if (gender == 2)
  806.         {
  807.             cout << "Female side.";
  808.         }
  809.         else if (gender == 3)
  810.         {
  811.             cout << "You have no side, you are a mystery.";
  812.         }
  813.         else
  814.         {
  815.             cout << "That is not posible please pick another number";
  816.             std::getchar();
  817.             std::getchar();
  818.             system("CLS");
  819.             goto wrong7;
  820.         }
  821.         cout << "\nIs this what you are?\n";
  822.         cout << "1-Yes\n";
  823.         cout << "2-No\n";
  824.         cout << "Choice: ";
  825.         cin >> num;
  826.         switch(num)
  827.             {
  828.             case 1:
  829.                 system("CLS");
  830.                 break;
  831.             case 2:
  832.                 system("CLS");
  833.                 goto gender;
  834.                 break;
  835.             }
  836. race:
  837.         cout << "What is the race that you choice?\n\n";
  838.         num = 1;
  839.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  840.         {
  841.             cout << num << "-" << (*iter2).name << "\n";
  842.             ++num;
  843.         }
  844.         cout << "Choice: ";
  845.         cin >> race;
  846.         --race;
  847.  
  848.         num = 0;
  849.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  850.         {
  851.             if(num == race)
  852.             {
  853.                 cout << (*iter2).dis << "\n\n";
  854.  
  855.             }
  856.             ++num;
  857.         }
  858.         cout << "\nIs this who you are?\n";
  859.         cout << "1-Yes\n";
  860.         cout << "2-No\n";
  861.         cout << "Choice: ";
  862.         cin >> num;
  863.         switch(num)
  864.             {
  865.             case 1:
  866.                 system("CLS");
  867.                 break;
  868.             case 2:
  869.                 system("CLS");
  870.                 goto race;
  871.                 break;
  872.             }
  873.         cout << "Your age is " << age << ", your gender is ";
  874.         if (gender == 1)
  875.         {
  876.             cout << "Male";
  877.         }
  878.         else if (gender == 2)
  879.         {
  880.             cout << "Female";
  881.         }
  882.         else if (gender == 3)
  883.         {
  884.             cout << "a mystery";
  885.         }
  886.         cout << ", your race is the ";
  887.         num = 0;
  888.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  889.         {
  890.             if(num == race)
  891.             {
  892.                 cout << (*iter2).name << "\n\n";
  893.  
  894.             }
  895.             ++num;
  896.         }
  897.         //Seting up stats and skills//
  898.         if (race == 1)
  899.         {
  900.             stats0.num = 1;//STR
  901.             stats1.num = 0;//CON
  902.             stats2.num = 0;//DEX
  903.             stats3.num = 0;//INT
  904.             stats4.num = 0;//CHA
  905.             stats5.num = 0;//WIS
  906.             stats6.num = 0;//WIL
  907.             stats7.num = 0;//PER
  908.             stats8.num = 0;//LUC
  909.             stats9.num = 0;//MAX
  910.  
  911.             weap.num = 1;//One Handed
  912.             weap1.num = 0;//Two Handed
  913.             weap2.num = 0;//Polearms
  914.             weap3.num = 0;//Archery
  915.             weap4.num = 0;//Crossbows
  916.             weap5.num = 0;//Throwing
  917.             weap6.num = 0;//Sorcery Weapons
  918.             weap7.num = 0;//MAX
  919.         }
  920.         else if (race == 2)
  921.         {//Human//
  922.             stats0.num = 2;
  923.             stats1.num = 0;
  924.             stats2.num = 0;
  925.             stats3.num = 0;
  926.             stats4.num = 0;
  927.             stats5.num = 0;
  928.             stats6.num = 0;
  929.             stats7.num = 0;
  930.             stats8.num = 0;
  931.             stats9.num = 0;
  932.  
  933.             weap.num = 0;
  934.             weap2.num = 0;
  935.             weap3.num = 0;
  936.             weap4.num = 0;
  937.             weap5.num = 0;
  938.             weap6.num = 0;
  939.             weap7.num = 0;
  940.         }
  941.         else if (race == 3)
  942.         {//Half-Orc//
  943.             stats0.num = 3;
  944.             stats1.num = 0;
  945.             stats2.num = 0;
  946.             stats3.num = 0;
  947.             stats4.num = 0;
  948.             stats5.num = 0;
  949.             stats6.num = 0;
  950.             stats7.num = 0;
  951.             stats8.num = 0;
  952.             stats9.num = 0;
  953.  
  954.             weap.num = 0;
  955.             weap2.num = 0;
  956.             weap3.num = 0;
  957.             weap4.num = 0;
  958.             weap5.num = 0;
  959.             weap6.num = 0;
  960.             weap7.num = 0;
  961.         }
  962.         else if (race == 4)
  963.         {//Dwarf//
  964.             stats0.num = 4;
  965.             stats1.num = 0;
  966.             stats2.num = 0;
  967.             stats3.num = 0;
  968.             stats4.num = 0;
  969.             stats5.num = 0;
  970.             stats6.num = 0;
  971.             stats7.num = 0;
  972.             stats8.num = 0;
  973.             stats9.num = 0;
  974.  
  975.             weap.num = 0;
  976.             weap2.num = 0;
  977.             weap3.num = 0;
  978.             weap4.num = 0;
  979.             weap5.num = 0;
  980.             weap6.num = 0;
  981.             weap7.num = 0;
  982.         }
  983.         else if (race == 5)
  984.         {//Drow//
  985.             stats0.num = 5;
  986.             stats1.num = 0;
  987.             stats2.num = 0;
  988.             stats3.num = 0;
  989.             stats4.num = 0;
  990.             stats5.num = 0;
  991.             stats6.num = 0;
  992.             stats7.num = 0;
  993.             stats8.num = 0;
  994.             stats9.num = 0;
  995.  
  996.             weap.num = 0;
  997.             weap2.num = 0;
  998.             weap3.num = 0;
  999.             weap4.num = 0;
  1000.             weap5.num = 0;
  1001.             weap6.num = 0;
  1002.             weap7.num = 0;
  1003.         }
  1004.         else if (race == 6)
  1005.         {//Gnome//
  1006.             stats0.num = 6;
  1007.             stats1.num = 0;
  1008.             stats2.num = 0;
  1009.             stats3.num = 0;
  1010.             stats4.num = 0;
  1011.             stats5.num = 0;
  1012.             stats6.num = 0;
  1013.             stats7.num = 0;
  1014.             stats8.num = 0;
  1015.             stats9.num = 0;
  1016.  
  1017.             weap.num = 0;
  1018.             weap2.num = 0;
  1019.             weap3.num = 0;
  1020.             weap4.num = 0;
  1021.             weap5.num = 0;
  1022.             weap6.num = 0;
  1023.             weap7.num = 0;
  1024.         }
  1025.         else if (race == 7)
  1026.         {//Halfing//
  1027.             stats0.num = 7;
  1028.             stats1.num = 0;
  1029.             stats2.num = 0;
  1030.             stats3.num = 0;
  1031.             stats4.num = 0;
  1032.             stats5.num = 0;
  1033.             stats6.num = 0;
  1034.             stats7.num = 0;
  1035.             stats8.num = 0;
  1036.             stats9.num = 0;
  1037.  
  1038.             weap.num = 0;
  1039.             weap2.num = 0;
  1040.             weap3.num = 0;
  1041.             weap4.num = 0;
  1042.             weap5.num = 0;
  1043.             weap6.num = 0;
  1044.             weap7.num = 0;
  1045.         }
  1046.         else if (race == 8)
  1047.         {//Minotaur//
  1048.             stats0.num = 8;
  1049.             stats1.num = 0;
  1050.             stats2.num = 0;
  1051.             stats3.num = 0;
  1052.             stats4.num = 0;
  1053.             stats5.num = 0;
  1054.             stats6.num = 0;
  1055.             stats7.num = 0;
  1056.             stats8.num = 0;
  1057.             stats9.num = 0;
  1058.  
  1059.             weap.num = 0;
  1060.             weap2.num = 0;
  1061.             weap3.num = 0;
  1062.             weap4.num = 0;
  1063.             weap5.num = 0;
  1064.             weap6.num = 0;
  1065.             weap7.num = 0;
  1066.         }
  1067.         else if (race == 9)
  1068.         {//Ogres//
  1069.             stats0.num = 9;
  1070.             stats1.num = 0;
  1071.             stats2.num = 0;
  1072.             stats3.num = 0;
  1073.             stats4.num = 0;
  1074.             stats5.num = 0;
  1075.             stats6.num = 0;
  1076.             stats7.num = 0;
  1077.             stats8.num = 0;
  1078.             stats9.num = 0;
  1079.  
  1080.             weap.num = 0;
  1081.             weap2.num = 0;
  1082.             weap3.num = 0;
  1083.             weap4.num = 0;
  1084.             weap5.num = 0;
  1085.             weap6.num = 0;
  1086.             weap7.num = 0;
  1087.         }
  1088.         //Ending set up of stats and skills//
  1089.  
  1090.         std::getchar();
  1091.         std::getchar();
  1092.         system("CLS");
  1093. //VOID STATS!!!!!//
  1094. defin:
  1095.         cout << "Stats!\n\n";
  1096.  
  1097.         num = 1;
  1098.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1099.         {
  1100.             cout << (*iter2).name << " = " << (*iter2).num;
  1101.             ++num;
  1102.             cout << "\n";
  1103.         }
  1104. //END VOID STATS
  1105.         cout << "\n1-Definition\n";
  1106.         cout << "2-Add\n";
  1107.         cout << "3-Subtract\n";
  1108.         cout << "4-Done\n";
  1109.         cout << "Choice: ";
  1110.         cin >> num2;
  1111.         system("CLS");
  1112.         switch(num2)
  1113.         {
  1114.         case 1:
  1115. defin1:
  1116.             cout << "What one do you wish to define?\n\n";
  1117.             //VOID STATS!!!!!//
  1118.         num = 1;
  1119.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1120.         {
  1121.             cout << num << "-" << (*iter2).name;
  1122.             ++num;
  1123.             cout << "\n";
  1124.         }
  1125.         cout << num << "-" << "Exit\n\n";
  1126.  
  1127.             cout << "Choice: ";
  1128.             cin >> num2;
  1129.  
  1130.             if (num == num2)
  1131.             {
  1132.                 system("CLS");
  1133.                 goto defin;
  1134.             }
  1135.             --num2;
  1136.             num = 0;
  1137.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1138.             {
  1139.                 if(num == num2)
  1140.                 {
  1141.                     cout << (*iter2).dis << "\n\n";
  1142.                 }
  1143.                 ++num;
  1144.             }
  1145.             std::getchar();
  1146.             std::getchar();
  1147.             system("CLS");
  1148.             goto defin1;
  1149.  
  1150.             break;
  1151.         case 2:
  1152. defin2:
  1153.             cout << "What one do you wish to add?\n\n";
  1154.             //VOID STATS!!!!!//
  1155.             num = 1;
  1156.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1157.         {
  1158.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  1159.             ++num;
  1160.             cout << "\n";
  1161.         }
  1162.         cout << num << "- Exit";
  1163.         cout << "\n";
  1164.         cout << "Choice: ";
  1165.         cin >> num2;
  1166.         if (num == num2)
  1167.         {
  1168.             system("CLS");
  1169.             goto defin;
  1170.         }
  1171.         system("CLS");
  1172.         cout << "How much do you want to add?\n\n";
  1173.         --num2;
  1174.         num = 0;
  1175.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1176.         {
  1177.             if(num == num2)
  1178.             {
  1179.                 cout << (*iter2).name << " = " << (*iter2).num;
  1180.             }
  1181.             ++num;
  1182.         }
  1183. //END VOID STATS
  1184.         cout << "\n\n";
  1185.         cout << "Points left: ";
  1186.         num = 0;
  1187.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1188.         {
  1189.             if(num == num2)
  1190.             {
  1191.                 cout << (*iter2).num;
  1192.             }
  1193.             ++num;
  1194.         }
  1195.         cout << "\n\n";
  1196.  
  1197.         cout << "0- Exit\n";
  1198.         cout << "1- 1 Point\n";
  1199.         cout << "2- 5 Point\n";
  1200.         cout << "3- 10 Point\n\n";
  1201.         cout << "Choice: ";
  1202.         cin >> num2;
  1203.  
  1204.         if (num2 == 0)
  1205.         {
  1206.             system("CLS");
  1207.             goto defin2;
  1208.         }
  1209.         cout << "\n\n";
  1210.         break;
  1211.         case 3:
  1212. defin3:
  1213.             cout << "What one do you wish to subtract?\n\n";
  1214.             //VOID STATS!!!!!//
  1215.         num = 1;
  1216.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1217.         {
  1218.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  1219.             ++num;
  1220.             cout << "\n";
  1221.         }
  1222.         cout << num << "- Exit";
  1223.         cout << "\n";
  1224.         cout << "Choice: ";
  1225.         cin >> num2;
  1226.         if (num == num2)
  1227.         {
  1228.             system("CLS");
  1229.             goto defin;
  1230.         }
  1231.         system("CLS");
  1232.         cout << "How much do you want to subtract?\n\n";
  1233.         --num2;
  1234.         num = 0;
  1235.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1236.         {
  1237.             if(num == num2)
  1238.             {
  1239.                 cout << (*iter2).name << " = " << (*iter2).num;
  1240.             }
  1241.             ++num;
  1242.         }
  1243. //END VOID STATS
  1244.         cout << "\n\n";
  1245.         cout << "Points left: ";
  1246.         num = 0;
  1247.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  1248.         {
  1249.             if(num == num2)
  1250.             {
  1251.                 cout << (*iter2).num;
  1252.             }
  1253.             ++num;
  1254.         }
  1255.         cout << "\n\n";
  1256.  
  1257.         cout << "0- Exit\n";
  1258.         cout << "1- 1 Point\n";
  1259.         cout << "2- 5 Point\n";
  1260.         cout << "3- 10 Point\n\n";
  1261.         cout << "Choice: ";
  1262.         cin >> num2;
  1263.  
  1264.         if (num2 == 0)
  1265.         {
  1266.             system("CLS");
  1267.             goto defin3;
  1268.         }
  1269.         cout << "\n\n";
  1270.         break;
  1271.             break;
  1272.         case 4:
  1273.             cout << "You have now compleated your stats!";
  1274.             std::getchar();
  1275.             std::getchar();
  1276.             system("CLS");
  1277.             break;
  1278.         }
  1279. //VOID STATS!!!!!//
  1280. defin4:
  1281.         cout << "Skills!\n\n";
  1282.  
  1283.         num = 1;
  1284.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1285.         {
  1286.             cout << (*iter2).name << " = " << (*iter2).num;
  1287.             ++num;
  1288.             cout << "\n";
  1289.         }
  1290. //END VOID STATS
  1291.         cout << "\n1-Definition\n";
  1292.         cout << "2-Add\n";
  1293.         cout << "3-Subtract\n";
  1294.         cout << "4-Done\n";
  1295.         cout << "Choice: ";
  1296.         cin >> num2;
  1297.         system("CLS");
  1298.         switch(num2)
  1299.         {
  1300.         case 1:
  1301. defin5:
  1302.             cout << "What one do you wish to define?\n\n";
  1303.             //VOID STATS!!!!!//
  1304.         num = 1;
  1305.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1306.         {
  1307.             cout << num << "-" << (*iter2).name;
  1308.             ++num;
  1309.             cout << "\n";
  1310.         }
  1311.         cout << num << "-" << "Exit\n\n";
  1312.  
  1313.             cout << "Choice: ";
  1314.             cin >> num2;
  1315.  
  1316.             if (num == num2)
  1317.             {
  1318.                 system("CLS");
  1319.                 goto defin4;
  1320.             }
  1321.             --num2;
  1322.             num = 0;
  1323.             for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1324.             {
  1325.                 if(num == num2)
  1326.                 {
  1327.                     cout << (*iter2).dis << "\n\n";
  1328.                 }
  1329.                 ++num;
  1330.             }
  1331.             std::getchar();
  1332.             std::getchar();
  1333.             system("CLS");
  1334.             goto defin5;
  1335.  
  1336.             break;
  1337.         case 2:
  1338. defin6:
  1339.             cout << "What one do you wish to add?\n\n";
  1340.             //VOID STATS!!!!!//
  1341.             num = 1;
  1342.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1343.         {
  1344.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  1345.             ++num;
  1346.             cout << "\n";
  1347.         }
  1348.         cout << num << "- Exit";
  1349.         cout << "\n";
  1350.         cout << "Choice: ";
  1351.         cin >> num2;
  1352.         if (num == num2)
  1353.         {
  1354.             system("CLS");
  1355.             goto defin4;
  1356.         }
  1357.         system("CLS");
  1358.         cout << "How much do you want to add?\n\n";
  1359.         --num2;
  1360.         num = 0;
  1361.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1362.         {
  1363.             if(num == num2)
  1364.             {
  1365.                 cout << (*iter2).name << " = " << (*iter2).num;
  1366.             }
  1367.             ++num;
  1368.         }
  1369. //END VOID STATS
  1370.         cout << "\n\n";
  1371.         cout << "Points left: ";
  1372.         num = 0;
  1373.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1374.         {
  1375.             if(num == num2)
  1376.             {
  1377.                 cout << (*iter2).num;
  1378.             }
  1379.             ++num;
  1380.         }
  1381.         cout << "\n\n";
  1382.  
  1383.         cout << "0- Exit\n";
  1384.         cout << "1- 1 Point\n";
  1385.         cout << "2- 5 Point\n";
  1386.         cout << "3- 10 Point\n\n";
  1387.         cout << "Choice: ";
  1388.         cin >> num2;
  1389.  
  1390.         if (num2 == 0)
  1391.         {
  1392.             system("CLS");
  1393.             goto defin6;
  1394.         }
  1395.         cout << "\n\n";
  1396.         break;
  1397.         case 3:
  1398. defin7:
  1399.             cout << "What one do you wish to subtract?\n\n";
  1400.             //VOID STATS!!!!!//
  1401.         num = 1;
  1402.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1403.         {
  1404.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  1405.             ++num;
  1406.             cout << "\n";
  1407.         }
  1408.         cout << num << "- Exit";
  1409.         cout << "\n";
  1410.         cout << "Choice: ";
  1411.         cin >> num2;
  1412.         if (num == num2)
  1413.         {
  1414.             system("CLS");
  1415.             goto defin4;
  1416.         }
  1417.         system("CLS");
  1418.         cout << "How much do you want to subtract?\n\n";
  1419.         --num2;
  1420.         num = 0;
  1421.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1422.         {
  1423.             if(num == num2)
  1424.             {
  1425.                 cout << (*iter2).name << " = " << (*iter2).num;
  1426.             }
  1427.             ++num;
  1428.         }
  1429. //END VOID STATS
  1430.         cout << "\n\n";
  1431.         cout << "Points left: ";
  1432.         num = 0;
  1433.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  1434.         {
  1435.             if(num == num2)
  1436.             {
  1437.                 cout << (*iter2).num;
  1438.             }
  1439.             ++num;
  1440.         }
  1441.         cout << "\n\n";
  1442.  
  1443.         cout << "0- Exit\n";
  1444.         cout << "1- 1 Point\n";
  1445.         cout << "2- 5 Point\n";
  1446.         cout << "3- 10 Point\n\n";
  1447.         cout << "Choice: ";
  1448.         cin >> num2;
  1449.  
  1450.         if (num2 == 0)
  1451.         {
  1452.             system("CLS");
  1453.             goto defin7;
  1454.         }
  1455.         cout << "\n\n";
  1456.         break;
  1457.             break;
  1458.         case 4:
  1459.             cout << "You have now compleated your stats!";
  1460.             std::getchar();
  1461.             std::getchar();
  1462.             system("CLS");
  1463.             break;
  1464.         }
  1465.     }
  1466.     //End Free Pick//
  1467.  
  1468.     //Character
  1469.  
  1470.     //End Character
  1471.  
  1472.     system("pause");//Like a std::getchar but says to press a word to continue
  1473.     return 0;
  1474. }
Apr 26 '13 #35
weaknessforcats
9,208 Expert Mod 8TB
Expand|Select|Wrap|Line Numbers
  1. vector<struct1>stats;
  2.  
  3.     struct1 stats0;
  4.     stats0.name = "(STR)Strength";
  5.     stats0.dis = "A measure of how physically 


So you have a vector named stats. But then you create a new variable named stats0 and proceeed to put values into stats0.

Can you see that stats0 is not in the vector?

I suspect you meant to change stats[0] which is in the vector as element 0 (the first element)

Expand|Select|Wrap|Line Numbers
  1. stats[0].name = "(STR)Strength";
but you forgot the brackets. stats0 would cause a compile error so you created a variable stats0 to correct the error but in so doing the vector was abandoned.

I see this in a lot of places.
Apr 26 '13 #36
I understand that at the point you have marked its not in a vector but once I have created the stats I then put all stats in the vector:

Expand|Select|Wrap|Line Numbers
  1.     struct1 stats0;
  2.     stats0.name = "(STR)Strength";
  3.     stats0.dis = "A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.";
  4.     stats0.num = 0;
Expand|Select|Wrap|Line Numbers
  1. stats.push_back(stats0);
  2.     stats.push_back(stats1);
  3.     stats.push_back(stats2);
  4.     stats.push_back(stats3);
  5.     stats.push_back(stats4);
  6.     stats.push_back(stats5);
  7.     stats.push_back(stats6);
  8.     stats.push_back(stats7);
  9.     stats.push_back(stats8);
Then What I want to do is change the .num in stats and in weapons, I tried to just restate so all I have to do is change .num to have brackets when I restate it?

Expand|Select|Wrap|Line Numbers
  1. stats[0].num = 0;
I am still a little confused becuase 0-8 are part of the name and did not know if you added a number next to a word it could be used like so.
Apr 26 '13 #37
weaknessforcats
9,208 Expert Mod 8TB
This code:
Expand|Select|Wrap|Line Numbers
  1. stats.push_back(stats0);
does not change any data in the vector. It just adds stats0 to the end of the vector as a new item.

This code:

Expand|Select|Wrap|Line Numbers
  1. stats[0].num = 0;
uses the vector element 0, which is at the beginning of the vector, and changes the num member to 0. This updates the vector element.

The brackets are not part of the variable name. They are used to indicate where in the vector the element is located. That is, the [0] is an index into the vector named stats.
Apr 26 '13 #38
O silly me, I got messed up because I was using the numbers and got messed up thank you.
Apr 26 '13 #39
I have just about rap'ed up the intro to create a character. I am now on monsters I have a post about how to do it and will try it out: http://www.therpgsite.com/showthread...472#post651472 but I have a few questions.

1. How should I set up the monsters? Vector, array, what?

2. when calling on the to battle how would I do that?

3. Right now I am trying some vector calling and Mob1 (bat) will say that there are to many arguments in function call and do not know what is happening:
(415 - 430) is what I am questioning
Code
Expand|Select|Wrap|Line Numbers
  1. //RPG.cpp
  2. #include "stdafx.h"
  3. #include <iostream>
  4. #include <vector>
  5. #include <string>
  6. #include <fstream>
  7. #include <ctime>
  8. #include <cmath>
  9. #include <cstdio>
  10.  
  11. using namespace std;
  12.  
  13. struct struct1
  14. {
  15.     string name;
  16.     string dis;
  17.     int num;
  18. };
  19.  
  20. struct mob
  21. {
  22.     string name;
  23.     string dis;
  24.     int Lv;
  25.     int STR;
  26.     int DEX;
  27.     int CON;
  28.     int INT;
  29.     int PER;
  30.     int LUC;
  31. };
  32.  
  33. //Void//
  34. //Ends Void//
  35. int main()
  36. {
  37.     //All Data Types//
  38.  
  39.     //Voids//
  40.  
  41.     void age0(int);
  42.     void gender0(string);
  43.     void race0(string);
  44.  
  45.     //End Void//
  46.  
  47.     int damage;
  48.     int quiz = 0;
  49.     int Warrior = 0;
  50.     int Ranger = 0;
  51.     int Mage = 0;
  52.     int Rogue = 0;
  53.     int pick = 0;
  54.     //Race Define//
  55.     //If negive Legion//
  56.     //If quiz is 1 - 4 Orcs//
  57.     //If quiz is 5 - 7 Gnome//
  58.     //If quiz is 8 - 11 Drow//
  59.     //If quiz is 12 - 14 Minotaur//
  60.     //If quiz is 15 - 18 Ogres//
  61.     //If positive Order//
  62.     //If quiz is 0 - 1 Halfling//
  63.     //If quiz is 2 - 4 Human//
  64.     //If quiz is 5 - 8 Elves//
  65.     //If quiz is 9 - 10 Dwarf//
  66.     //If quiz is 11 - 13 Giant//
  67.  
  68.  
  69.     string Name;
  70.     Name = "None";
  71.     int num = 0;
  72.     int num2 = 0;
  73.  
  74.     vector<string>::const_iterator iter;
  75.     vector<string>::iterator myIterator;
  76.     vector<struct1>::const_iterator iter2;
  77.     vector<struct1>::iterator myIterator2;
  78.     vector<mob>::const_iterator iter3;
  79.     vector<mob>::iterator myIterator3;
  80.  
  81.     //Stats//
  82.     //(STR)Strength: A measure of how physically strong a character is. Strength often controls the maximum weight that the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.
  83.     //(CON)Constitution: A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.
  84.     //(DEX)Dexterity: A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).
  85.     //(INT)Intelligence: A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at "level up". In some games, it controls the rate at which experience points are earned, or the amount needed to level up.
  86.     //(PER)Perception: A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.
  87.     //(LUC)Luck: A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).
  88.  
  89.     //Vector Stats//
  90.  
  91.     vector<struct1>stats;
  92.  
  93.     //int stats//
  94.     int min = 0;
  95.     int STR = 0;
  96.     int CON = 0;
  97.     int DEX = 0;
  98.     int INT = 0;
  99.     int PER = 0;
  100.     int LUC = 0;
  101.     //end int stats//
  102.  
  103.     struct1 stats0;
  104.     stats0.name = "(STR)Strength";
  105.     stats0.dis = "A measure of how physically strong a character is. Strength often controls the maximum weight the character can carry, melee attack and/or damage, and sometimes hit points. Armor and weapons might also have a Strength requirement.";
  106.     stats0.num = 0;
  107.  
  108.     struct1 stats1;
  109.     stats1.name = "(CON)Constitution";
  110.     stats1.dis = "A measure of how resilient a character is. Constitution often influences hit points, resistances for special types of damage (poisons, illness, heat etc.) and fatigue. Many games combine Constitution and Strength.";
  111.     stats1.num = 0;
  112.  
  113.     struct1 stats2;
  114.     stats2.name = "(DEX)Dexterity";
  115.     stats2.dis = "A measure of how agile a character is. Dexterity controls attack and movement speed and accuracy, as well as evading an opponent's attack (see Armor Class).";
  116.     stats2.num = 0;
  117.  
  118.     struct1 stats3;
  119.     stats3.name = "(INT)Intelligence";
  120.     stats3.dis = "A measure of a character's problem-solving ability. Intelligence often controls a character's ability to comprehend foreign languages and their skill in magic. In some cases, intelligence controls how many skill points the character gets at 'level up'. In some games, it controls the rate at which experience points are earned, or the amount needed to level up.";
  121.     stats3.num = 0;
  122.  
  123.     struct1 stats4;
  124.     stats4.name = "(PER)Perception";
  125.     stats4.dis = "A measure of a character's openness to their surroundings. Perception controls the chance to detect vital clues, traps, or hiding enemies, and might influence combat sequence, or the accuracy of ranged attacks. Perception-type attributes are more common in more modern games. Sometimes combined with wisdom.";
  126.     stats4.num = 0;
  127.  
  128.     struct1 stats5;
  129.     stats5.name = "(LUC)Luck";
  130.     stats5.dis = "A measure of a character's luck. Luck might influence anything, but mostly random items, encounters and outstanding successes/failures (such as critical hits).";
  131.     stats5.num = 0;
  132.  
  133.     struct1 stats6;
  134.     stats6.name = "MAX_STATS";
  135.     stats6.dis = "Max number of points to add.";
  136.     stats6.num = 0;
  137.  
  138.     stats.push_back(stats0);
  139.     stats.push_back(stats1);
  140.     stats.push_back(stats2);
  141.     stats.push_back(stats3);
  142.     stats.push_back(stats4);
  143.     stats.push_back(stats5);
  144.     stats.push_back(stats6);
  145.     //End Vector Stats//
  146.     //End Stats//
  147.  
  148.     //Race//
  149.  
  150.     int race = 0;
  151.  
  152.     //Vector Race//
  153.  
  154.     vector<struct1>Race;
  155.  
  156.     //struct1 Race*;
  157.     //Race*.name = "";
  158.     //Race*.dis = "";
  159.  
  160.     struct1 Race0;
  161.     Race0.name = "Elves";
  162.     Race0.dis = "Are part of the Order. Elves are slightly shorter than humans, and have a much lighter build. They \nlack the strength and stamina of the larger races, but are far more agile, \nboth in body and mind. Elves tend to make their homes deep within secluded forests, but always remain in touch with the world around them. The easiest way to recognize an elf is by their pointy ears. Because of their affinity with nature, Elves posses the ability to blend in with their surroundings, can see in the dark, and are difficult to control through magic. They tend to have strong morals, and can instinctively sense evil creatures. While their intelligence allows them to pursue almost any type of magical or religious training they desire, Elves are limited in their choices of other vocations. Elves are physically weaker than the humans we talked about above, but they have incredible magical strength that can help make up for that. Elves also love nature - so it's unlikely you'll have one that's squeamish about things like getting dirty or being stuck out over-night in the woods. They can see in the dark, so no wild boars will be catching them off guard. That being said, your elfin character could have problems with crowds, and towns in general. It's hard to go from the quiet of nature to the bustling streets of Rune.";
  163.  
  164.     struct1 Race1;
  165.     Race1.name = "Humans";
  166.     Race1.dis = "Are part of the Order. Averaging between five and six feet in height, Humans are the most populous racein the world. The Humans have established settlements on every continent, and their appearances vary widely depending on ancestry. Almost any hair, eye, or skin color that you can imagine can be found on a group of Humans somewhere. Although they have no special biological talents like the other races, Humans are far more versatile, able to be trained in almost all classes. The Humans were the first to discover how to focus magical energies, and as a result they can utilize items to enhance their attributes more effectively than any other race. Additionally, the Human religions encourage a very personal connection with the Powers, and allow quicker reincarnation to occur.";
  167.  
  168.     struct1 Race2;
  169.     Race2.name = "Orcs";
  170.     Race2.dis = "Part of the Legion. Half-orcs often exist at the social margins. Bestial in appearance and traditionally feared by those non-orcs they encounter, half-orcs tend to be tenacious and driven to prove themselves. Some hope to show that they are different from their brutish orc kin, struggling to find the better angels of their nature, while others embrace their monstrous heritage to become terrifying exemplars of ferocity in combat. One way or another, almost all half-orcs crave respect—whether it's given freely or must be taken by force. Derided as mongrels by humans and weaklings by orcs, half-orcs have bitterness beaten into them from birth, as well as the burning will to endure and overcome. With their physical size and strength, half-orcs represent raw and primal power, yet whether that power gets used for good or evil depends entirely on the individual.";
  171.  
  172.     struct1 Race3;
  173.     Race3.name = "Dwarves";
  174.     Race3.dis = "Are part of the Order. Dwarves are short, stocky demi-humans, known for their foul tempers. They often prefer building their cities underground, and enjoy working with the earth. Dwarves are excellent miners, and possess more detailed knowledge on gems and metalsmithing than any other race. They can easily be identified by the long beards that both males and females alike wear proudly. While Dwarves are not as smart as some of the other races, they are usually wiser due to their long lifespans. Their great physical strength and stamina makes them resistant to the effects of poison, disease, and magic, and centuries of working underground have given the Dwarves a keen ability to see in the dark. While they are excellent fighters, Dwarves are not very dexterous and often distrust the use of magical spells.";
  175.  
  176.     struct1 Race4;
  177.     Race4.name = "Drow";
  178.     Race4.dis = "Part of the Legion. A Drow is an outcast Elf who, against normal Elven nature, worships the forces of darkness. Reviled by most, the Drow work in secret, learning as much as they can about black magic. They tend to dwell in underground lairs or in deep, dark forests, and avoid contact with other races unless it will help them further their knowledge of evil. They are stockier than other Elves, and tend to have darker skin as well. Although few Elves are willing to admit it, Drow possess some of the same abilities that they do. They can see in the dark, and are able to locate hidden creatures with ease. Drow are difficult to control through magical means, and in addition can avoid the effects of the necromantic forces that they know so well. However, Drow are highly vulnerable to the forces of goodness, and are often easily dispatched by holy weapons and spells.";
  179.  
  180.     struct1 Race5;
  181.     Race5.name = "Gnome";
  182.     Race5.dis = "Part of the Legion. Gnomes have been the enemies of Dwarves for many centuries. The two races are descended from a common ancestor, and the conflict between them originally arose when the Gnomes wished to focus on mechanical innovation rather than subterranean exploration. They found that their interests corresponded closely with those of the Humans, and left the Dwarven cities to live with humankind. As there has been increased interaction between the races, Gnomes have gradually learned to become more tolerant of their distant cousins. While Gnomes are much shorter than Humans, their wiry forms are more strong and durable. They have an incredible ability to regenerate, and are resistant to poison, disease, and magical attacks. Their intelligence and quickness make them well-suited for many different professions, although they are not as skilled in fighting as some of the other races.";
  183.  
  184.     struct1 Race6;
  185.     Race6.name = "Halfling";
  186.     Race6.dis = "Are part of the Order. Halflings are the most diminutive humanoid race, averaging about four feet in height. Like the elves, they tend to live in secluded communities, and are very much in tune with nature. While Halflings lack physical strength and stamina, they are quite dexterous and intelligent, relying on their wits and skill to survive. They are also one of the hairiest races of all, sprouting tufts all over their bodies. Because they are so small and agile, Halflings can move much faster than most of the larger races, often getting in two attacks before an opponent can make one. They also have the ability to avoid detection, and can easily find creatures that are attempting to hide. Because of their strong connection with the natural world, Halflings are resistant to all magical attacks.";
  187.  
  188.     struct1 Race7;
  189.     Race7.name = "Minotaur";
  190.     Race7.dis = "Part of the Legion. Minotaurs are an elite, somewhat aloof group of humanoid creatures, who believe themselves to be far better than other races. They were originally created as a magical experiment designed to make the perfect race, and their ancestry is revealed by the fact that they have the head and tail of a bull. Minotaurs are covered with thick, warm fur, and thrive on the arctic continent of Avros. Standing almost seven feet tall, Minotaurs are resistant to disease, poison, and bashing weapons. While they are by nature excellent fighters, their arrogance sometimes causes them to underestimate their opponents. Minotaurs also refuse to train in classes that they consider beneath them, and are somewhat limited in their choice of profession.";
  191.  
  192.     struct1 Race8;
  193.     Race8.name = "Ogres";
  194.     Race8.dis = "Part of the Legion. Ogres are the largest and strongest of the races, averaging over seven feet in height. They resemble enormous humans, but tend to be almost hairless. While Ogres often organize into tightly-knit communities, they tend not to interact much with the other races. Their cities are usually located in mountainous or hilly areas, and their buildings are made from stones so large that no other people would be able to move them. Because of their massive size and strength, Ogres make excellent fighters, and they are always greatly feared by their enemies. Their thick skins provide them a bonus to their armor resistance which increases as they gain in experience and makes them resistant to extreme heat and cold. They also tend to be a bit dull-witted and thus somewhat open to mental attacks. Their lack of intellect also prevents Ogres from using magic very well, and their massive size makes them ineffective as thieves.";
  195.  
  196.     struct1 Race9;
  197.     Race9.name = "Giant";
  198.     Race9.dis = "Are part of the Order. Big stomping guy, Like a human but very tall. No close fit him so he wares a bed sheat around his waist to cover him self. There dule witted and slow but pack a punch if they hit.";
  199.  
  200.     Race.push_back(Race0);
  201.     Race.push_back(Race1);
  202.     Race.push_back(Race2);
  203.     Race.push_back(Race3);
  204.     Race.push_back(Race4);
  205.     Race.push_back(Race5);
  206.     Race.push_back(Race6);
  207.     Race.push_back(Race7);
  208.     Race.push_back(Race8);
  209.     Race.push_back(Race9);
  210.     //End Vector Race//
  211.  
  212.     //End Race//
  213.  
  214.     //Classes//
  215.     int classes;
  216.  
  217.     vector<struct1>Classes;
  218.  
  219.     struct1 Classes0;
  220.     Classes0.name = "Warrior";
  221.     Classes0.dis = "Heavy built, they major in armor and health, and prefer to hold on to anything that will make a huge dent like two handed, blunt weapons, and any type of heavy weapon.";
  222.  
  223.     struct1 Classes1;
  224.     Classes1.name = "Mage";
  225.     Classes1.dis = "Usually stays in the back and away from hand to hand to hand combat, and prefer wands, staffs, and any type of enchanted item that will help harness and give more power to the user.";
  226.  
  227.     struct1 Classes2;
  228.     Classes2.name = "Rogue";
  229.     Classes2.dis = "Prefer short and quick critical hits to the back of an enemy. Weapon of choice is a dagger or throwing weapon that will allow him to sneak away silently. ";
  230.  
  231.     struct1 Classes3;
  232.     Classes3.name = "Ranger";
  233.     Classes3.dis = "Can confront an enemy in hand to hand combat would prefer to stay away from doing so if possible. There best with ";
  234.  
  235.  
  236.     Classes.push_back(Classes0);
  237.     Classes.push_back(Classes1);
  238.     Classes.push_back(Classes2);
  239.     Classes.push_back(Classes3);
  240.     //End Classes//
  241.  
  242.     //Personality quiz//
  243.  
  244.     //Q1//
  245.  
  246.     int color = 0;
  247.  
  248.     vector<string>color2;
  249.  
  250.     //vector colors//
  251.     color2.push_back("Red");
  252.     color2.push_back("Yellow");
  253.     color2.push_back("Orange");
  254.     color2.push_back("Green");
  255.     color2.push_back("Pink");
  256.     color2.push_back("Blue");
  257.     color2.push_back("Purple");
  258.     color2.push_back("White");
  259.     color2.push_back("Black");
  260.     //end vector colors//
  261.  
  262.     //Q2//
  263.     int job = 0;
  264.     vector<struct1>jobs;
  265.  
  266.     //jobs//
  267.  
  268.     struct1 job0;
  269.     job0.name = "Miner";//Warrior
  270.     job0.dis = "Uses a spade and pick to find ore, heavy built from mining in the dark.";
  271.  
  272.     struct1 job1;
  273.     job1.name = "Lumber Jack";//Warrior
  274.     job1.dis = "Cuts down trees for a living, heavy built from climing trees and useing the axe.";
  275.  
  276.     struct1 job2;
  277.     job2.name = "Gardner";//Ranger
  278.     job2.dis = "Tends to plants and loves nature, very agile and quite flimsy.";
  279.  
  280.     struct1 job3;
  281.     job3.name = "Blacksmith";//Warrior
  282.     job3.dis = "Makes armor and weapons, heavy built from hammering steal.";
  283.  
  284.     struct1 job4;
  285.     job4.name = "Hunter";//Ranger
  286.     job4.dis = "Agile and has a talent of sneeking up to animals with ease.";
  287.  
  288.     struct1 job5;
  289.     job5.name = "Farmer";////Rogue
  290.     job5.dis = "is a mix between a Gardner and Hunter.";
  291.  
  292.     struct1 job6;
  293.     job6.name = "Guard";//Warrior
  294.     job6.dis = "is a battle ready person ready to serve and protect.";
  295.  
  296.     struct1 job7;//None
  297.     job7.name = "Tavern Keeper";
  298.     job7.dis = ".";
  299.  
  300.     struct1 job8;
  301.     job8.name = "Assassin";//Rogue
  302.     job8.dis = "is an expert at stelth and can be as cunning as a fox.";
  303.  
  304.     struct1 job9;
  305.     job9.name = "None";//None
  306.     job9.dis = "... use your imagination";
  307.  
  308.     //end jobs//
  309.  
  310.     //Vector//
  311.     jobs.push_back(job0);
  312.     jobs.push_back(job1);
  313.     jobs.push_back(job2);
  314.     jobs.push_back(job3);
  315.     jobs.push_back(job4);
  316.     jobs.push_back(job5);
  317.     jobs.push_back(job6);
  318.     jobs.push_back(job7);
  319.     jobs.push_back(job8);
  320.     jobs.push_back(job9);
  321.     //end Vector//
  322.  
  323.     //Q3//
  324.  
  325.     int weapon = 0;
  326.  
  327.     vector<struct1>Weapon;
  328.  
  329.     //Weapons//
  330.     struct1 weap0;
  331.     weap0.name = "One Handed Weapons";
  332.     weap0.dis = "Consists of daggers, short swords, certain maces and battle axes";
  333.     weap0.num = 0;
  334.  
  335.     struct1 weap1;
  336.     weap1.name = "Two Handed Weapons";
  337.     weap1.dis = "Heavier weapons that can't be used with a sheild and can't be dule wealded";
  338.     weap1.num = 0;
  339.  
  340.     struct1 weap2;
  341.     weap2.name = "Polearms";
  342.     weap2.dis = "Consists of lances, and long sticks.";
  343.     weap2.num = 0;
  344.  
  345.     struct1 weap3;
  346.     weap3.name = "Archery";
  347.     weap3.dis = "Bows and arrows bro fast to reload.";
  348.     weap3.num = 0;
  349.  
  350.     struct1 weap4;
  351.     weap4.name = "Crossbows";
  352.     weap4.dis = "Crossbows and arrows, slow to reload bigger punch.";
  353.     weap4.num = 0;
  354.  
  355.     struct1 weap5;
  356.     weap5.name = "Throwing";
  357.     weap5.dis = "anything that is small and has a shap pointy bit.";
  358.     weap5.num = 0;
  359.  
  360.     struct1 weap6;
  361.     weap6.name = "Sorcery";
  362.     weap6.dis = "Magic things, Wands, Staffs, Books, Crystals, ect...";
  363.     weap6.num = 0;
  364.  
  365.     struct1 weap7;
  366.     weap7.name = "MAX_SKILL";
  367.     weap7.dis = ".";
  368.     weap7.num = 0;
  369.     //end Weapons//
  370.  
  371.     //Vector Weapons//
  372.  
  373.     Weapon.push_back(weap0);
  374.     Weapon.push_back(weap1);
  375.     Weapon.push_back(weap2);
  376.     Weapon.push_back(weap3);
  377.     Weapon.push_back(weap4);
  378.     Weapon.push_back(weap5);
  379.     Weapon.push_back(weap6);
  380.     Weapon.push_back(weap7);
  381.  
  382.     //End Vector Weapons//
  383.  
  384.     //Q4//
  385.     int society = 0;
  386.  
  387.     string clas [6] = {"Royal Blood", "Baron/Lady", "Knight", "Squire", "Peasant", "Serf"};
  388.  
  389.     //Q5//
  390.     int age = 0;
  391.  
  392.     //Q6//
  393.     int moat = 0;
  394.  
  395.     string emoat [16] = {"Exhaustion", "Confusion", "Ecstatic", "Guilty", "Suspiciousness", "Anger", "Hysterical", "Frustrated", "Sadness", "Confident", "Embarrassed", "Happyness", "Mischievous", "Disgusted", "Frightened", "Crazyness"};
  396.  
  397.     //Q7//
  398.  
  399.     int gender = 0;
  400.  
  401.     //Q8//
  402.  
  403.     int gardian = 0;
  404.  
  405.     //Q9//
  406.  
  407.     int animal = 0;
  408.  
  409.     //Q10//
  410.  
  411.     int advance = 0;
  412.  
  413.     //end personality quiz//
  414.  
  415.     //Monsters//
  416.     vector<mob>Monster;
  417.  
  418.     mob Mob1;
  419.     Mob1.name = "Bat";
  420.     Mob1.dis = ".";
  421.     Mob1.Lv = 1;
  422.     Mob1.STR = 1;
  423.     Mob1.DEX = 15;
  424.     Mob1.CON = 6;
  425.     Mob1.INT = 2;
  426.     Mob1.PER = 14;
  427.     Mob1.LUC = 5;
  428.  
  429.     Monster.pop_back(Mob1);
  430.     //End Monsters//
  431.  
  432.     //End Data Types//
  433.  
  434.     //Intro//
  435.     cout << "Welcome adventurer!";
  436.     std::getchar();//Like a system pause with no words
  437.     cout << "You will now embark on the adventure of your lifetime!";
  438.     std::getchar();
  439.     cout << "\nOn your journey you will face life and death situations,\n";
  440.     cout << "Solve complex puzzles and save the world like every one else wants to do.\n";
  441.     std::getchar();
  442.     cout << "By the way...\n";
  443.     cout << "What is your name?";
  444.     cout << "\nName: ";
  445.     cin >> Name;
  446.     cout << "\nGreat! Nice to meet you " << Name << "!\n";
  447.     std::getchar();
  448.     std::getchar();
  449.     system("CLS");
  450.  
  451.     //Test//
  452.  
  453.     //This could be for testing//
  454.  
  455.     cout << "Before we get started and I toss you into some random place I feel like\n";
  456.     cout << "putting you, let's see what you're really made of.\n";
  457.     std::getchar();
  458.     cout << "First, the rules! When you run into a bug/error, please take a screen shot\n";
  459.     cout << "or write down where it happened and let me know. That's pretty much it.\n";
  460.     cout << "Now on to the character selection!\n";
  461.     std::getchar();
  462.     system("CLS");
  463.  
  464. pick:
  465.     cout << "Do you want to take a personality quiz,\nor to choose your own stats?\n\n";
  466.     cout << "1- Personality Quiz\n";
  467.     cout << "2- Choose your own\n\n";
  468.     cout << "Choice: ";
  469.     cin >> num;
  470.  
  471.     if (num != 1 && num != 2)
  472.     {
  473.         cout << "You can't do that!";
  474.         std::getchar();
  475.         std::getchar();
  476.         system("CLS");
  477.         goto pick;
  478.     }
  479.  
  480.     system("CLS");
  481.  
  482.     switch(num)
  483.     {
  484.         //Personality Quiz//
  485.  
  486. //Q1//
  487.     case 1:
  488.         cout << "You have picked the personality quiz!\n";
  489.         cout << "Is this what you want?\n\n";
  490.         cout << "1-Yes\n";
  491.         cout << "2-No\n";
  492.         cout << "Choice: ";
  493.         cin >> num;
  494.  
  495.         if (num != 1 && num != 2)
  496.         {
  497.             cout << "That is not posible!";
  498.             std::getchar();
  499.             std::getchar();
  500.             system("CLS");
  501.             goto pick;
  502.         }
  503.  
  504.         switch(num)
  505.         {
  506.         case 1:
  507.             system("CLS");
  508.             break;
  509.         case 2:
  510.             system("CLS");
  511.             goto pick;
  512.         }
  513.  
  514.         if (num !=1 && num != 2)
  515.         {
  516.             cout << "You cant do that!";
  517.             system("CLS");
  518.             goto pick;
  519.         }
  520.         pick = 1;
  521.         cout << "Now! First question to figure out your mind!\n\n";
  522. wrong:
  523.         cout << "What is your favorit color?\n\n";
  524.         num = 1;
  525.  
  526.         for(iter = color2.begin(); iter != color2.end(); ++iter)
  527.         {
  528.             cout << num << "-" << *iter << "\n";
  529.             ++num;
  530.         }
  531.  
  532.         cout << "Choice: ";
  533.         cin >> color;
  534.  
  535.         if (color <= 0 || color > 9)
  536.         {
  537.             cout << "You cant do that!";
  538.             std::getchar();
  539.             std::getchar();
  540.             system("CLS");
  541.             goto wrong;
  542.         }
  543.  
  544.         --color;
  545.  
  546.         num = 0;
  547.         for (iter = color2.begin(); iter != color2.end(); ++iter)
  548.         {
  549.             if(num == color)
  550.             {
  551.                 cout << "Is "<< *iter <<" truly what you want?\n";
  552.             }
  553.  
  554.             ++num;
  555.         }
  556.  
  557.         cout << "1-Yes\n";
  558.         cout << "2-No\n";
  559.         cout << "Choice: ";
  560.         cin >> num;
  561.  
  562.         switch(num)
  563.         {
  564.         case 1:
  565.             system("CLS");
  566.             break;
  567.         case 2:
  568.             system("CLS");
  569.             goto wrong;
  570.         }
  571.         if (num !=1 && num != 2)
  572.         {
  573.             cout << "You cant do that!";
  574.             std::getchar();
  575.             std::getchar();
  576.             system("CLS");
  577.             goto wrong;
  578.         }
  579.  
  580.         //Quiz//
  581.         switch(color)
  582.         {
  583.         case 0://red
  584.             quiz = quiz - 2;
  585.             break;
  586.         case 1://yellow
  587.             quiz = quiz + 0;
  588.             break;
  589.         case 2://orange
  590.             quiz = quiz - 1;
  591.             break;
  592.         case 3://green
  593.             quiz = quiz + 2;
  594.             break;
  595.         case 4://pink
  596.             quiz = quiz + 2;
  597.             break;
  598.         case 5://blue
  599.             quiz = quiz + 1;
  600.             break;
  601.         case 6://purple
  602.             quiz = quiz - 1;
  603.             break;
  604.         case 7://white
  605.             quiz = quiz + 3;
  606.             break;
  607.         case 8://black
  608.             quiz = quiz - 3;
  609.             break;
  610.         }
  611. //Q2//
  612.  
  613. wrong2:
  614.         cout << "Question 2!\n\n";
  615.         cout << "If you had to pick a job from this list what would it be?\n\n";
  616.         num = 1;
  617.  
  618.         for(iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  619.         {
  620.             cout << num << "-" << (*iter2).name << "\n";
  621.             ++num;
  622.         }
  623.  
  624.         cout << "Choice: ";
  625.         cin >> job;
  626.  
  627.         if (job <1 || job > 10)
  628.         {
  629.             cout << "You cant do that!";
  630.             std::getchar();
  631.             std::getchar();
  632.             system("CLS");
  633.             goto wrong2;
  634.         }
  635.  
  636.         --job;
  637.  
  638.         num = 0;
  639.         for (iter2 = jobs.begin(); iter2 != jobs.end(); ++iter2)
  640.         {
  641.             if(num == job)
  642.             {
  643.                 cout << "A " << (*iter2).name << " " <<(*iter2).dis << "\n\n";
  644.             }
  645.             ++num;
  646.         }
  647.  
  648.         cout << "1-Yes\n";
  649.         cout << "2-No\n";
  650.         cout << "Choice: ";
  651.         cin >> num;
  652.  
  653.         switch(num)
  654.         {
  655.         case 1:
  656.             system("CLS");
  657.             break;
  658.         case 2:
  659.             system("CLS");
  660.             goto wrong2;
  661.         }
  662.  
  663.         if (num !=1 && num != 2)
  664.         {
  665.             cout << "You cant do that!";
  666.             std::getchar();
  667.             std::getchar();
  668.             system("CLS");
  669.             goto wrong2;
  670.         }
  671.  
  672.         //Quiz// 
  673.         //Warrior Ranger Rogue
  674.         switch(job)
  675.         {
  676.         case 0: //Miner 
  677.             quiz = quiz + 1;
  678.             ++Warrior;
  679.             break;
  680.         case 1://Lumber Jack 
  681.             quiz = quiz - 1;
  682.             ++Warrior;
  683.             break;
  684.         case 2://Gardner 
  685.             quiz = quiz + 2;
  686.             ++Ranger;
  687.             break;
  688.         case 3://Blacksmith 
  689.             quiz = quiz + 1;
  690.             ++Warrior;
  691.             break;
  692.         case 4://Hunter 
  693.             quiz = quiz - 1;
  694.             ++Ranger;
  695.             break;
  696.         case 5://Farmer 
  697.             ++Rogue;
  698.             break;
  699.         case 6://Guard
  700.             if (quiz >= 0)
  701.             {
  702.                 quiz = quiz + 2;
  703.             }
  704.             else 
  705.             {
  706.                 quiz = quiz - 2;
  707.             }
  708.             ++Warrior;
  709.             break;
  710.         case 7:// Tavern Keeper
  711.             quiz = quiz - 3;
  712.             break;
  713.         case 8://Assassin 
  714.             quiz = quiz - 2;
  715.             ++Rogue;
  716.             break;
  717.         case 9://None
  718.  
  719.             break;
  720.         }
  721.  
  722. //Q3//
  723. wrong3:
  724.         cout << "Question 3!\n\n";
  725.         cout << "What type of class are you??\n\n";
  726.  
  727.         num = 1;
  728.         for(iter2 = Classes.begin(); iter2 !=Classes.end(); ++iter2)
  729.         {
  730.             cout <<num <<"-" << (*iter2).name << "\n";
  731.             ++num;
  732.         }
  733.  
  734.         cout << "Choice: ";
  735.         cin >> classes;
  736.  
  737.         if (classes < 1 || classes > 4)
  738.         {
  739.             cout << "You cant do that!";
  740.             std::getchar();
  741.             std::getchar();
  742.             system("CLS");
  743.             goto wrong3;
  744.         }
  745.  
  746.         --classes;
  747.  
  748.         if (weapon >= 0 && weapon <=3)
  749.         {
  750.  
  751.             num = 0;
  752.             for (iter2 = Classes.begin(); iter2 != Classes.end(); ++iter2)
  753.             {
  754.                 if(num == classes)
  755.                 {
  756.                     cout << "\n" << (*iter2).name << ", " <<(*iter2).dis << "\n\n";
  757.                 }
  758.                 ++num;
  759.             }
  760.         }
  761.  
  762.         else
  763.         {
  764.             cout << "You cant do that!";
  765.             std::getchar();
  766.             std::getchar();
  767.             system("CLS");
  768.             goto wrong3;
  769.         }
  770.  
  771.         cout << "1-Yes\n";
  772.         cout << "2-No\n";
  773.         cout << "Choice: ";
  774.         cin >> num;
  775.  
  776.         switch(num)
  777.         {
  778.         case 1:
  779.             system("CLS");
  780.             break;
  781.         case 2:
  782.             system("CLS");
  783.             goto wrong3;
  784.         }
  785.  
  786.         if (num !=1 && num != 2)
  787.         {
  788.             cout << "You cant do that!";
  789.             std::getchar();
  790.             std::getchar();
  791.             system("CLS");
  792.             goto wrong3;
  793.         }
  794.  
  795.         //Quiz//
  796.         switch(classes)
  797.         {
  798.         case 0://Warrior
  799.             ++Warrior;
  800.             break;
  801.         case 1://Mage
  802.             ++Mage;
  803.             break;
  804.         case 2://Rogue
  805.             ++Rogue;
  806.             break;
  807.         case 3://Ranger
  808.             ++Ranger;
  809.             break;
  810.         }
  811. //Q4//
  812.  
  813. wrong4:
  814.         cout << "Question 4!\n\n";
  815.         cout << "What class do you reside under?\n";
  816.  
  817.         num= 1;
  818.         for (int i = 0; i < 6; i++)
  819.         {
  820.             cout << num << "-";
  821.             cout << clas[i] << endl;                  
  822.             ++num;
  823.         }
  824.  
  825.         cout << "Choice: ";
  826.         cin >> society;
  827.  
  828.         if (society < 1 || society > 6)
  829.         {
  830.             cout << "You cant do that!";
  831.             std::getchar();
  832.             std::getchar();
  833.             system("CLS");
  834.             goto wrong4;
  835.         }
  836.  
  837.         --society;
  838.  
  839.         cout << clas[society]<< " is the rank you have chosen do you truely want this?\n";
  840.  
  841.         cout << "1-Yes\n";
  842.         cout << "2-No\n";
  843.         cout << "Choice: ";
  844.         cin >> num;
  845.  
  846.         switch(num)
  847.         {
  848.         case 1:
  849.             system("CLS");
  850.             break;
  851.         case 2:
  852.             system("CLS");
  853.             goto wrong4;
  854.         }
  855.  
  856.         if (num !=1 && num != 2)
  857.         {
  858.             cout << "You cant do that!";
  859.             std::getchar();
  860.             std::getchar();
  861.             system("CLS");
  862.             goto wrong4;
  863.         }
  864.  
  865.         //What class/rank in society are you?//
  866.         //peasant, king, lord, urchin(poor child), slave, 
  867.  
  868.         //Quiz//
  869.         switch(society)
  870.         {
  871.         case 0://Royal
  872.             ++Mage;
  873.             ++Warrior;
  874.             break;
  875.         case 1://Baron/Lady
  876.             ++Warrior;
  877.             ++Ranger;
  878.             break;
  879.         case 2://Knight
  880.             ++Warrior;
  881.             ++Rogue;
  882.             break;
  883.         case 3://Squire
  884.             ++Ranger;
  885.             ++Mage;
  886.             break;
  887.         case 4://Peasant
  888.             ++Ranger;
  889.             ++Rogue;
  890.             break;
  891.         case 5://Serf
  892.             ++Rogue;
  893.             ++Mage;
  894.             break;
  895.         }
  896.  
  897. //Q5//
  898. wrong5:
  899.         cout << "Question 5!\n\n";
  900.  
  901.         cout << "What is your age?\n\n";
  902.  
  903.         cout << "Choice: ";
  904.         cin >> age;
  905.  
  906.         if (age < 1 || age > 120)
  907.         {
  908.             cout << "You can't be that age!";
  909.             std::getchar();
  910.             std::getchar();
  911.             system("CLS");
  912.             goto wrong5;
  913.         }
  914.  
  915.         else if (age >= 1 && age <= 12)
  916.         {
  917.             cout << "So young to go on an adventure, are you telling the truth?\n";
  918.             quiz = quiz + 2;
  919.         }
  920.  
  921.         else if (age > 12 && age < 20)
  922.         {
  923.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  924.             ++quiz;
  925.         }
  926.  
  927.         else if (age >= 20 && age < 40)
  928.         {
  929.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  930.         }
  931.  
  932.         else if (age >= 40 && age < 80)
  933.         {
  934.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  935.             --quiz;
  936.         }
  937.  
  938.         else if (age >= 80 && age <= 120)
  939.         {
  940.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  941.             quiz = quiz - 2;
  942.         }
  943.  
  944.         cout << "1-Yes\n";
  945.         cout << "2-No\n";
  946.         cout << "Choice: ";
  947.         cin >> num;
  948.  
  949.         switch(num)
  950.             {
  951.             case 1:
  952.                 system("CLS");
  953.                 break;
  954.             case 2:
  955.                 system("CLS");
  956.                 goto wrong5;
  957.                 break;
  958.             }
  959.  
  960.         if (num !=1 && num != 2)
  961.         {
  962.             cout << "You cant do that!";
  963.             std::getchar();
  964.             std::getchar();
  965.             system("CLS");
  966.             goto wrong5;
  967.         }
  968.  
  969. //Q6//
  970.  
  971. wrong6:
  972.         cout << "Question 6!\n\n";
  973.  
  974.         cout << "Emotions define a character, what is yours?\n";
  975.  
  976.         num= 1;
  977.         for (int i = 0; i < 16; i++)
  978.         {
  979.             cout << num << "-";
  980.             cout << emoat[i] << endl;                  
  981.             ++num;
  982.         }
  983.  
  984.         cout << "Choice: ";
  985.         cin >> moat;
  986.  
  987.         if (moat < 1 || moat > 16)
  988.         {
  989.             cout << "You cant do that!";
  990.             std::getchar();
  991.             std::getchar();
  992.             system("CLS");
  993.             goto wrong6;
  994.         }
  995.  
  996.         --moat;
  997.  
  998.         cout << emoat[moat] << " discribes what you are inside, are you mistaken?\n";
  999.  
  1000.         cout << "1-No\n";
  1001.         cout << "2-Yes\n";
  1002.         cout << "Choice: ";
  1003.         cin >> num;
  1004.  
  1005.         switch(num)
  1006.             {
  1007.             case 1:
  1008.                 system("CLS");
  1009.                 break;
  1010.             case 2:
  1011.                 system("CLS");
  1012.                 goto wrong6;
  1013.                 break;
  1014.             }
  1015.  
  1016.         if (num !=1 && num != 2)
  1017.         {
  1018.             cout << "You cant do that!";
  1019.             std::getchar();
  1020.             std::getchar();
  1021.             system("CLS");
  1022.             goto wrong6;
  1023.         }
  1024.  
  1025.         //Quiz// //Warrior, Mage, Rogue, Ranger// //quiz//
  1026.         switch(moat)
  1027.         {
  1028.         case 0://Exhaustion
  1029.             ++Warrior;
  1030.             ++Mage;
  1031.             ++quiz;
  1032.             break;
  1033.         case 1://Confusion
  1034.             ++Mage;
  1035.             ++Rogue;
  1036.             --quiz;
  1037.             break;
  1038.         case 2://Ecstatic
  1039.             ++quiz;
  1040.             ++Ranger;
  1041.             ++Warrior;
  1042.             break;
  1043.         case 3://Guilty
  1044.             --quiz;
  1045.             ++Rogue;
  1046.             ++Mage;
  1047.             break;
  1048.         case 4://Suspiciousness
  1049.             --quiz;
  1050.             ++Warrior;
  1051.             ++Rogue;
  1052.             break;
  1053.         case 5://Anger
  1054.             --quiz;
  1055.             ++Warrior;
  1056.             ++Mage;
  1057.             break;
  1058.         case 6://Hysterical
  1059.             ++quiz;
  1060.             ++Ranger;
  1061.             ++Rogue;
  1062.             break;
  1063.         case 7://Frustrated
  1064.             --quiz;
  1065.             ++Rogue;
  1066.             ++Ranger;
  1067.             break;
  1068.         case 8://Sadness
  1069.             ++quiz;
  1070.             ++Ranger;
  1071.             ++Mage;
  1072.             break;
  1073.         case 9://Confident
  1074.             ++quiz;
  1075.             ++Warrior;
  1076.             ++Ranger;
  1077.             break;
  1078.         case 10://Embarrassed
  1079.             ++quiz;
  1080.             ++Mage;
  1081.             ++Rogue;
  1082.             break;
  1083.         case 11://Happyness
  1084.             ++quiz;
  1085.             ++Mage;
  1086.             ++Ranger;
  1087.             break;
  1088.         case 12://Mischievous
  1089.             --quiz;
  1090.             ++Rogue;
  1091.             ++Mage;
  1092.             break;
  1093.         case 13://Disgusted
  1094.             --quiz;
  1095.             ++Warrior;
  1096.             ++Ranger;
  1097.             break;
  1098.         case 14://Frightend
  1099.             --quiz;
  1100.             ++Ranger;
  1101.             ++Rogue;
  1102.             break;
  1103.         case 15://Crazyness
  1104.             --quiz;
  1105.             ++Mage;
  1106.             ++Rogue;
  1107.             break;
  1108.         }
  1109.  
  1110. //Q7//
  1111. wrong7:
  1112.         cout << "Question 7!\n\n";
  1113.         cout << "What is your gender?\n";
  1114.         cout << "1-Male\n";
  1115.         cout << "2-Female\n";
  1116.         cout << "3-Hidden\n";
  1117.         cout << "Choice: ";
  1118.         cin >> gender;
  1119.  
  1120.         cout << "\n";
  1121.  
  1122.         if (gender == 1)
  1123.         {
  1124.             cout << "Male side.";
  1125.         }
  1126.  
  1127.         else if (gender == 2)
  1128.         {
  1129.             cout << "Female side.";
  1130.         }
  1131.  
  1132.         else if (gender == 3)
  1133.         {
  1134.             cout << "You have no side, you are a mystery.";
  1135.             quiz = quiz - 3;
  1136.         }
  1137.  
  1138.         else
  1139.         {
  1140.             cout << "That is not posible please pick another number";
  1141.             std::getchar();
  1142.             std::getchar();
  1143.             system("CLS");
  1144.             goto wrong7;
  1145.         }
  1146.  
  1147.         cout << "\nIs this what you are?\n";
  1148.         cout << "1-Yes\n";
  1149.         cout << "2-No\n";
  1150.         cout << "Choice: ";
  1151.         cin >> num;
  1152.  
  1153.         switch(num)
  1154.         {
  1155.             case 1:
  1156.                 system("CLS");
  1157.                 break;
  1158.             case 2:
  1159.                 system("CLS");
  1160.                 goto wrong7;
  1161.                 break;
  1162.         }
  1163.  
  1164.         if (num != 1 && num != 2)
  1165.         {
  1166.             cout << "That is not possible!";
  1167.             std::getchar();
  1168.             std::getchar();
  1169.             system("CLS");
  1170.             goto wrong7;
  1171.         }
  1172.  
  1173. //Q8//
  1174.         if (age >= 20)
  1175.         {
  1176.             cout << "When you were young who did you look up to?\n\n";
  1177.         }
  1178.  
  1179.         else if (age < 20)
  1180.         {
  1181.             cout << "Who do you look up to at such a young age?\n\n";
  1182.         }
  1183.  
  1184. wrong8:
  1185.         cout << "Do you look up to a gray haird man, his face warn by the years. His eyes wize   and powerfull yet his arrogance all ways get the best of him.\n\n";
  1186.  
  1187.         cout << "1-Yes\n";
  1188.         cout << "2-No\n";
  1189.         cout << "Choice: ";
  1190.         cin >> gardian;
  1191.  
  1192.         if (gardian != 1 && gardian != 2)
  1193.         {
  1194.             cout << "That is not possible!";
  1195.             std::getchar();
  1196.             std::getchar();
  1197.             system("CLS");
  1198.             goto wrong8;
  1199.         }
  1200.  
  1201.         switch(gardian)
  1202.         {
  1203.         case 1:
  1204.             system("CLS");
  1205.             gardian = 0;
  1206.             break;
  1207.         case 2:
  1208.                 system("CLS");
  1209.                 cout << "Do you look up to your mother sweet and kind, her love pushes you to go forward.\n";
  1210.  
  1211.                 cout << "1-Yes\n";
  1212.                 cout << "2-No\n";
  1213.                 cout << "Choice: ";
  1214.                 cin >> gardian;    
  1215.  
  1216.                 if (gardian != 1 && gardian != 2)
  1217.                 {
  1218.                     cout << "That is not possible!";
  1219.                     std::getchar();
  1220.                     std::getchar();
  1221.                     system("CLS");
  1222.                     goto wrong8;
  1223.                 }
  1224.  
  1225.                 switch(gardian)
  1226.                 {
  1227.                 case 1:
  1228.                     system("CLS");
  1229.                     gardian = 1;
  1230.                     quiz = quiz + 2;
  1231.                     break;
  1232.                 case 2:
  1233.                     system("CLS");
  1234.                     cout << "Do you think of a tall brode oger, living beond humans generations at a time. His strangth un matched.\n";
  1235.  
  1236.                     cout << "1-Yes\n";
  1237.                     cout << "2-No\n";
  1238.                     cout << "Choice: ";
  1239.                     cin >> gardian;
  1240.  
  1241.                     if (gardian != 1 && gardian != 2)
  1242.                     {
  1243.                         cout << "That is not possible!";
  1244.                         std::getchar();
  1245.                         std::getchar();
  1246.                         system("CLS");
  1247.                         goto wrong8;
  1248.                     }
  1249.  
  1250.                     switch(gardian)
  1251.                     {
  1252.                     case 1:
  1253.                         system("CLS");
  1254.                         gardian = 2;
  1255.                         quiz = quiz - 3;
  1256.                         break;
  1257.                     case 2:
  1258.                         system("CLS");
  1259.                         cout << "Do you look up to a man, his eyes sharp and quick, some times it feals like he has eyes in the back of his head, always alert.\n";
  1260.                         cout << "1-Yes\n";
  1261.                         cout << "2-No\n";
  1262.                         cout << "Choice: ";
  1263.                         cin >> gardian;
  1264.  
  1265.                         if (gardian != 1 && gardian != 2)
  1266.                         {
  1267.                             cout << "That is not possible!";
  1268.                             std::getchar();
  1269.                             std::getchar();
  1270.                             system("CLS");
  1271.                             goto wrong8;
  1272.                         }
  1273.  
  1274.                         switch(gardian)
  1275.                         {
  1276.                         case 1:
  1277.                             system("CLS");
  1278.                             gardian = 3;
  1279.                             --quiz;
  1280.                             break;
  1281.                         case 2:
  1282.                             system("CLS");
  1283.                             cout << "Does he have the look of sad eyes and strong arms, he acts with kindness with others.\n";
  1284.  
  1285.                             cout << "1-Yes\n";
  1286.                             cout << "2-No\n";
  1287.                             cout << "Choice: ";
  1288.                             cin >> gardian;
  1289.  
  1290.                             switch(gardian)
  1291.                             {
  1292.                             case 1:
  1293.                                 system("CLS");
  1294.                                 gardian = 4;
  1295.                                 ++quiz;
  1296.                                 break;
  1297.                             case 2:
  1298.                                 system("CLS");
  1299.                                 goto wrong8;
  1300.                                 break;
  1301.                             }
  1302.                             system("CLS");
  1303.                             break;
  1304.                         }
  1305.                     }
  1306.                     break;
  1307.                 }
  1308.                 break;
  1309.             }
  1310.  
  1311. //Q9//
  1312. wrong9:
  1313.         cout << "What is your animal\n\n";
  1314.  
  1315.         num = 0;
  1316.         while (num != 9)
  1317.         {
  1318.             ++num;
  1319.             cout << num << "-";
  1320.  
  1321.             switch (num)
  1322.             {
  1323.             case 1:
  1324.                 cout << "Frog\n";
  1325.                 break;
  1326.             case 2:
  1327.                 cout << "Rat\n";
  1328.                 break;
  1329.             case 3:
  1330.                 cout << "Dragon\n";
  1331.                 break;
  1332.             case 4:
  1333.                 cout << "Snake\n";
  1334.                 break;
  1335.             case 5:
  1336.                 cout << "Dog\n";
  1337.                 break;
  1338.             case 6:
  1339.                 cout << "Bull\n";
  1340.                 break;
  1341.             case 7:
  1342.                 cout << "Cat\n";
  1343.                 break;
  1344.             case 8:
  1345.                 cout << "Fox\n";
  1346.                 break;
  1347.             case 9:
  1348.                 cout << "Raven\n";
  1349.                 break;
  1350.             }
  1351.         }
  1352.  
  1353.         cout << "Witch animale will you pick?\n";
  1354.         cout << "Choice: ";
  1355.         cin >> animal;
  1356.         cout << "Is ";
  1357.  
  1358.         switch (animal)
  1359.             {
  1360.             case 1:
  1361.                 cout << "Frog ";
  1362.                 //quiz = quiz - 2;
  1363.                 break;
  1364.             case 2:
  1365.                 cout << "Rat ";
  1366.                 //quiz = quiz - 3;
  1367.                 break;
  1368.             case 3:
  1369.                 cout << "Dragon ";
  1370.                 //quiz = quiz + 2;
  1371.                 break;
  1372.             case 4:
  1373.                 cout << "Snake ";
  1374.                 //quiz = quiz - 2;
  1375.                 break;
  1376.             case 5:
  1377.                 cout << "Dog ";
  1378.                 //quiz = quiz + 3;
  1379.                 break;
  1380.             case 6:
  1381.                 cout << "Bull ";
  1382.                 //--quiz;
  1383.                 break;
  1384.             case 7:
  1385.                 cout << "Cat ";
  1386.                 //--quiz;
  1387.                 break;
  1388.             case 8:
  1389.                 cout << "Fox ";
  1390.                 //--quiz;
  1391.                 break;
  1392.             case 9:
  1393.                 cout << "Raven ";
  1394.                 //--quiz;
  1395.                 break;
  1396.             }
  1397.  
  1398.         if (animal < 1 || animal > 9)
  1399.         {
  1400.             cout << "That is not possible!";
  1401.             std::getchar();
  1402.             std::getchar();
  1403.             system("CLS");
  1404.             goto wrong9;
  1405.         }
  1406.         cout << "your choice?\n";
  1407.         cout << "1-Yes\n";
  1408.         cout << "2-No\n";
  1409.         cout << "Choice: ";
  1410.         cin >> num;
  1411.  
  1412.         switch(num)
  1413.             {
  1414.             case 1:
  1415.                 system("CLS");
  1416.                 break;
  1417.             case 2:
  1418.                 system("CLS");
  1419.                 goto wrong9;
  1420.                 break;
  1421.             }
  1422.  
  1423.             if (num != 1 && num != 2)
  1424.             {
  1425.                 cout << "\n\nThat is not possible!";
  1426.                 std::getchar();
  1427.                 std::getchar();
  1428.                 system("CLS");
  1429.                 goto wrong9;
  1430.             }
  1431.  
  1432.             switch (animal)
  1433.             {
  1434.             case 1:
  1435.                // cout << "Frog ";
  1436.                 quiz = quiz - 2;
  1437.                 break;
  1438.             case 2:
  1439.                // cout << "Rat ";
  1440.                 quiz = quiz - 3;
  1441.                 break;
  1442.             case 3:
  1443.                 //cout << "Dragon ";
  1444.                 quiz = quiz + 2;
  1445.                 break;
  1446.             case 4:
  1447.                 //cout << "Snake ";
  1448.                 quiz = quiz - 2;
  1449.                 break;
  1450.             case 5:
  1451.                 //cout << "Dog ";
  1452.                 quiz = quiz + 2;
  1453.                 break;
  1454.             case 6:
  1455.                 //cout << "Bull ";
  1456.                 --quiz;
  1457.                 break;
  1458.             case 7:
  1459.                 //cout << "Cat ";
  1460.                 --quiz;
  1461.                 break;
  1462.             case 8:
  1463.                 //cout << "Fox ";
  1464.                 --quiz;
  1465.                 break;
  1466.             case 9:
  1467.                 //cout << "Raven ";
  1468.                 --quiz;
  1469.                 break;
  1470.             }
  1471.  
  1472. //Q10//
  1473.  
  1474. wrong10:
  1475.         cout << "What people skills do you advance in?\n\n";
  1476.  
  1477.         cout << "1-Socializing\n";
  1478.         cout << "2-Trust\n";
  1479.         cout << "3-Respect\n";
  1480.         cout << "4-Team Work\n";
  1481.         cout << "5-Leadership\n";
  1482.         cout << "6-Empathizing\n";
  1483.         cout << "7-Courage\n";
  1484.         cout << "8-None\n";
  1485.         cout << "Choice: ";
  1486.         cin >> advance;
  1487.  
  1488.         if (advance < 1 || advance > 8)
  1489.         {
  1490.             cout << "That is not possible!";
  1491.             std::getchar();
  1492.             std::getchar();
  1493.             system("CLS");
  1494.             goto wrong10;
  1495.         }
  1496.  
  1497.         cout << "Do you truly ";
  1498.  
  1499.         switch (advance)
  1500.         {
  1501.             case 1:
  1502.                 cout << "Love to socialize?";
  1503.                 break;
  1504.             case 2:
  1505.                 cout << "Trust others as they trust you?";
  1506.                 break;
  1507.             case 3:
  1508.                 cout << "Respect others as you respect your self?";
  1509.                 break;
  1510.             case 4:
  1511.                 cout << "work with others and cooperate in a team?";
  1512.                 break;
  1513.             case 5:
  1514.                 cout << "lead men to glory and they follow?";
  1515.                 break;
  1516.             case 6:
  1517.                 cout << "empathize with people and they with you as well?";
  1518.                 break;
  1519.             case 7:
  1520.                 cout << "Courage influences the people around you and stangthens your self?";
  1521.                 break;
  1522.             case 8:
  1523.                 cout << "Anti-social and a loner?";
  1524.                 break;
  1525.         }
  1526.         cout << "\n";
  1527.         cout << "1-Yes\n";
  1528.         cout << "2-No\n";
  1529.         cout << "Choice: ";
  1530.         cin >> num;
  1531.  
  1532.         switch(num)
  1533.             {
  1534.             case 1:
  1535.                 switch(advance)
  1536.                 {
  1537.                     case 1:
  1538.                         ++Warrior;
  1539.                         break;
  1540.                     case 2:
  1541.                         ++Warrior;
  1542.                         break;
  1543.                     case 3:
  1544.                         ++Ranger;
  1545.                         break;
  1546.                     case 4:
  1547.                         ++Mage;
  1548.                         break;
  1549.                     case 5:
  1550.                         ++Mage;
  1551.                         break;
  1552.                     case 6:
  1553.                         ++Ranger;
  1554.                         break;
  1555.                     case 7:
  1556.                         ++Warrior;
  1557.                         break;
  1558.                     case 8:
  1559.                         ++Rogue;
  1560.                         break;
  1561.                 }
  1562.  
  1563.                 system("CLS");
  1564.                 goto setup;
  1565.             //DONE WITH QUIZ//
  1566.                 break;
  1567.             case 2:
  1568.                 system("CLS");
  1569.                 goto wrong10;
  1570.                 break;
  1571.             }
  1572.  
  1573.         if (num != 1 && num != 2)
  1574.         {
  1575.             cout << "That is not possible!";
  1576.             std::getchar();
  1577.             std::getchar();
  1578.             system("CLS");
  1579.             goto wrong10;
  1580.         }
  1581.         //End Personality Quiz//
  1582.  
  1583.         //Free pick//
  1584.  
  1585.     case 2:
  1586.         cout << "You have chosen to freely pick your charicters stats.\n";
  1587.         cout << "Is this what you want?\n\n";
  1588.         cout << "1-Yes\n";
  1589.         cout << "2-No\n";
  1590.         cout << "choice: ";
  1591.         cin >> num;
  1592.  
  1593.         if (num != 1 && num != 2)
  1594.         {
  1595.             cout << "That is not posible!";
  1596.             std::getchar();
  1597.             std::getchar();
  1598.             system("CLS");
  1599.             goto pick;
  1600.         }
  1601.  
  1602.         switch(num)
  1603.             {
  1604.             case 1:
  1605.                 system("CLS");
  1606.                 break;
  1607.             case 2:
  1608.                 system("CLS");
  1609.                 goto pick;
  1610.                 break;
  1611.             }
  1612.  
  1613. age:
  1614.         cout << "What is your age?\n\n";
  1615.         cout << "Choice: ";
  1616.         cin >> age;
  1617.  
  1618.         if (age < 1 || age > 120)
  1619.         {
  1620.             cout << "You can't be that age!";
  1621.             std::getchar();
  1622.             std::getchar();
  1623.             system("CLS");
  1624.             goto age;
  1625.         }
  1626.  
  1627.         else if (age >= 1 && age <= 12)
  1628.         {
  1629.             cout << "So young to go on an adventure, are you telling the truth?\n";
  1630.         }
  1631.  
  1632.         else if (age > 12 && age < 20)
  1633.         {
  1634.             cout << "Teen's always seeking for adventure. Are you telling the truth?\n";
  1635.         }
  1636.  
  1637.         else if (age >= 20 && age < 40)
  1638.         {
  1639.             cout << "Full of life and at the true age for adventure, is this your age?\n";
  1640.         }
  1641.  
  1642.         else if (age >= 40 && age < 80)
  1643.         {
  1644.             cout << "A little past the time to go on an adventure yet you are ready, is this truely your age?\n";
  1645.         }
  1646.  
  1647.         else if (age >= 80 && age <= 120)
  1648.         {
  1649.             cout << "Your old back makes you not as great of an adventure, yet ready to set out, this your age?\n";
  1650.         }
  1651.  
  1652.         cout << "1-Yes\n";
  1653.         cout << "2-No\n";
  1654.         cout << "Choice: ";
  1655.         cin >> num;
  1656.  
  1657.         switch(num)
  1658.             {
  1659.             case 1:
  1660.                 system("CLS");
  1661.                 break;
  1662.             case 2:
  1663.                 system("CLS");
  1664.                 goto age;
  1665.                 break;
  1666.             }
  1667.  
  1668.         if (num != 1 && num != 2)
  1669.         {
  1670.             cout << "That is not possible!";
  1671.             std::getchar();
  1672.             std::getchar();
  1673.             system("CLS");
  1674.             goto age;
  1675.         }
  1676.  
  1677. gender:
  1678.         cout << "What is your gender?\n";
  1679.         cout << "1-Male\n";
  1680.         cout << "2-Female\n";
  1681.         cout << "3-Hidden\n";
  1682.         cout << "Choice: ";
  1683.         cin >> gender;
  1684.         cout << "\n";
  1685.  
  1686.         if (gender == 1)
  1687.         {
  1688.             cout << "Male side.";
  1689.         }
  1690.  
  1691.         else if (gender == 2)
  1692.         {
  1693.             cout << "Female side.";
  1694.         }
  1695.  
  1696.         else if (gender == 3)
  1697.         {
  1698.             cout << "You have no side, you are a mystery.";
  1699.         }
  1700.  
  1701.         else
  1702.         {
  1703.             cout << "That is not posible please pick another number";
  1704.             std::getchar();
  1705.             std::getchar();
  1706.             system("CLS");
  1707.             goto gender;
  1708.         }
  1709.  
  1710.         cout << "\nIs this what you are?\n";
  1711.         cout << "1-Yes\n";
  1712.         cout << "2-No\n";
  1713.         cout << "Choice: ";
  1714.         cin >> num;
  1715.  
  1716.         switch(num)
  1717.             {
  1718.             case 1:
  1719.                 system("CLS");
  1720.                 break;
  1721.             case 2:
  1722.                 system("CLS");
  1723.                 goto gender;
  1724.                 break;
  1725.             }
  1726.  
  1727.         if (num != 1 && num != 2)
  1728.         {
  1729.             cout << "That is not possible!";
  1730.             std::getchar();
  1731.             std::getchar();
  1732.             system("CLS");
  1733.             goto gender;
  1734.         }
  1735.  
  1736.  
  1737. race:
  1738.         cout << "What is the race that you choice?\n\n";
  1739.  
  1740.         num = 1;
  1741.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  1742.         {
  1743.             cout << num << "-" << (*iter2).name << "\n";
  1744.             ++num;
  1745.         }
  1746.  
  1747.         cout << "Choice: ";
  1748.         cin >> race;
  1749.  
  1750.         if (race < 1 || race > 10)
  1751.         {
  1752.             cout << "That is not posible!";
  1753.             std::getchar();
  1754.             std::getchar();
  1755.             system("CLS");
  1756.             goto race;
  1757.         }
  1758.  
  1759.         --race;
  1760.  
  1761.         num = 0;
  1762.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  1763.         {
  1764.             if(num == race)
  1765.             {
  1766.                 cout << (*iter2).dis << "\n\n";
  1767.             }
  1768.             ++num;
  1769.         }
  1770.  
  1771.         cout << "\nIs this who you are?\n";
  1772.         cout << "1-Yes\n";
  1773.         cout << "2-No\n";
  1774.         cout << "Choice: ";
  1775.         cin >> num;
  1776.  
  1777.         switch(num)
  1778.             {
  1779.             case 1:
  1780.                 system("CLS");
  1781.                 break;
  1782.             case 2:
  1783.                 system("CLS");
  1784.                 goto race;
  1785.                 break;
  1786.             }
  1787.  
  1788.         if (num != 1 && num != 2)
  1789.         {
  1790.             cout << "That is not possible!";
  1791.             std::getchar();
  1792.             std::getchar();
  1793.             system("CLS");
  1794.             goto race;
  1795.         }
  1796.  
  1797.         cout << "Your age is " << age << ", your gender is ";
  1798.  
  1799.         if (gender == 1)
  1800.         {
  1801.             cout << "Male";
  1802.         }
  1803.  
  1804.         else if (gender == 2)
  1805.         {
  1806.             cout << "Female";
  1807.         }
  1808.  
  1809.         else if (gender == 3)
  1810.         {
  1811.             cout << "a mystery";
  1812.         }
  1813.  
  1814.         cout << ", your race is the ";
  1815.  
  1816.         num = 0;
  1817.         for (iter2 = Race.begin(); iter2 != Race.end(); ++iter2)
  1818.         {
  1819.  
  1820.             if(num == race)
  1821.             {
  1822.                 cout << (*iter2).name << "\n\n";
  1823.             }
  1824.             ++num;
  1825.         }
  1826.  
  1827. Classes:
  1828.  
  1829.         cout << "What is your class?\n\n";
  1830.  
  1831.         cout << "1- Warrior\n";
  1832.         cout << "2- Mage\n";
  1833.         cout << "3- Rogue\n";
  1834.         cout << "4- Ranger\n\n";
  1835.  
  1836.         cout << "Choice: ";
  1837.         cin >> num;
  1838.  
  1839.         switch(num)
  1840.         {
  1841.         case 1:
  1842.             ++Warrior;
  1843.             break;
  1844.         case 2:
  1845.             ++Mage;
  1846.             break;
  1847.         case 3:
  1848.             ++Rogue;
  1849.             break;
  1850.         case 4:
  1851.             ++Ranger;
  1852.             break;
  1853.         }
  1854.  
  1855.         goto choice;
  1856.  
  1857.         std::getchar();
  1858.         std::getchar();
  1859.         system("CLS");
  1860.  
  1861.         //Seting up stats and skills//
  1862.     //Race Define//
  1863.     //If negive Legion//
  1864.     //If quiz is 1 - 4 Orcs//
  1865.     //If quiz is 5 - 7 Gnome//
  1866.     //If quiz is 8 - 11 Drow//
  1867.     //If quiz is 12 - 14 Minotaur//
  1868.     //If quiz is 15 - 18 Ogres//
  1869.     //If positive Order//
  1870.     //If quiz is 0 - 1 Halfling//
  1871.     //If quiz is 2 - 4 Human//
  1872.     //If quiz is 5 - 8 Elves//
  1873.     //If quiz is 9 - 10 Dwarf//
  1874.     //If quiz is 11 - 13 Giant//
  1875. setup:
  1876.         if (pick == 1)
  1877.         {
  1878.             cout << quiz << "\n";
  1879.             cout << Warrior <<"\n";
  1880.             cout << Mage <<"\n";
  1881.             cout << Rogue <<"\n";
  1882.             cout << Ranger <<"\n";
  1883.             std::getchar();
  1884.             std::getchar();
  1885.             system("CLS");
  1886.  
  1887.             if(quiz <= -15 && quiz >= -18)//Ogres
  1888.             {
  1889.                 race = 8;
  1890.             }
  1891.             else if(quiz <= -12 && quiz >= -14)//Minotaur
  1892.             {
  1893.                 race = 7;
  1894.             }
  1895.             else if(quiz <= -8 && quiz >= -11)//Drow
  1896.             {
  1897.                 race = 4;
  1898.             }
  1899.             else if(quiz <= -5 && quiz >= -7)//Gnome
  1900.             {
  1901.                 race = 5;
  1902.             }
  1903.             else if(quiz <= -1 && quiz >= -4)//Orcs
  1904.             {
  1905.                 race = 2;
  1906.             }
  1907.             else if (quiz >= 0 && quiz <= 1)//Halfling
  1908.             {
  1909.                 race = 6;
  1910.             }
  1911.             else if (quiz >= 2 && quiz <= 4)//Human
  1912.             {
  1913.                 race = 1;
  1914.             }
  1915.             else if (quiz >= 5 && quiz <= 8)//Elves
  1916.             {
  1917.                 race = 0;
  1918.             }
  1919.             else if (quiz >= 9 && quiz <= 10)//Dwarf
  1920.             {
  1921.                 race = 3;
  1922.             }
  1923.             else if (quiz >= 11 && quiz <= 13)//Giant
  1924.             {
  1925.                 race = 9;
  1926.             }
  1927.             else
  1928.             {
  1929.                 cout << "We may have a slight problem...";
  1930.             }
  1931.  
  1932. choice:
  1933.  
  1934.             if (Warrior > Mage && Warrior > Rogue && Warrior > Ranger)
  1935.             {//Warrior Skills
  1936.                 Weapon[0].num = 1;//One Handed
  1937.                 Weapon[1].num = 1;//Two Handed
  1938.                 Weapon[2].num = 0;//Polearms
  1939.                 Weapon[3].num = 0;//Archery
  1940.                 Weapon[4].num = 0;//Crossbows
  1941.                 Weapon[5].num = 0;//Throwing
  1942.                 Weapon[6].num = 0;//Sorcery
  1943.                 Weapon[7].num = 0;//Max
  1944.             }
  1945.             else if (Mage > Rogue && Mage > Ranger)
  1946.             {//Mage Skills
  1947.                 Weapon[0].num = 0;//One Handed
  1948.                 Weapon[1].num = 0;//Two Handed
  1949.                 Weapon[2].num = 1;//Polearms
  1950.                 Weapon[3].num = 0;//Archery
  1951.                 Weapon[4].num = 0;//Crossbows
  1952.                 Weapon[5].num = 0;//Throwing
  1953.                 Weapon[6].num = 1;//Sorcery
  1954.                 Weapon[7].num = 0;//Max
  1955.             }
  1956.             else if (Rogue > Ranger)
  1957.             {//Rogue Skills
  1958.                 Weapon[0].num = 0;//One Handed
  1959.                 Weapon[1].num = 0;//Two Handed
  1960.                 Weapon[2].num = 1;//Polearms
  1961.                 Weapon[3].num = 0;//Archery
  1962.                 Weapon[4].num = 0;//Crossbows
  1963.                 Weapon[5].num = 1;//Throwing
  1964.                 Weapon[6].num = 0;//Sorcery
  1965.                 Weapon[7].num = 0;//Max
  1966.             }
  1967.             else
  1968.             {//Ranger
  1969.                 Weapon[0].num = 0;//One Handed
  1970.                 Weapon[1].num = 0;//Two Handed
  1971.                 Weapon[2].num = 0;//Polearms
  1972.                 Weapon[3].num = 1;//Archery
  1973.                 Weapon[4].num = 1;//Crossbows
  1974.                 Weapon[5].num = 0;//Throwing
  1975.                 Weapon[6].num = 0;//Sorcery
  1976.                 Weapon[7].num = 0;//Max
  1977.             }
  1978.         }
  1979.         cout << Race[race].name << "\n\n";
  1980.         if (race == 0)
  1981.         {//Elf//
  1982.             stats[0].num = 2;//STR
  1983.             stats[1].num = 2;//CON
  1984.             stats[2].num = 5;//DEX
  1985.             stats[3].num = 4;//INT
  1986.             stats[4].num = 4;//PER
  1987.             stats[5].num = 3;//LUC
  1988.             stats[6].num = 0;//Max
  1989.         }
  1990.  
  1991.         else if (race == 1)
  1992.         {//Human//
  1993.             stats[0].num = 4;//STR
  1994.             stats[1].num = 2;//CON
  1995.             stats[2].num = 2;//DEX
  1996.             stats[3].num = 4;//INT
  1997.             stats[4].num = 4;//PER
  1998.             stats[5].num = 4;//LUC
  1999.             stats[6].num = 0;//Max
  2000.         }
  2001.  
  2002.         else if (race == 2)
  2003.         {//Orc//
  2004.             stats[0].num = 4;//STR
  2005.             stats[1].num = 5;//CON
  2006.             stats[2].num = 4;//DEX
  2007.             stats[3].num = 2;//INT
  2008.             stats[4].num = 4;//PER
  2009.             stats[5].num = 1;//LUC
  2010.             stats[6].num = 0;//Max
  2011.         }
  2012.  
  2013.         else if (race == 3)
  2014.         {//Dwarf//
  2015.             stats[0].num = 4;//STR
  2016.             stats[1].num = 7;//CON
  2017.             stats[2].num = 2;//DEX
  2018.             stats[3].num = 2;//INT
  2019.             stats[4].num = 2;//PER
  2020.             stats[5].num = 3;//LUC
  2021.             stats[6].num = 0;//Max
  2022.         }
  2023.  
  2024.         else if (race == 4)
  2025.         {//Drow//
  2026.             stats[0].num = 1;//STR
  2027.             stats[1].num = 2;//CON
  2028.             stats[2].num = 4;//DEX
  2029.             stats[3].num = 6;//INT
  2030.             stats[4].num = 4;//PER
  2031.             stats[5].num = 3;//LUC
  2032.             stats[6].num = 0;//Max
  2033.         }
  2034.  
  2035.         else if (race == 5)
  2036.         {//Gnome//
  2037.             stats[0].num = 3;//STR
  2038.             stats[1].num = 5;//CON
  2039.             stats[2].num = 2;//DEX
  2040.             stats[3].num = 2;//INT
  2041.             stats[4].num = 3;//PER
  2042.             stats[5].num = 5;//LUC
  2043.             stats[6].num = 0;//Max
  2044.         }
  2045.  
  2046.         else if (race == 6)
  2047.         {//Halfing//
  2048.             stats[0].num = 1;//STR
  2049.             stats[1].num = 1;//CON
  2050.             stats[2].num = 4;//DEX
  2051.             stats[3].num = 4;//INT
  2052.             stats[4].num = 3;//PER
  2053.             stats[5].num = 7;//LUC
  2054.             stats[6].num = 0;//Max
  2055.         }
  2056.  
  2057.         else if (race == 7)
  2058.         {//Minotaur//
  2059.             stats[0].num = 7;//STR
  2060.             stats[1].num = 3;//CON
  2061.             stats[2].num = 4;//DEX
  2062.             stats[3].num = 1;//INT
  2063.             stats[4].num = 3;//PER
  2064.             stats[5].num = 2;//LUC
  2065.             stats[6].num = 0;//Max
  2066.         }
  2067.  
  2068.         else if (race == 8)
  2069.         {//Ogres//
  2070.             stats[0].num = 9;//STR
  2071.             stats[1].num = 5;//CON
  2072.             stats[2].num = 1;//DEX
  2073.             stats[3].num = 1;//INT
  2074.             stats[4].num = 2;//PER
  2075.             stats[5].num = 2;//LUC
  2076.             stats[6].num = 0;//Max
  2077.         }
  2078.         else if (race == 9)
  2079.         {//Giant//
  2080.             stats[0].num = 10;//STR
  2081.             stats[1].num = 4;//CON
  2082.             stats[2].num = 2;//DEX
  2083.             stats[3].num = 1;//INT
  2084.             stats[4].num = 2;//PER
  2085.             stats[5].num = 1;//LUC
  2086.             stats[6].num = 0;//Max
  2087.         }
  2088.         else
  2089.         {
  2090.             cout << "WTF!!!\n";
  2091.             std::getchar();
  2092.             num = 0;
  2093.             do
  2094.             {
  2095.                 cout << "BOOM!";
  2096.             }while (num != 100000);
  2097.         }
  2098.         //Ending set up of stats and skills//
  2099.  
  2100. //VOID STATS!!!!!//
  2101.  
  2102. defin:
  2103.         cout << "Stats!\n\n";
  2104.  
  2105.         num = 1;
  2106.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2107.         {
  2108.             cout << (*iter2).name << " = " << (*iter2).num;
  2109.             ++num;
  2110.             cout << "\n";
  2111.         }
  2112.  
  2113. //END VOID STATS
  2114.  
  2115.         cout << "\n1-Definition\n";
  2116.         cout << "2-Add\n";
  2117.         cout << "3-Subtract\n";
  2118.         cout << "4-Done\n";
  2119.         cout << "Choice: ";
  2120.         cin >> num2;
  2121.         system("CLS");
  2122.  
  2123.         switch(num2)
  2124.         {
  2125.         case 1:
  2126. defin1:
  2127.             cout << "What one do you wish to define?\n\n";
  2128.             //VOID STATS!!!!!//
  2129.  
  2130.             num = 1;
  2131.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2132.             {
  2133.             cout << num << "-" << (*iter2).name;
  2134.             ++num;
  2135.             cout << "\n";
  2136.         }
  2137.  
  2138.             cout << num << "-" << "Exit\n\n";
  2139.             cout << "Choice: ";
  2140.             cin >> num2;
  2141.  
  2142.             if (num == num2)
  2143.             {
  2144.                 system("CLS");
  2145.                 goto defin;
  2146.             }
  2147.             --num2;
  2148.  
  2149.             num = 0;
  2150.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2151.             {
  2152.                 if(num == num2)
  2153.                 {
  2154.                     cout << (*iter2).dis << "\n\n";
  2155.                 }
  2156.                 ++num;
  2157.             }
  2158.  
  2159.             std::getchar();
  2160.             std::getchar();
  2161.             system("CLS");
  2162.             goto defin1;
  2163.             break;
  2164.         case 2:
  2165. defin2:
  2166.             if (stats[6].num == 0)
  2167.             {
  2168.                 cout << "You have no points left to use!";
  2169.                 std::getchar();
  2170.                 std::getchar();
  2171.                 system("CLS");
  2172.                 goto defin;
  2173.             }
  2174.             cout << "What one do you wish to add?\n\n";
  2175.             //VOID STATS!!!!!//
  2176.  
  2177.             num = 1;
  2178.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2179.             {
  2180.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  2181.             ++num;
  2182.             cout << "\n";
  2183.             }
  2184.  
  2185.             cout << num << "- Exit";
  2186.             cout << "\n";
  2187.             cout << "Choice: ";
  2188.             cin >> num2;
  2189.  
  2190.             if (num == num2)
  2191.             {
  2192.                 system("CLS");
  2193.                 goto defin;
  2194.             }
  2195.  
  2196.             system("CLS");
  2197. add0:
  2198.  
  2199.             cout << "How much do you want to add?\n\n";
  2200.  
  2201.             --num2;
  2202.  
  2203.             num = 0;
  2204.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2205.             {
  2206.                 if(num == num2)
  2207.                 {
  2208.                     cout << (*iter2).name << " = " << (*iter2).num;
  2209.                 }
  2210.  
  2211.                 ++num;
  2212.             }
  2213.  
  2214. //END VOID STATS
  2215.  
  2216.         cout << "\n\n";
  2217.  
  2218.         cout << "Points left: ";
  2219.         num = 0;
  2220.  
  2221.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2222.         {
  2223.             if(num == 9)
  2224.             {
  2225.                 cout << (*iter2).num;
  2226.             }
  2227.  
  2228.             ++num;
  2229.         }
  2230.  
  2231.         cout << "\n\n";
  2232.  
  2233.         cout << "0- Exit\n";
  2234.         cout << "1- 1 Point\n";
  2235.         cout << "2- 5 Point\n";
  2236.         cout << "3- 10 Point\n\n";
  2237.         cout << "Choice: ";
  2238.         cin >> num;
  2239.  
  2240.         if (stats[6].num == 0)
  2241.         {
  2242.             cout << "You have no points left to use!";
  2243.             std::getchar();
  2244.             std::getchar();
  2245.             system("CLS");
  2246.             goto defin;
  2247.         }
  2248.  
  2249.         if (num == 0)
  2250.         {
  2251.             system("CLS");
  2252.             goto defin2;
  2253.         }
  2254.  
  2255.         else if (num == 1 && stats[9].num > 0)
  2256.         {
  2257.             stats[9].num = stats[9].num - 1;
  2258.             stats[num2].num = stats[num2].num + 1;
  2259.         }
  2260.  
  2261.         else if (num == 2 && stats[9].num >= 5)
  2262.  
  2263.         {
  2264.             stats[9].num = stats[9].num - 5;
  2265.             stats[num2].num = stats[num2].num + 5;
  2266.         }
  2267.  
  2268.         else if (num == 3 && stats[9].num >= 10)
  2269.         {
  2270.             stats[9].num = stats[9].num - 10;
  2271.             stats[num2].num = stats[num2].num + 10;
  2272.         }
  2273.  
  2274.         else
  2275.         {
  2276.             cout << "You cant do that!";
  2277.             std::getchar();
  2278.             std::getchar();
  2279.         }
  2280.  
  2281.         system("CLS");
  2282.         goto add0;
  2283.         cout << "\n\n";
  2284.         break;
  2285.         case 3:
  2286.  
  2287. defin3:
  2288.             cout << "What one do you wish to subtract?\n\n";
  2289.             //VOID STATS!!!!!//
  2290.  
  2291.             num = 1;
  2292.             for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2293.             {
  2294.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  2295.             ++num;
  2296.             cout << "\n";
  2297.             }
  2298.  
  2299.             cout << num << "- Exit";
  2300.             cout << "\n";
  2301.             cout << "Choice: ";
  2302.             cin >> num2;
  2303.  
  2304.             if (num == num2)
  2305.             {
  2306.             system("CLS");
  2307.             goto defin;
  2308.             }
  2309.  
  2310.             system("CLS");
  2311. sub0:
  2312.         cout << "How much do you want to subtract?\n\n";
  2313.         --num2;
  2314.  
  2315.         num = 0;
  2316.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2317.         {
  2318.             if(num == num2)
  2319.             {
  2320.                 cout << (*iter2).name << " = " << (*iter2).num;
  2321.             }
  2322.             ++num;
  2323.         }
  2324. //END VOID STATS
  2325.         cout << "\n\n";
  2326.         cout << "Points left: ";
  2327.  
  2328.         num = 0;
  2329.         for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2330.         {
  2331.             if(num == 9)
  2332.             {
  2333.                 cout << (*iter2).num;
  2334.             }
  2335.             ++num;
  2336.         }
  2337.         cout << "\n\n";
  2338.  
  2339.         cout << "0- Exit\n";
  2340.         cout << "1- 1 Point\n";
  2341.         cout << "2- 5 Point\n";
  2342.         cout << "3- 10 Point\n\n";
  2343.         cout << "Choice: ";
  2344.         cin >> num;
  2345.  
  2346.         if (num == 0)
  2347.         {
  2348.             system("CLS");
  2349.             goto defin3;
  2350.         }
  2351.  
  2352.         else if (num == 1 && stats[num2].num > 0)
  2353.         {
  2354.             stats[9].num = stats[9].num + 1;
  2355.             stats[num2].num = stats[num2].num - 1;
  2356.         }
  2357.  
  2358.         else if (num == 2 && stats[num2].num >= 5)
  2359.         {
  2360.             stats[9].num = stats[9].num + 5;
  2361.             stats[num2].num = stats[num2].num - 5;
  2362.         }
  2363.  
  2364.         else if (num == 3 && stats[num2].num >= 10)
  2365.         {
  2366.             stats[9].num = stats[9].num + 10;
  2367.             stats[num2].num = stats[num2].num - 10;
  2368.         }
  2369.  
  2370.         else
  2371.         {
  2372.             cout << "You cant do that!";
  2373.             std::getchar();
  2374.             std::getchar();
  2375.         }
  2376.  
  2377.         system("CLS");
  2378.         goto sub0;
  2379.         cout << "\n\n";
  2380.         break;
  2381.         }
  2382.  
  2383. //VOID STATS!!!!!//
  2384.  
  2385. defin4:
  2386.         cout << "Skills!\n\n";
  2387.  
  2388.         num = 1;
  2389.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2390.         {
  2391.             if (num < 7)
  2392.             {
  2393.             cout << (*iter2).name << " = " << (*iter2).num;
  2394.             }
  2395.             ++num;
  2396.             cout << "\n";
  2397.         }
  2398. //END VOID STATS
  2399.         cout << "1-Definition\n";
  2400.         cout << "2-Add\n";
  2401.         cout << "3-Subtract\n";
  2402.         cout << "4-Done\n";
  2403.         cout << "Choice: ";
  2404.         cin >> num2;
  2405.  
  2406.         system("CLS");
  2407.  
  2408.         switch(num2)
  2409.         {
  2410.         case 1:
  2411. defin5:
  2412.             cout << "What one do you wish to define?\n\n";
  2413.  
  2414.             //VOID STATS!!!!!//
  2415.  
  2416.         num = 1;
  2417.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2418.         {
  2419.             cout << num << "-" << (*iter2).name;
  2420.             ++num;
  2421.             cout << "\n";
  2422.         }
  2423.  
  2424.         cout << num << "-" << "Exit\n\n";
  2425.             cout << "Choice: ";
  2426.             cin >> num2;
  2427.  
  2428.             if (num == num2)
  2429.             {
  2430.                 system("CLS");
  2431.                 goto defin4;
  2432.             }
  2433.             --num2;
  2434.  
  2435.             num = 0;
  2436.             for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2437.             {
  2438.                 if(num == num2)
  2439.                 {
  2440.                     cout << (*iter2).dis << "\n\n";
  2441.                 }
  2442.                 ++num;
  2443.             }
  2444.  
  2445.             std::getchar();
  2446.             std::getchar();
  2447.             system("CLS");
  2448.             goto defin5;
  2449.             break;
  2450.         case 2:
  2451. defin6:
  2452.             if (Weapon[7].num == 0)
  2453.             {
  2454.                 cout << "You have no points left to use!";
  2455.                 std::getchar();
  2456.                 std::getchar();
  2457.                 system("CLS");
  2458.                 goto defin4;
  2459.             }
  2460.             cout << "What one do you wish to add?\n\n";
  2461.  
  2462.             //VOID STATS!!!!!//
  2463.  
  2464.             num = 1;
  2465.  
  2466.             for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)        
  2467.             {            
  2468.                 cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;            
  2469.                 ++num;            
  2470.                 cout << "\n";        
  2471.             }
  2472.  
  2473.         cout << num << "- Exit";
  2474.         cout << "\n";
  2475.         cout << "Choice: ";
  2476.         cin >> num2;
  2477.  
  2478.         if (num == num2)
  2479.         {
  2480.             system("CLS");
  2481.             goto defin4;
  2482.         }
  2483.  
  2484.         system("CLS");
  2485.         cout << "How much do you want to add?\n\n";
  2486.  
  2487.         --num2;
  2488.         num = 0;
  2489.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2490.         {
  2491.             if(num == num2)
  2492.             {
  2493.                 cout << (*iter2).name << " = " << (*iter2).num;
  2494.             }
  2495.             ++num;
  2496.         }
  2497.  
  2498. //END VOID STATS
  2499.         cout << "\n\n";
  2500.         cout << "Points left: ";
  2501.  
  2502.         num = 0;
  2503.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2504.         {
  2505.             if(num == 9)
  2506.             {
  2507.                 cout << (*iter2).num;
  2508.             }
  2509.             ++num;
  2510.         }
  2511.  
  2512.         cout << "\n\n";
  2513.         cout << "0- Exit\n";
  2514.         cout << "1- 1 Point\n";
  2515.         cout << "2- 5 Point\n";
  2516.         cout << "3- 10 Point\n\n";
  2517.         cout << "Choice: ";
  2518.         cin >> num;
  2519.  
  2520.         if (Weapon[7].num == 0)
  2521.         {
  2522.             cout << "You have no points left to use!";
  2523.             std::getchar();
  2524.             std::getchar();
  2525.             system("CLS");
  2526.             goto defin4;
  2527.         }
  2528.  
  2529.         if (num == 0)
  2530.         {
  2531.             system("CLS");
  2532.             goto defin6;
  2533.         }
  2534.  
  2535.         else if (num == 1 && Weapon[7].num > 0)
  2536.         {
  2537.             Weapon[7].num = Weapon[7].num - 1;
  2538.             Weapon[num2].num = Weapon[num2].num + 1;
  2539.         }
  2540.  
  2541.         else if (num == 2 && Weapon[7].num >= 5)
  2542.         {
  2543.             Weapon[7].num = Weapon[7].num - 5;
  2544.             Weapon[num2].num = Weapon[num2].num + 5;
  2545.         }
  2546.  
  2547.         else if (num == 3 && Weapon[7].num >= 10)
  2548.         {
  2549.             Weapon[7].num = Weapon[7].num - 10;
  2550.             Weapon[num2].num = Weapon[num2].num + 10;
  2551.         }
  2552.  
  2553.         else
  2554.         {
  2555.             cout << "You cant do that!";
  2556.             std::getchar();
  2557.             std::getchar();
  2558.         }
  2559.  
  2560.         system("CLS");
  2561.         goto defin6;
  2562.         cout << "\n\n";
  2563.         break;
  2564.         case 3:
  2565. defin7:
  2566.             cout << "What one do you wish to subtract?\n\n";
  2567.  
  2568.             //VOID STATS!!!!!//
  2569.  
  2570.         num = 1;
  2571.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2572.         {
  2573.             cout << num << "-" <<(*iter2).name << " = " << (*iter2).num;
  2574.             ++num;
  2575.             cout << "\n";
  2576.         }
  2577.  
  2578.         cout << num << "- Exit";
  2579.         cout << "\n";
  2580.         cout << "Choice: ";
  2581.         cin >> num2;
  2582.  
  2583.         if (num == num2)
  2584.         {
  2585.             system("CLS");
  2586.             goto defin4;
  2587.         }
  2588.  
  2589.         system("CLS");
  2590.         cout << "How much do you want to subtract?\n\n";
  2591.  
  2592.         --num2;
  2593.  
  2594.         num = 0;
  2595.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2596.         {
  2597.             if(num == num2)
  2598.             {
  2599.                 cout << (*iter2).name << " = " << (*iter2).num;
  2600.             }
  2601.             ++num;
  2602.         }
  2603.  
  2604. //END VOID STATS
  2605.  
  2606.         cout << "\n\n";
  2607.  
  2608.         cout << "Points left: ";
  2609.  
  2610.         num = 0;
  2611.         for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2612.         {
  2613.             if(num == 7)
  2614.             {
  2615.                 cout << (*iter2).num;
  2616.             }
  2617.             ++num;
  2618.         }
  2619.  
  2620.         cout << "\n\n";
  2621.  
  2622.         cout << "0- Exit\n";
  2623.         cout << "1- 1 Point\n";
  2624.         cout << "2- 5 Point\n";
  2625.         cout << "3- 10 Point\n\n";
  2626.         cout << "Choice: ";
  2627.         cin >> num;
  2628.  
  2629.         if (num == 0)
  2630.         {
  2631.             system("CLS");
  2632.             goto defin7;
  2633.         }
  2634.  
  2635.         else if (num == 1 && Weapon[num2].num > 0)
  2636.         {
  2637.             Weapon[7].num = Weapon[7].num + 1;
  2638.             Weapon[num2].num = Weapon[num2].num - 1;
  2639.         }
  2640.  
  2641.         else if (num == 2 && Weapon[num2].num >= 5)
  2642.         {
  2643.             Weapon[7].num = Weapon[7].num + 5;
  2644.             Weapon[num2].num = Weapon[num2].num - 5;
  2645.         }
  2646.  
  2647.         else if (num == 3 && stats[num2].num >= 10)
  2648.         {
  2649.             stats[7].num = stats[7].num + 10;
  2650.             stats[num2].num = stats[num2].num - 10;
  2651.         }
  2652.  
  2653.         else
  2654.         {
  2655.             cout << "You cant do that!";
  2656.             std::getchar();
  2657.             std::getchar();
  2658.         }
  2659.  
  2660.         system("CLS");
  2661.         goto defin7;
  2662.         cout << "\n\n";
  2663.         break;
  2664.         }
  2665.         }
  2666.  
  2667. //VOID STATS!!!!!//
  2668.  
  2669.     //End Free Pick//
  2670.  
  2671.     //Character
  2672.  
  2673. Player:
  2674.     cout << "Player Name: " << Name << "\n";
  2675.     cout << "Age: " << age;
  2676.  
  2677.     if (age == 1)
  2678.     {
  2679.         cout << " year old\n";
  2680.     }
  2681.  
  2682.     else if (age >= 2)
  2683.     {
  2684.         cout << " years old\n";
  2685.     }
  2686.  
  2687.     else
  2688.     {
  2689.         cout << " HOW THAT IS IMPOSIBLE!\n";
  2690.     }
  2691.  
  2692.     cout << "Gender: ";
  2693.  
  2694.     switch(gender)
  2695.     {
  2696.     case 1:
  2697.         cout << "Male";
  2698.         break;
  2699.     case 2:
  2700.         cout << "Female";
  2701.         break;
  2702.     case 3:
  2703.         cout << "Concealed";
  2704.         break;
  2705.     }
  2706.  
  2707.     cout << "\n";
  2708.     cout << "Race: ";
  2709.     cout << Race[race].name << "\n\n";
  2710.  
  2711.     cout << "Stats\n";
  2712.  
  2713.     num = 0;
  2714.     for (iter2 = stats.begin(); iter2 != stats.end(); ++iter2)
  2715.     {
  2716.         cout << (*iter2).name << " = " << (*iter2).num;
  2717.         cout << "\n";
  2718.     }
  2719.     cout << "\n";
  2720.  
  2721.     cout << "Skills\n";
  2722.  
  2723.     num = 0;
  2724.     for (iter2 = Weapon.begin(); iter2 != Weapon.end(); ++iter2)
  2725.     {
  2726.         if (num < 7)
  2727.         {
  2728.         cout << (*iter2).name << " = " << (*iter2).num;
  2729.         cout << "\n";
  2730.         }
  2731.         ++num;
  2732.     }
  2733.  
  2734.     std::getchar();
  2735.     std::getchar();
  2736.     system("CLS");
  2737.     //End Character
  2738.  
  2739.     //START ADVENTURE//
  2740.     cout << "Adventure Start\n\n";
  2741.     std::getchar();
  2742.     cout << "You walk into grass\n";
  2743.     std::getchar();
  2744.     cout << "You find a battle!\n";
  2745.     std::getchar();
  2746.     cout << "Dananananan~!";
  2747.     std::getchar();
  2748.  
  2749.     //Enter fight!//
  2750.  
  2751.  
  2752.  
  2753.     //END ADVENTURE//
  2754.  
  2755.     //DEATH//
  2756.  
  2757.     //END DEATH//
  2758.  
  2759.     system("pause");//Like a std::getchar but says to press a word to continue
  2760.     return 0;
  2761. }
May 9 '13 #40
weaknessforcats
9,208 Expert Mod 8TB
If you are creating a monster, shouldn't line 430 be a push_back instead of a pop_back?
May 10 '13 #41
were did that come from! :)

It must have pop'ed out at you! Thanks
May 10 '13 #42
I have a day to get this combat system up and running please some one help!

https://compilr.com/fishirboy/rpg/RPG.cpp

I use Microsoft Visual C++ 2010 Express, its free and you need some C++ skills to even understand this. my combat system located at line 3831-3932 (may be a little miss placed because of me working). I am begging i am so stumped.

(the combat was working but I added some stuff and it went wank giving my friend negative attack numbers, and me just death...)
May 14 '13 #43
weaknessforcats
9,208 Expert Mod 8TB
First thing you do is remove the "some stuff" and get things back to where they are working.

Then make a copy of the code.This is your last stable backup.

Next, add only a small part of your "some stuff" and verify things are still working. If they are, make a new copy of the code. Do not overwrite the previous backup. This is now the last stable backup. The existing one becomes the -1 backup.

Work in this fashion. This method allows you to go back to a working version of the code quickly.

Finally, learn how to use the debugger. It is there you can step through the code and look at the values of your variables. It is there you will find any errors.

I don't have the resources to debug several thousand lines of code plus you will be quicker at it since you know the code.

Let me know what happens.
May 14 '13 #44
I do use it but its just that it works but it gives the negatives.
May 14 '13 #45
weaknessforcats
9,208 Expert Mod 8TB
You will have to follow one of these values from where you initialize it to where it goes negative.

Do you use the debug windows?
May 14 '13 #46
some what I am not the most experienced with it but I do use it.
May 14 '13 #47
weaknessforcats
9,208 Expert Mod 8TB
Use the watch windows. You can put in the name of any variables you want and see ther values at all times.

Then step through the code cecking those values with each step.

Do you know about breakpoints?
May 15 '13 #48
not really, no. I will just look around the web and figure out how to use this more affectingly.
May 15 '13 #49
I just scraped the last combat system and made a different one its working great! I will be close to finishing the game.
May 15 '13 #50

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Richard Patching | last post by:
Have been looking into text based UI's in Python, but have found very little useful documents. I am looking for some NCurses tutorials in particular but can't seem to find anything helpful. Can...
1
by: supportgeek | last post by:
Greetings. Would anyone know the right direction to point me on this one? I need to read text from a Windows Application based on cursor position. And enter text based on what is read. ...
5
by: Mike Mimic | last post by:
Hi! I am programming small program which would use its own text based network protocol. I come to the problem with ending lines. I was thinking about ending them with \r\n combination. But the...
1
by: Nathan Sokalski | last post by:
I have had a question that I have been avoiding or using workarounds for for a while. When using text-based controls (Labels, HyperLinks displayed as text, LinkButtons, etc.), how do I format...
5
by: Alex | last post by:
Hello, I hope I can explain this properly. I'm writing an application with a tabbed-based navigation, and a form which gets filled out by users will be split into 5 subtabs. What I need is...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
2
by: Supremelink | last post by:
Hi all! I´m supposed to develop a text based application with .net 2005 and C#. Users shall connect to my app via Citrix, using windows CE 5.0. Any thoughts about how to do this? Should I...
3
by: Mefistofeles | last post by:
Hello. Need help to make text-based radio buttons. On my calender site I want to have text that works like radio buttons. Exampel, bold text is the selected radio-text. Jan Feb Mar Apr May...
0
by: JosAH | last post by:
A Simple Text-Based Menu System Read this this post; there are numerous posts like that: a newbie struggling with some sort of menu implementation. They want nested menus of course and an option...
10
oedipus
by: oedipus | last post by:
I am currently learning java at school and thus far we have oly dealt with the text-based compiler JGrasp; therefore; my attempt to code Tictactoe or "X and O's" game is written as a text based...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.