loading

Often looked over, Notepad is a powerful tool that many people simply think of as a downgraded Microsoft Word, when in fact, Notepad can be used to create files with unlimited possibilities in the computer world, such as opening programs, performing command prompt operations, and creating interactive programs. In this Instructable, I will be teaching you how to create a simple role playing game using Notepad.

Step 1: Make Sure You Can Actually Do This

To create your own RPG in Notepad you must first have the following:

  • A computer with Windows
  • That's about it

Step 2: Become Familiar With Notepad

For this tutorial, there are just a few important commands that you need to know in order to start working

  • @echo off (gets rid of the command prompt text entry bar)
  • echo (prints a string of words into the window)
  • :placeanythinghere (uses as a reference point for searching through the code)
  • goto (finds a reference point)
  • cls (clears the screen of past code)
  • set /p web= Type Option Number (lets you type an option number)
  • if (allows you to perform functions based on input)

Optional

  • color (changes the color of command prompt text)
  • shutdown (shuts down computer if failure occurs)

(For more Notepad/Command Prompt commands, open Command Prompt and type help.)l

Step 3: Start Making Decisions

This is the very beginning of the code that makes up my RPG. Anything that is in bold is changeable. As you can see, every decision is changeable, but not the commands. "color f" changes the text color to bright white. The numbers after the "echo"s are not part of the command, but they simply label the decision number for the player to enter. After "goto," it gives the code a reference to find in the code. Whatever you change those to, make sure you change the reference point in the text.

@echo off
:home
title RPG by Numbers!
color f
cls
echo.
echo Welcome to RPG By Numbers! To play, simply type the number that represents your decision and press enter. Good luck!
echo.
echo SELECT A CLASS
echo.
echo 1) Warrior
echo 2) Wizard
echo 3) Scrapper
echo 4) Gladiator
echo 5) Exit RPG
echo.
set /p web=Type option number
if "%web%"=="1" goto warrior
if "%web%"=="2" goto wizard
if "%web%"=="3" goto scrapper
if "%web%"=="4" goto gladiator
if "%web%"=="5" exit

Step 4: Middle Decisions

This is an example of one of the middle decisions you can make. As you can see, the "goto"s are all labeled by number to go to to that certain path reference. As you continue to write, you must only label your reference points differently and change the story.

:warrior1-2

title Warrior Path 1-2
cls
echo.
echo YOU HAVE CHOSEN TO SNEAK AROUND THE GOBLINS. You quietly move to the edge of the cave and tip-toe past the goblins. They continue arguing over the gold, and seem not to notice you. Suddenly, one of the goblins stops and looks in your direction. What do you do?
echo.
echo 1) Freeze, and hope they don't notice you
echo 2) Attack the goblins
echo 3) Imitate the goblins and try to get the attention away from you
echo 4) Undo last decision
echo.
set /p web=Type option
if "%web%"=="1" goto warrior1-2-1
if "%web%"=="2" goto warrior1-2-2
if "%web%"=="3" goto warrior1-2-3
if "%web%"=="4" goto warrior1
goto warrior1-2

Step 5: Finishing Up

This is the last part of code that I wrote for my RPG. It is the code for when you die. To write the winning code, do similar to this and the middle code(minus the shutdown). The echo's in the middle create a picture to go with the screen. You can add these to any of your decisions. Timeout tells the code to wait for the specified amount of time before carrying out the next command. Afterward, the computer shuts down because you lost(you can take this out if you want).

:dead
title You Have Lost
color 48
cls
echo.
echo YOU HAVE BEEN DEADIFIED.........SOMEHOW. We all die someday, unless of course, you won. What do you want to do?
echo ------
echo I I
echo IX XI
echo I _ I
echo I I
echo --------
echo.
timeout 3
shutdown -s
goto dead
goto home

Step 6: Playing My Game

This is what I have written for my game. It's not finished yet, but I have a playable portion done. To play, simply download the file and open it. It will open a command prompt window that contains the game. Enjoy!

<p>Hey! Loving the RPG, but with the gladiator after having (the first gladiator you fight if you choose to go into the competition rather than fight) fallen choosing to club him causes it to exit.</p>
<p>This is because the game is not complete. When the code finds a part that doesn't exist yet, it exits the program.</p>
<p>it's nice</p>
<p>This is neat. Good job on your first instructable. I look forward to playing again when the game is complete. </p>
<p>Thanks, I'll work on finishing it</p>
<p>Cool game, I noticed several bugs though. But I would love to see this complete.</p>

About This Instructable

5,426views

37favorites

More by Corbin_Hacks_Stuff:Wood Burned Belt Buckle LaserComm Crack of Dawn Alarm Clock 
Add instructable to: