Thread: text rpg

  1. #16

    btw

    copy/paste or drag into the bar for that url. geocities requires it.
    -Save the whales. Collect the whole set.

  2. #17
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    crpog - sorry for the confusion. yes, all i meant is making the code line up
    theoretically your code will work. now to get it updated, all you have to do is redraw the map using the for loops that i used in my last post.
    does this help?
    btw, im going to be traveling all day today so i may not get a chance to reply for a bit.

    later

  3. #18
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    does any one know how to print the map with the person on it thanx in advanced...
    Last edited by c++.prog.newbie; 12-13-2001 at 06:05 PM.

  4. #19
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    or does anyone know how to print the map with T for trees on it and | or _ for paths

  5. #20
    Sorry about that bad link. Try this.
    "There's always another way"
    -lightatdawn (lightatdawn.cprogramming.com)

  6. #21
    Unregistered
    Guest
    well ok apparently my last post didnt show up.
    to update the player's position:

    in the function that redraws the map, right before the two for loops, all you need to put is
    map[x][y]=player;

    then start the for loops

    and the question about the T for trees, etc...youll have to do those manually unless you can get an algorithm or something to randomly print them on the map.
    if you do them manually, itll look something like this:
    map[2][7]='T';

    however, that will only work if you initialize the map as a CHAR array....
    char map[5][5];
    instead of..... int map[5][5];

    hope this all makes sense and i hope it helps.
    later

  7. #22
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    woops. that last post was from me. forgot to log in....

  8. #23
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    ok i have a switch statement and it comes with the error

    case value '1' already used

    Code:
    	switch(choice1) 
    		{
    			case('a' || 'A'):
    				ELife = ELife - Dam;
    				if (ELife <= 0 ) {
    					Victory();
    				}
    				Dam = 0;
    				system("cls");
    				EAttack();
    				break;
    -->(error is here)	case('m' || 'M'):
    				Dam = CastMagic(MagicP);
    				ELife = ELife - Dam;
    				if (ELife <=0) {
    					Victory();
    				}
    				Dam = 0;
    				system("cls");
    				EAttack();
    				break;
    -->(and error is here)case('p' ||'P'):
    				Potion();
    				break;
    			default:
    				cout<<"input";
    				BattleMenu();
    				break;
    		}
    could some one tell me what this means

  9. #24
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    ok i dont think you can use 'X' || 'x' in case statements...to fix this, add the ctype.h header file at the top of your source and type the following just before the
    switch(choice1)
    line.......

    choice1=toupper(getch());

    then put the switch(choice1) line.

    then, inside the case 'blahblahblah' crap, all you need to put is:

    case 'P':
    yada yada....
    break;
    case 'M':
    yada yada....
    break;

    etc, etc. the choice1=toupper(getch()) stuff takes whatever they typed (which is put into the var choice1) and make it uppercase, hence the keyword toupper. now you dont have to make sure they hit the lowercase x or the uppercase X, just the uppercase one.
    i think that was your problem. let me know if that does anything.
    later

  10. #25
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    thanx that solved the problem

  11. #26
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    cool. it seems as tho youre working on something, so if you get something going, email it to me, i would like to see what youve come up with.

    [email protected]

  12. #27
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    oh... i'm just working on something very simple just the basic choose were you want to go from a menu and then battle a monster but it keeps quiting were you choose were you want to go

    if someone could check it out and tell me whats wrong that would help

    thanx

  13. #28
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    alright. i looked through it and fixed a few areas...im uploading it with the bugs fixed...heres where the problems where:
    1) when you do switch statements, don't use cin...just use
    getch()...im not sure if cin works for these, because apparently they arent working for you.
    2) in your switch statements, where you have something like:
    case 1: yadayada.....
    you must have ' ' around the numbers...so instead of case 1, you have to put case '1'
    3)in your battlemenu() function, you had cin >> choice1; and then after that choice1=tolower(getch());. screw the cin >>...that getch will take care of it.
    4) in the rest() function, you have the statement
    if (l = 1)...it should have been if (l==1)

    youve got some bad problems when it comes to going to the next step in the process. when i hit 5 to quit it goes to combat, when i hit 1, 2, 3, 4 it does jack. i cant figure out what is telling what to do what. its rather confusing. im sorry i didnt find more, but i hope some of this helps you later.

  14. #29
    Registered User
    Join Date
    Oct 2001
    Posts
    224
    ok thanx ill work to fix those and stuff..

  15. #30
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    i tried to fix the ones that i specifically listed, but the logic ones are tough, try to get those fixed or else your demo wont do much

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. text rpg help
    By xxwerdxx in forum Game Programming
    Replies: 1
    Last Post: 11-26-2005, 08:16 PM
  2. Replies: 3
    Last Post: 05-25-2005, 01:50 PM
  3. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 04:49 PM
  4. mygets
    By Dave_Sinkula in forum C Programming
    Replies: 6
    Last Post: 03-23-2003, 07:23 PM
  5. Check out My Text Rpg Game
    By knight543 in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2002, 10:40 PM