Hi. I asked mod /v/Mabel_Pines for a teacher flair addition and they agreed. I think this will be a unique addition to this subverse. I don't really have any useful skills but I can run a crash-course commandline game tutorial. This is presumably not what most people on this subverse are here for but it's all I've got. With that let's start.
Make A Simple RPG-esque Game In BATCH
Example pic: 1 and 2
Note: This tutorial only works for Windows users (runs on the cmd) so Mac users miss out unless they have a VM of some sort.
- First open Notepad or some kind of text editor. I'll be using Notepad. (As long as the file can save as a .bat it's good to go.)
- Now that you have a blank Notepad document in front of you, type
(Ignore the blue link) so that the commands you type won't show up in the game.
- Okay next I usually put down a
to make sure the screen is blank when the game starts. Who knows what the user was doing before.
- Then I add a title to the game, the thing that will appear at the top of the header or whatever
- You can change the colors of the game (background color and text color) by using a mashup of 1 through 9 like so
this makes black background with grey/white text. Go look up the other colors if you're interested.
Okay. Next, there's labels. Labels? Yeah they're really simple. To go to a label you just use
Pretty easy. To make a label, you just use
- In BATCH there's a limit to what you can do to interact with your user. Still, here's some useful tidbits.
- To print something to the screen, one has to use
You can't just use echo (nothing) though, no. If you want a blank line, you have to use
Labels are useful if there's going to be multiple choices/decisions that have different outcomes in your game. Okay, okay. Now for some user interaction. To "pause" a game (on one screen, for instance) one writes
This is useful with, well, a LOT of stuff. It basically shows info until the user presses a button. Think of RPG conversations that continue only when A is pressed or something.
Let's put that all together
echo This is a test!
Then Save this file as Test.bat (THE .bat IS VERY IMPORTANT) and Open With or drag into the cmd (Windows Command Processor).
It will look like THIS
Pretty boring, I know, but that's really the backbone of these games. Here's a more interesting example to play with from a game I made a while ago. Here.
To add things like choices without going into too much detail it pretty much has this format
echo press a number
set /p $=Enter:
if %$% equ 1 goto start
if %$% equ 2 goto instructions
if %$% equ 3 goto exit
Okay I hope this helps some people get into programming short BATCH games. This is a very simple basic guide yet you can already make a pretty intersting game with just these commands. If you have any questions ask me.