====== DoorBench: a guide for beginners ====== You do not need to know programming. This guide makes a small game, plays it, and puts it on a BBS. Allow about an hour. ===== Some words ===== ^ Word ^ What it means ^ | BBS | A bulletin board: a computer people call or connect to with a terminal program | | Door | A game that runs on a BBS | | Sysop | The person who runs the BBS | | Drop file | A small file the BBS writes to tell the game who is playing. The game reads it by itself | | FOSSIL | A small DOS program that looks after the modem. Only for DOS boards | | Place | A room or menu in your game | | Choice | A key the player can press in a place | | Field | Something the game remembers, such as a player's cash | | Table | A list, such as the animals a player can meet | | Module | A ready-made part, such as a shop or a fight | | Block | One step the game carries out, such as //Say// or //Spend// | ===== 1. Install DoorBench ===== Get it from https://kalretro.au/doorbench/ * **Windows:** run the setup program. * **Debian, Ubuntu, Mint:** in a terminal, ''%%sudo apt install ./doorbench_0.4.3_amd64.deb%%'' * **Other Linux:** unpack the archive and run ''%%./install.sh%%'' The computer you make games on does not need a BBS. ===== 2. Look at a finished game first (5 minutes) ===== **1.** Start DoorBench and press **New project...**\\ **2.** Type a name for the game. The file name fills itself in.\\ **3.** Beside **Start from** choose //The Hollow//. Choose a folder with the **...** button, and press **Create**.\\ **4.** Press **F5**, then **Play as Ann**. Click on the black screen and play with the keyboard.\\ Nothing you do in test play can damage anything. You can change this game as much as you like. ===== 3. Start your own game ===== Press **New project...** again (or **File**). Fill it in like this and press **Create**. {{:doorbench:guide:new-project.png|The New project window}} Press **Ctrl+S** now and then to save. **Ctrl+Z** takes back a mistake. You can copy and paste in any box with **Ctrl+C** and **Ctrl+V**, or by right-clicking in it. ===== 4. Add a second place ===== **1.** In the **Flow** tab press **New place**, type ''%%cave%%'' and press Enter.\\ **2.** The cave opens. It already has a **Back** choice. A red "nothing leads here" is normal: you have not made a way in yet.\\ {{:doorbench:guide:place.png|The cave, just made}} **3.** Click **Flow** on the left. Drag the small dot on the right of //home// onto //cave//. A line appears and the red goes away.\\ {{:doorbench:guide:flow-link.png|Home leads to the cave}} ===== 5. Something to own, and a shop ===== **1.** Click **Fields** on the left. Under //Each player has// press **Add a field**. Change its name to ''%%bread%%''.\\ {{:doorbench:guide:fields.png|The fields}} **2.** Click **Modules** and press **Use modules in this game**.\\ **3.** Under //Shops// press **Add a shop**. Name ''%%store%%'', title ''%%The store%%''.\\ **4.** Press **Add goods**. Type ''%%Bread%%'', choose //bread// beside it, and make the price to buy ''%%3%%''.\\ {{:doorbench:guide:shop.png|The shop}} **5.** Click **home** on the left. Press **Add a choice**. Key ''%%S%%'', label ''%%Store%%''.\\ **6.** Under that choice press **+ Add a block**, then **Group**, then **Call a function**.\\ {{:doorbench:guide:add-block.png|Adding a block}} **7.** It should say //store//. If not, choose it from the list.\\ {{:doorbench:guide:store-choice.png|The finished choice}} ===== 6. Something to fight ===== **1.** Press **Add...** on the left, then **Table**. Type ''%%beasts%%'' and press Enter. Leave it //fixed//.\\ **2.** Press **Add a field** three times and name them ''%%hp%%'', ''%%attack%%'' and ''%%money%%''. All are numbers.\\ **3.** Press **Add a row** three times and fill them in.\\ ^ name ^ hp ^ attack ^ money ^ | A cave rat | 6 | 2 | 8 | | A bat | 4 | 1 | 5 | | A blind lizard | 12 | 3 | 20 | {{:doorbench:guide:beasts.png|The beasts}} **4.** Go to **Modules**, scroll down to //Fights// and press **Add a fight**. Change the name to ''%%hunt%%''. Type the two formulas below into //They hit// and //Money won//.\\ **5.** Tick **Something that heals can be used**. Then change //How many is in// to **bread**, //Called// to ''%%some bread%%'' and //Heals// to ''%%5%%''.\\ {{:doorbench:guide:fight.png|The fight}} Copy the two formulas exactly: * //They hit//: ''%%f.attack + random(-1, 1)%%'' means the animal's attack, give or take one. ''%%f%%'' is the animal. * //Money won//: ''%%f.money%%'' means the money in the animal's row. **6.** Click **cave**. Add a choice, key ''%%H%%'', label ''%%Hunt%%''. Press its **+ Add a block**, then **Group**, **Call a function**. It should say //hunt//.\\ ===== 7. A step of your own ===== Still in the cave, add a choice: key ''%%L%%'', label ''%%Look around%%''. Then add these blocks: **1.** **+ Add a block**, **Change**, **Spend**. Change ''%%10%%'' to ''%%1%%'', and ''%%player.cash%%'' to ''%%player.turns%%''.\\ **2.** Under //if there was enough// press **+ Add a block**, **Decide**, **By chance**. Change ''%%50%%'' to ''%%30%%''.\\ **3.** Press **+ if not**, **Show**, **Say**. Change the text to ''%%You are too tired today.%%''\\ **4.** Press **+ otherwise**, **Show**, **Say**. Change the text to ''%%Only stones.%%''\\ **5.** Under //then// press **+ Add a block**, **Change**, **Add**. Change ''%%1%%'' to ''%%random(1, 6)%%''. It already says ''%%player.cash%%''.\\ **6.** Below that, still under //then//, press **+ Add a block**, **Show**, **Say**. Change the text to ''%%You find some coins. You have {player.cash}.%%''\\ Curly brackets put a value into text: ''%%{player.cash}%%'' shows how much cash the player has. {{:doorbench:guide:look-around.png|The whole Look around choice}} ===== 8. Play it ===== Press **F5**, then **Play as Ann**, and click the black screen. {{:doorbench:guide:play-home.png|The game starts}} Press **C** for the cave and **H** to hunt. {{:doorbench:guide:play-fight.png|A fight}} * **Play as Bob** lets a second player in, in the same world. * The **Values** on the right can be changed: type a number and press Enter. * **Next day** gives everybody their turns again. * Drag over the screen and press **Ctrl+C** to copy text from it. **Ctrl+V** types what was copied into the game. If something is wrong, it is listed at the bottom of the window. Click it to go there. ===== 9. Make the packages ===== **1.** Click **The game** on the left. Type a **Version** (''%%1.0%%'') and a **Licence**. If you are happy for anybody to copy and change your game, ''%%CC0-1.0%%'' will do.\\ {{:doorbench:guide:the-game.png|The game's details}} **2.** Save with **Ctrl+S**. For your own instructions to players, press **Add...**, **Guide**, call it ''%%player%%'' and write a few lines. You can leave this out: a short PLAYER.TXT is made for you.\\ **3.** Choose **Game**, **Make packages...**\\ {{:doorbench:guide:game-menu.png|The Game menu}} **4.** Tick the systems you want, choose a folder and press **Make them**.\\ {{:doorbench:guide:packages.png|Make packages}} You get one ZIP for each system. Each holds everything: your game (''%%.DBP%%''), the program that runs it (''%%CAVETOWN.EXE%%'' or ''%%cavetown%%''), the maintenance and setup programs, and instructions. Nothing else has to be installed. Keep the files together. The Windows one needs 64-bit Windows. ===== 10. Put it on a BBS ===== Give the sysop the ZIP for **the computer the BBS runs on**. ''%%SYSOP.TXT%%'' inside has these steps too. ==== First, for every system ==== ^ ^ Windows or DOS ^ Linux ^ | Unpack the ZIP into its own folder | for example ''%%C:\BBS\XTRN\CAVETOWN%%'' | for example ''%%/bbs/xtrn/cavetown%%'' | | Let the programs run | not needed | ''%%chmod +x cavetown dbmaint dbsetup daily.sh%%'' | | Set up the game, once | ''%%DBMAINT new%%'' | ''%%./dbmaint new%%'' | | Change the settings, if you like | ''%%DBSETUP%%'' | ''%%./dbsetup%%'' | | Try it without the BBS | ''%%CAVETOWN -l -u YourName%%'' | ''%%./cavetown -l -u YourName%%'' | | Every day, from a timed event | ''%%DAILY.BAT%%'' | ''%%daily.sh%%'' | Type the commands in a command window, in the game's folder. If the try works, the game is fine and only the BBS setting is left. ==== Then, add the door to the BBS ==== These settings are the ones in ''%%SYSOP.TXT%%''. Not all of them have been tried on a live board. ^ BBS ^ What to set ^ | Synchronet, Windows | Command ''%%CAVETOWN.EXE -d %n -n %#%%'', start-up folder ''%%..\xtrn\CAVETOWN%%'', drop file DOOR32.SYS, native program, I/O socket | | Synchronet, Linux | Command ''%%./cavetown -d %f -n %#%%'', start-up folder ''%%../xtrn/cavetown%%'', drop file DOOR.SYS, native program, I/O standard | | Mystic, Windows | Menu command D3, data ''%%C:\DOORS\CAVETOWN\CAVETOWN.EXE -d %P -n %N%%'' | | Mystic, Linux | Menu command D3, data ''%%/path/to/cavetown -d %P -n %N -g /path/to%%'' | | Ironbark (Linux) | In ''%%doors.toml%%'', a door with ''%%kind = "native"%%'', ''%%dir = "cavetown"%%'' and ''%%command = "./cavetown -d %nDOOR.SYS -n %#"%%'' | | DOS | In a batch file: ''%%CD \DOORS\CAVETOWN%%'' then ''%%CAVETOWN.EXE -d C:\BBS\NODE1 -n 1%%'' | On DOS a FOSSIL is used when there is one, and the serial port when there is not. If the game cannot tell which port, add ''%%-p 1%%'' for COM1. ==== A new version later ==== With nobody playing: copy the new files over the old ones and run ''%%DBSETUP update%%'' (Linux ''%%./dbsetup update%%''). Saved games are kept. ===== When something goes wrong ===== ^ What you see ^ What to do ^ | Make packages refuses | Fix the errors listed, and fill in version, author and licence in **The game** | | "nothing leads here" | In Flow, drag a line from another place to it | | Linux says "Permission denied" | Do the ''%%chmod%%'' line above | | Players never get new turns | The daily event is not running | | DOS: the game says it is locked after a crash | ''%%DBMAINT unlock%%'' | | Something looks damaged | ''%%DBMAINT check%%'', then ''%%DBMAINT restore 1%%'' puts back a backup | More: [[doorbench:tutorial|a shorter first game]], the editor, modules, the script language.