Batch Adventure Game - Legend, Version 0.8 PRE

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
RCAProduction
Posts: 1
Joined: 02 Nov 2015 11:08

Batch Adventure Game - Legend, Version 0.8 PRE

#1 Post by RCAProduction » 02 Nov 2015 11:19

This is a simple DOS-based batch file game. Entitled Legend, the idea comes from the old Telnet LOTR, however it is all programmed from scratch. It is playable all the way through, but technically does not have an ending. Any bugs, errors, or possible improvements would be fantastic to hear!

The code is found here: http://pastebin.com/raw.php?i=8SzYLvC8

To play, simply download the code into a file with a .bat extension, and run the file.

This is a pre release, so any comments and suggests are very much welcome!

-RCAProduction

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Batch Adventure Game - Legend, Version 0.8 PRE

#2 Post by penpen » 03 Nov 2015 11:21

If you view your stats, then you automatically leave the town:
Is that how it should work?


Legend.bat wrote:

Code: Select all

if exist Legend!.bat (ATTRIB -R Legend!.bat)
echo. Legend.bat>Legend!.bat
ATTRIB +R Legend!.bat
These lines (and the file "Legend!.bat") seem to be pretty useless.


Legend.bat wrote:

Code: Select all

echo Which option appears more like a box?
echo.
echo "           A.)
echo "                _
echo "               !_!
echo "
echo "           B.)
echo "               ÚÄ¿
echo "               ³ ³
echo "               ÀÄÙ
echo.
choice /c AB /n /m ">"
:: ...
You could choose a specific codepage, so there is no need for such an initialization (for example 850 (Multilingual Latin I) :

Code: Select all

chcp 850
Or is there any other reason for this question?

You could also set the number of lines and columns using the "mode" command.

In addition you shouldn't use the choice command if you want to run it on winxp, else add a note where to download from.
One alternative is to use xcopy could be found here (because this seems to be a public project don't forget to ask the authors; PM them):
http://www.dostips.com/forum/viewtopic.php?p=27384#p27384.


Legend.bat wrote:

Code: Select all

:namee
set /p user="Your name:"
ATTRIB -H settings.meow
CLS
choice /c YN /m "Save?"
if %errorlevel%==2 (goto entered)
(
echo %user%
echo %gen%
echo %gold%
echo %health%
echo %weapon%
echo %level%
echo %kills%
echo %armor%
echo %defense%
echo %bank%
echo %kiss%
echo %weplev%
)>settings.meow
Never trust user input!
So you should check the user input, and output variable names using delayed expansion (!user!).
Actually it is possible to change anything by typing this username:

Code: Select all

Conan&set "gold=100000"&set "level=200"&>con echo(Thanks: Press a key to continue.&pause>nul&set "user=Conan"
You only have to save it a second time.


penpen

Post Reply