Build your own RPG Game

Documentation Home > Making Map Data with Textpad

About Map Data
Building Data
Container Data
Item Data
Trap Data
Monster Data
Player Data
Inventory Data
Uploading Game Data Files

This section talks about textual map data like buildings, containers, items, traps, monsters and player files (both inventory and their player data).

You can make these files and edit them in Textpad. The files system is quite simple with one item per line of a text file.
Top


Building Data

Building data lives in the data/buildings folder. A building data file is made up of up to 7 lines. I'll explain each of them below in the table. Some are required and some are optional.

Name Description
Building Description This description can be as long as you like. It all has to be on one line, so no hitting the enter key until you want to move onto writing the container name. You can insert the HTML tag <P> to make a paragraph break. HTML code is allowed here.
Container Name The name of your container. This name must exactly match the text file name in the containers folder - without the underscores and .txt. Example: Olga's Dresser goes here and the container text file is called Olga's_Dresser.txt - this value is optional, you can leave it out if you want.
Locked/Unlocked The values here can be 0 or 1, where 0 is unlocked and 1 is locked. - this value is optional, you can leave it out if you want.
Trap Name The name of your traps. This name must exactly match the text file name in the traps folder - without the underscores and .txt. Example: Massive Flame Burst goes here and the trap text file is called Massive_Flame_Burst.txt - this value is optional, you can leave it out if you want.
Item Found Name The name of your item. This name must exactly match the text file name in the containers folder - without the underscores and .txt. Example: Olga's Dresser goes here and the container text file is called Olga's_Dresser.txt - this value is optional, you can leave it out if you want.
Monster Name Sorry to day but monsters aren't implemented in the game. I was going to make the code, but I'd like to let you give that a try. I started the code in the buildings.php file, so feel free to have a look. The monster name would go here just like a container or a trap name. This value is optional.
Building Type Right now there is only a vendor type implemented.

Top


Container Data

Container data is pretty simple, it's just one line of description. This description can be as long as you like. It all has to be on one line, so no hitting the enter key until you're done. You can insert the HTML tag <P> to make a paragraph break. HTML code is allowed here. Container can be easily reused - just add their name to a building.
Top


Item Data

Item data is pretty simple, it's just one line of description, and a cost for selling the item to a vendor. This description can be as long as you like. It all has to be on one line, so no hitting the enter key until you're done. You can insert the HTML tag <P> to make a paragraph break. HTML code is allowed here. The cost needs to be a whole number (1,2,3,4...35,99,1500 etc)

Item Images

All item text files and images live in the data/items folder. All items must have an image. Here's a link to download 190+ already transparent images for items, weapons etc. Items can be reused, just add them to any building.

Item images must be the exact same name as the text file. Example: Iron Lock Pick text file will be Iron_Lock_Pick.txt and the image will be Iron_Lock_Pick.gif.

I prefer GIF files because the can be transparent and have a smaller file size than JPEGs, but the choice is yours. If you want to use both - don't - please choose one or the other. If you want to use JPEGs you'll need to update the preferredExtension in the setup file.

Here's a link to make transparent GIF files. Learn more about making transparencies in the Charas Tutorial.
Top


Trap Data

All trap text files live in the data/traps folder. Traps are optional, but very cool! Traps have 6 data values for them. The table below will explain. Traps can damage one, some or all player stats - just fill in a value. There was a 7th value for XP (experience) but I'll let you code for that :) Traps can be reused, just add them to any building.

Name Description
Trap Description This description can be as long as you like. It all has to be on one line, so no hitting the enter key until you want to move onto writing the damage health value on the next line. You can insert the HTML tag <P> to make a paragraph break. HTML code is allowed here.
Damage Health A number value (5,10,50 etc). I recommend having atleast one damage value - otherwise what good is the trap?
Damage Fatigue A number value (5,10,50 etc). (optional)
Damage Strength A number value (5,10,50 etc). (optional)
Damage Mind A number value (5,10,50 etc). (optional)
Damage Luck A number value (5,10,50 etc). (optional)

Top


Monster Data

I started making monster code and decided to leave it up to you. Monsters in my opinion have the same make up as a trap (description, dmg stats) and they will have a XP and gold value too (so the player earns something for killing them). Have fun coding for monsters! Send me an email!

Here's a link to a ZIP (1,655 kb) file of 300+ monster avatars. Just make them transparent if you can.
Top


Player Data

I'll explain what makes up a player data file - even though you'll never ever make one. The PHP scripts generate this file when you first make a character. The file is updated when things happen to your character like selling items, taking damage, entering building doormats or changing maps.

Name Description
Access Code A code (password) that will allow you to login and play
Player Name Your characters name
Player Chara File name for the player chara (image)
Health Health value, a number
Fatigue Fatigue value, a number
Strength Strength value, a number
Mind Mind value, a number
Luck Luck value, a number
Money Player money, a number
Map ID The is the prefix number of the lower or upper map file for the current map
X Coordinate Your current X position on the map
Y Coordinate Your current Y position on the map
Current Building The building you are about to enter or last entered

It's good to have an understanding of what a player file consists of so you can further develop the game engine.
Top


Inventory Data

Much like a player file, the inventory file is created automatically when you make a character. It has an identical name to the player file, and lives in the data/inventory.

This file will have item names, one per line. I've noticed that when you sell items, sometimes blank lines are left over. These lines are ignored by the inventory and vendor code - so it's ok.
Top


Uploading Game Data Files

Start up WSFTP and upload your data files to your data folder, to the desired folder, and make sure you're putting the files up in ASCII mode.

Test out your data files by playing your game.
Top


Visit www.createorconquer.com