Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is my code so far,

@echo off
TITLE The Adventure

:startup
cls
echo.
echo #################################
echo #------------------------------------------#
echo #----------- #WELCOME TO# ------------#
echo #---------- #THE ADVENTURE# ----------#
echo #-----------------------------------------#
echo ################################
echo.
echo.
cecho {03}[1] Start a new game{#}
echo.
cecho {03}[2] Exit game{#}
echo.
set /p menuselection= Enter:
if %menuselection% equ 1 goto raceselect
if %menuselection% equ 2 exit
goto startup

:raceselect
cls
echo.
echo Here, you will have the chance to create your very own hero.
echo Please begin by entering the corresponding numbers, choose wisely.
echo You don't want to end up with a hobbit warrior, imagine it.
echo He'd be flailing his sword at the enemies knees.
echo Anyway, have fun.
echo.
echo Just so you know, for now you are only able to
echo play as a Human Warrior.
echo.
echo.
echo Okay, we will begin by selecting your heroes race.
echo.
cecho {03}[1] Human{#}
echo.
cecho {0C}[2] Hobbit-----------------------------------------{#}
echo.
cecho {0C}[3] Dwarf ---- CANNOT PLAY AS THESE RACES YET! ----{#}
echo.
cecho {0C}[4] Elf -----------------------------------------{#}
echo.
set /p raceselection= Enter:
if %raceselection% equ 1 goto humanclassselect
goto raceselect

:humanclassselect
cls
echo.
echo Okay, so you have chosen your heroes race (Human), you are now going
echo to select you heroes class.
echo.
echo [1] Warrior
echo ([2] Rogue ) -------------------------------------------
echo ([3] Archer) ---- CANNOT PLAY AS THESE CLASSES YET! ----
echo ([4] Mage ) -------------------------------------------
echo.
set /p humanclassselection= Enter:
if %humanclassselection% equ 1 goto humanwarriorstart

Pretty basic stuff, but the way I'm currently coding it, I would have to make at least 16 of the same campaign just for each different race and class you choose. So I was wondering if there was an easy way of doing this so that it all stays in the same story but depending on the class and race you choose, your stats change? Also, I'm sorry for copy and pasting the whole thing but that's the only way I could show you what I have done.
Posted
Updated 16-Feb-14 0:11am
v4
Comments
Please tag your question with proper technology tags,

1 solution

Basically? No.
You are trying to write a text based adventure in a batch file - and trust me on this, that is a whole load more work than you need it to be.

I would strongly suggest that abandon that approach - which is going to get increasingly complicated and error prone as your adventure gets bigger - and consider moving to a "proper" programming language, which can support subroutines, and classes, and attributes, and so forth without the hassle you give yourself by trying to do the same things in a command file. It really, really, will make your life a lot easier, not just in the long run, but in the short term as well!

Have a look at this: http://www.gamedev.net/topic/650104-text-based-adventure-game-microsoft-visual-studio-c/[^] - it's a beginner being helped to create his first text based adventure for a school project. It's won't hand it to you on a plate, but it should give you some pointers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900