Using skills in a batch rpg game

May 29, 2013 at 11:29:39
Specs: Windows xp
OK for some reason this code will not even work:

:prace
cls
echo Choose a race.
echo.
echo h)Human
echo e)Elf
echo o)Orc
set /p race=:
if %race% equ h set /a %str% equ 12
if %race% equ e set /a %wis% equ 13
if %race% equ o set /a %con% equ 14
if not %race% equ h goto prace
if not %race% equ e goto prace
if not %race% equ o goto prace

it needs to set str (strength) to 12 when you type h and hit enter
i have allredy set all of the skills to 0 at the start of the batch file.
but when i open it, it flashes "Missing opperator" at the bottom what do i do?


See More: Using skills in a batch rpg game

Report •

#1
May 29, 2013 at 12:04:54
nickmon what do i do?
Pick a real language. C# is free and easy. You could even make your game graphical! VBScript is bundled with Windows. Write it as an HTA, and you can even make your game graphical!

How To Ask Questions The Smart Way


Report •

#2
May 29, 2013 at 14:48:11
Although I agree with the above

:prace
cls
echo Choose a race.
echo.
echo h)Human
echo e)Elf
echo o)Orc
set /p race=":"
if %race% equ h set /a str=12 && goto next
if %race% equ e set /a wis=13 && goto next
if %race% equ o set /a con=14 && goto next
echo Sorry that is not an option. Please try again
goto prace
:next

it might be helpful to check the syntax on set /a
http://ss64.com/nt/set.html

:: mike


Report •

#3
May 30, 2013 at 08:47:15
Thank you "mikelinus" ill try to fix it.
I know a little batch so if you know any guide can you find me one?
By the way im 15 and i am the only one that i know that is interested in programming at my age.

Report •

Related Solutions

#4
May 30, 2013 at 09:02:25
Even though the site I listed below is really only showing the /? for all cmd commands, It was extremely helpful for me when I was first learning. Even though I can now write batch scripts with ease, I must say I agree with Razor2.3... Everything is better than batch scripting...

http://ss64.com/nt/

Hope this link helps!!

Law of Logical Argument: Anything is possible if you don't know what you're talking about.


Report •

#5
May 30, 2013 at 09:47:49
So pick up a real programming language! If you don't believe me, listen to Raymond Chen, "[N]obody actually likes batch programming. You merely tolerate it."

C# is popular enough to have a lot of educational resources available, and its IDE will spoil you. You'll need Win7/8 for VS 2012, but I think 2010 works with XP. It's a language actively used by companies, and it's free.
http://www.microsoft.com/visualstud...

Python's pretty easy, and it has a lot of educational resources available. Its focus is on readability, and making your code readable is an important skill for any programmer. There might be a stronger Linux focus, but so it goes. It's also free.
http://www.python.org/getit/

I'm trying to think up a good third language for newbie programmers, but I'm getting a blank. Web languages add several layers that a student probably doesn't want to worry with; why learn one language when you can learn CSS, HTML, JavaScript, SQL, and PHP all at once! Besides, I'd avoid PHP just because the free online resources are horrible and will turn you into a horrible programmer. Avoid C, C++, and Objective-C; you should be learning the concepts of programming, not having to watch your memory.

Honestly, you should probably feel around and pick a language you like and works well for you. What you should do is go and get a good book on programming, and use whatever language that book expects you to use. Just remember knowledge is valuable, so knowledge costs. You might want to check your local library and see if they have any books on the subject.
http://www.barnesandnoble.com/s/pro...
http://search.oreilly.com/?q=progra...
http://www.amazon.com/Best-Sellers-...

How To Ask Questions The Smart Way


Report •

#6
May 30, 2013 at 13:02:21
No its not that i don't belive you Razor its just that i can't find any good guides or tutorals for creating stuff in C++ or C# programming.
If you or some one can post a simple game code for me to try on C++ and learn all the commands on it.
and i don't want to really buy anything.

Report •

#7
May 30, 2013 at 13:15:09
I used the site below when I needed some help while I was still learning vb.net (the link I'm posting below is for their C# tutorials). It was very helpful because you created your own examples. I still refer to some of them every now and again...

http://www.homeandlearn.co.uk/cshar...

Good luck!

Law of Logical Argument: Anything is possible if you don't know what you're talking about.


Report •

#8
May 30, 2013 at 13:18:13
Some sources I have found helpful in the past, if its the route you would like to go.

This forum of course
ss64.com
dostips.com
http://www.robvanderwoude.com/batch...
and of course using the /? at the prompt with the command.

:: mike


Report •

Ask Question