Well, I'm not exactly an expert with C++, and I have been making a text RP for general use.
I'm having some problems.

#include "Library.h"

void main()
{
	//welcome screen

	 cout <<"####Welcome to Xe0n RP, part of the Xe0n project started by Adil\n";
	 cout <<"####Programmed in C++\n";
	 cout <<"####Currently in beta\n";
    wait();
	crossroads();

	

	cout << "\n\n###Thanks for playing!\n";
	cout << "###Leave feedback at www.caustik.heliohost.org/blog\n";


	

}

Main.cpp

#include "Library.h"

//vars
bool glcomplete = false;
bool fcomplete = false;
bool scomplete = false;
bool gcomplete = false;
bool ccomplete = false;


bool Crossroads()
{
	
	
	int choice = 0;
	while (choice !=0)
	

	
{
	cout << "You stand at a deserted crossroad.\n";
	cout << "There is a town with a marketplace infront of you\n";
	cout << "There is the road that leads to the forest, to the left of you\n";
	
	
	
	cout << "Which path do you choose?\n";

	cout << " 1:Town\n";
	cout << " 2:Portal\n";


	if (!glcomplete)
		cout << " 3:Arbek Moutain range(Quest)\n";
	if (glcomplete && !fcomplete)
		cout << " 4:Savanah Plains(Quest)\n";
	if (fcomplete && !scomplete)
		cout << " 5:Vradix Caves (Quest)\n";
	if (scomplete && !gcomplete)
		cout << " 6:Truxadr Forest (Quest)\n";
	if (gcomplete && !ccomplete)
		cout << " 7:Thrumador Road (Quest)\n";
		
	    cout << " 10:Exit\n";
		cout << ">";
		cin >> choice;


}

	return false;
}
#include "Library.h"

//vars
bool glcomplete = false;
bool fcomplete = false;
bool scomplete = false;
bool gcomplete = false;
bool ccomplete = false;


bool Crossroads()
{
	
	
	int choice = 0;
	while (choice !=0)
	

	
{
	cout << "You stand at a deserted crossroad.\n";
	cout << "There is a town with a marketplace infront of you\n";
	cout << "There is the road that leads to the forest, to the left of you\n";
	
	
	
	cout << "Which path do you choose?\n";

	cout << " 1:Town\n";
	cout << " 2:Portal\n";


	if (!glcomplete)
		cout << " 3:Arbek Moutain range(Quest)\n";
	if (glcomplete && !fcomplete)
		cout << " 4:Savanah Plains(Quest)\n";
	if (fcomplete && !scomplete)
		cout << " 5:Vradix Caves (Quest)\n";
	if (scomplete && !gcomplete)
		cout << " 6:Truxadr Forest (Quest)\n";
	if (gcomplete && !ccomplete)
		cout << " 7:Thrumador Road (Quest)\n";
		
	    cout << " 10:Exit\n";
		cout << ">";
		cin >> choice;


}

	return false;
}

When I compile, I get the following:
[IMG]http://i51.tinypic.com/1ta3vn.jpg[/IMG]
I should be getting the stuff from the crossroads code, but I'm not.
Any ideas where I'm going wrong?

Recommended Answers

All 3 Replies

first, in Main.cpp replace

crossroads();

with

Crossroads();

then in bool Crossroads() replace

while (choice !=0){

with

if (choice == 0){

Thanks for the help appreciate it :)

good Ertzel :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.