Minecraft Blogs / Tutorial

How to make a simple RPG(batch)

  • 1,142 views, 1 today
  • 1
  • 0
  • 5
JamalMan's Avatar JamalMan
Level 11 : Journeyman Engineer
2
Well, you want to make a nice RPG but dont know how? Here is a tutorial how!
First open up notepad and type @echo off on the first line!
Second type title (title of your game) and then it should look like this:
@echo off
title My RPG
Next you will type :start (for a reason you will later see)
After you type that you should type echo (text for your main title screen)
Now the code should be like this!
@echo off
title My RPG
:start
echo Welcome to my game!
Now before you do that under :start type cls
After we do that type set /p menu=Type start to play
Now the kind of hard part, you want to type if %menu% == start goto game
After that type goto start
Now it should look like this
@echo off
title My RPG
:start
cls
echo Welcome to my RPG!
set /p menu=Type start to play
if %menu% == start goto game
goto start
Now we type :game
After that type cls
Now we type echo then some good text EG: echo You are near a river, you see a rock and some water.
Then type set /p (whatever here)=What do you do?
Now we type something like this:
if %(whatever you typed there) == drink goto drinkwater
:drinkwater
cls
echo You are no longer thirsty!
goto game
Now you continue like this until your fingers hurt!
Thanks for reading, comment, diamond, and subscribe please!
Example of a game

@echo off
title The Adventure
setlocal EnableDelayedExpansion
color 0a
echo First what is your name?
set /p name=
cls
echo Loading...
timeout 3 > nul
goto game
pause > nul

:game
set /a stage=0
set /a healthpill=1
cls
echo --------------------------------
echo The Adventure
echo --------------------------------
echo Type the number of what you would like to do.
echo 1)Play
echo 2)Info
echo 3)Quit
set /p gamemenu=
if %gamemenu% == 1 goto playgame
if %gamemenu% == 2 goto info
if %gamemenu% == 3 goto quit
goto game

:info
cls
echo Work In Progress
timeout 2 > nul
cls
goto game

:playgame
if %stage% == 1 goto noflee1lvl
if %stage% == 2 goto findvillage
cls
echo Ok,%name% next we will have 2 starter classes.
echo Type the number of what class you want
echo 1)HP Class
echo 2)Money Class
set /p basicclass=
if %basicclass% == 1 goto HPClass
if %basicclass% == 2 goto MoneyClass
goto playgame

:HPClass
cls
echo Now you will get more HP!
echo But less gold!
set gold= 100
set hp= 20
set xp= 0
timeout 2 > nul
goto nextstep

:MoneyClass
cls
echo Now you start with lots off gold!
echo But less HP
set gold= 250
set hp= 5
set xp= 0
timeout 2 > nul
goto nextstep

:nextstep
cls
echo Here are your stats...
echo ---------------------------------------------------------
echo Gold:%gold% HP:%hp% XP:%xp%
echo ---------------------------------------------------------
echo 1)Save
echo 2)Load
echo 3)Play
echo 4)Quit
set /p idk=
if %idk% == 1 goto save
if %idk% == 2 goto load
if %idk% == 3 goto startrealgame
if %idk% == 4 goto sure
goto nextstep

:sure
cls
echo Are you sure you want to quit?
echo 1)No
echo 2)Yes
set /p sureyou=
if %sureyou% == 1 goto nextstep
if %sureyou% == 2 goto quit
goto sure

:save
cls
echo Saving....
ping localhost > nul
(
echo %gold%
echo %hp%
echo %xp%
echo %healthpill%
echo %name%
echo %stage%
)>saveload.dlb
timeout 2 > nul
cls
echo Done saving!
timeout 1 > nul
goto nextstep

:load
cls
echo Loading game...
ping localhost > nul
(
set /p gold=
set /p hp=
set /p xp=
set /p name=
set /p stage=
)
timeout 2 > nul
echo Loaded!
timeout 1 > nul
goto nextstep

:startrealgame
if %stage% == 1 goto nofleelvl1
if %stage% == 2 goto defetefirstenemie
if %stage% == 3 goto findvillage
cls
echo Entering sewers...
timeout 2 > nul
cls
echo LVL1 rat attacks!
timeout 1 > nul
set limit
cls
:noflee1lvl
set /a stage=1
echo **********************
echo LVL1 RAT 1/1 HP
echo ***********************
echo 1) Hit with baseball bat.
echo 2) Flee
echo 3) Inventory
set /p firstbattle=
if %firstbattle% == 1 goto smackrat
if %firstbattle% == 2 goto cannotfleefirstboss
if %firstbattle% == 3 goto invfirstlvl
goto noflee1lvl

:invfirstlvl
cls
echo Inventory:
echo ----------------------------
echo 1.Baseball Bat 2.%healthpill%Health Pill
echo ----------------------------
echo Press anything to go back to battle.
pause > nul
goto noflee1lvl

:cannotfleefirstboss
cls
echo Cannot flee, to week.
timeout 2 > nul
goto noflee1lvl

:smackrat
cls
echo **********************
echo LVL1 RAT 0/1 HP
echo **********************
echo Rat died, lost no HP!
pause > nul
cls
echo You gained 5 XP!
echo You gained 0 gold. =(
set xp=5
timeout 2 > nul
:defetefirstenemie
cls
set /a stage=2
echo Here are your stats...
echo ---------------------------------------------------------
echo Gold:%gold% HP:%hp% XP:%xp%
echo ---------------------------------------------------------
echo.
echo 1)Next
echo 2)Inventory
echo 3)Quit
echo 4)Save
set /p yay=# of choice
if %yay% == 1 goto defetedlvl1rat
if %yay% == 2 goto firstkillinv
if %yay% == 3 goto quit
if %yay% == 4 goto defect1enemiesave
goto defetefirstenemie

:firstkillinv
cls
echo Inventory:
echo ----------------------------
echo 1.Baseball Bat 2.%healthpill%Health Pill
echo ----------------------------
echo Press anything to go back
pause > nul
goto defetefirstenemie

:defect1enemiesave
cls
echo Saving
ping localhost > nul
(
echo %gold%
echo %hp%
echo %xp%
echo %healthpill%
echo %name%
echo %stage%
)>saveload.dlb
timeout 2 > nul
cls
echo Done saving!
timeout 1 > nul
goto defetefirstenemie

:defetedlvl1rat
cls
echo You find a village near the body of the rat.
timeout 1 > nul
:findvillage
set /a stage=3
cls
echo 1)Go to the village
echo 2)Take health pill
echo 3)Stats
echo 4)Next
echo 5)Save
set /p find1village=
if %find1village% == 1 goto village
if %find1village% == 2 goto fullhealth1
if %find1village% == 3 goto findvillagestats
if %find1village% == 4 goto kingrat
if %find1village% == 5 goto firstbloodsave
goto findvillage

:firstbloodsave
cls
echo Saving
ping localhost > nul
(
echo %gold%
echo %hp%
echo %xp%
echo %healthpill%
echo %name%
echo %stage%
)>saveload.dlb
timeout 2 > nul
goto findvillage

:fullhealth1
cls
echo You have full health.
timeout 1 > nul
goto findvillage

:findvillagestats
echo Here are your stats...
echo ---------------------------------------------------------
echo Gold:%gold% HP:%hp% XP:%xp%
echo ---------------------------------------------------------
echo.
echo Press anything to go back.
pause > nul
goto findvillage

:village
cls
echo You go to the village.
echo.
echo 1)Go to healer.
echo 2)Go to blacksmith
echo 3)Go to houses.
echo 4)Inventory.
echo 5)Back
set /p village=
if %village% == 1 goto healer
if %villahe% == 2 goto blacksmith
if %village% == 3 goto houses
if %village% == 4 goto villageinv
if %village% == 5 goto findvillage
goto village

:villageinv
cls
echo Inventory:
echo ----------------------------
echo 1.Baseball Bat 2.%healthpill%Health Pill
echo ----------------------------
echo Press anything to go back
pause > nul
goto village

:healer
cls
echo Healer: Would you like some health pills?
set /p healer1=Y/N
if %healer1% == Y goto buyhealthpill1
if %healer1% == y goto buyhealthpill1
if %healer1% == N goto comebacklater1
if %healer1% == n goto comebacklater1
goto healer
:buyhealthpill1
cls
echo Press anything to buy health pill
pause > nul
if %gold% lss 20 goto healthpillnocash
set /a gold=%gold%-19
timeout 1 > nul
set healthpill=%healthpill%+1
pause 1 > nul
echo You have %healthpill% Pills
goto village

:healthpillnocash
cls
echo Sorry not enough cash!
timeout 1 > nul
goto village

:blacksmith
cls

:houses
cls

:comebacklater1&lt
Tags

Create an account or sign in to comment.

1
12/23/2013 11:48 am
Level 52 : Grandmaster Programmer
DarkEyeDragon
DarkEyeDragon's Avatar
Lol quite useless but cool in another way ^_^
1
12/23/2013 11:51 am
Level 11 : Journeyman Engineer
JamalMan
JamalMan's Avatar
Well its useless in the way that you dont NEED it the game is for fun!
1
12/23/2013 11:54 am
Level 52 : Grandmaster Programmer
DarkEyeDragon
DarkEyeDragon's Avatar
Its a good way to explore batch but doesnt really have that "looks nice" expression xD thats all i ment with it. No offense
1
12/23/2013 12:00 pm
Level 11 : Journeyman Engineer
JamalMan
JamalMan's Avatar
Yeah I get that but in my games the menu looks like this:
#############################
# 1 to start #
# 2 for stuff #
# 3for stuff #
#############################
1
12/23/2013 12:01 pm
Level 11 : Journeyman Engineer
JamalMan
JamalMan's Avatar
WAIT WHAT?!?!?1?!?!??!?!?!/!?!? WHY ARE THERE a's xD
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome