Documentation Home > Getting Started - Installing the Demo Game
Getting Started, Read me first!
Getting Web hosting
Setting up WSFTP
Setting up Textpad
Configuring Game Setup file
File Permissions (chmod)
Test it out
Possible Problems
Getting Started, Read me first!
I recommend you do these few things before you create a web hosting account.
In order to build for this game all you need to know is how to type on a keyboard, use Textpad to edit and create text files, use WSFTP to upload and download text files and images to a web server - and eventually some PHP to enhance the game.
Good Luck! I wish you well - send me an email when you've got your game world built and maybe I can offer some suggestions!
- Rob (Eliia)
Getting Web hosting
I signed up a free web hosting account with http://www.hostsnake.com. The say they have no banner ads and support PHP, so I gave them a try. The sign up process was easy enough.
I gave some basic info and get a confirmation email. All the login info comes in the email.
FTP Server : eliia.hostsnake.com
FTP Login : your username
FTP Password: your password
So far, so good. Now I have a web hosting account that supports PHP. Make sure you try uploading demorpg3.jar and see if the server can accept it. Now I can move onto the next step, start up WSFTP and enter the information.
Lots of FREE PHP hosting options - http://www.0php.com/free_PHP_hosting.php
Setting up WSFTP
WSFTP is a program that allows you to upload and download files from a web server. To set up WSFTP, unzip the zip file to get at the wsftple.exe file. Double click the file to run it. When you install it select Student and work from home - this will let you use the program for free (I think). Once you've installed the program double click the icon on your desktop to run it.
Here's a couple tweaking tips for WSTFP.
Binary is used for images, PDF, Word docs etc - basically anything not a text file.
ASCII is used for text files, and Perl files if you ever do Perl. Transferring a text file in Binary can make all the newline character disappear and then your code will be all on one line!
Auto is a safe way that if you aren't sure what type to upload as. Check this box if you're not sure.
WSFTP has a cool setting that allows you to specify a list of file extensions (.txt,.php etc) to always be uploading in ASCII. To set this list, click the Options button, Extensions tab, and enter your extensions in the list and click the Add button.
So, take the FTP connection info you just got and let's fire up WSFTP and create a FTP connection to your web account.
Remember your FTP username and password are case sensitive, so if your username is Eliia - typing 'ellia' won't work.
Here's a screenshot of where I put the details
Be sure to check the password checkbox.
Here's what WSFTP looks like once you've connected to the web server. The screen is split into two sections. The left section is your computer's files, and the right section is what's on the web server. There's two square arrow buttons in the middle to allow you to transfer files both directions. See at the bottom, ASCII, Binary and Auto - check Auto.
First thing to check out - make sure you can upload the demorpg3.jar file - if not, move on and try another free PHP web hosting company. I had to try a few. The company I'm using in this tutorial let me upload the jar file (at the time this tutorial was written).
Next you want to make your game folder, mine is called simplerpg. Then transfer all the game files into this folder you just made.
Click on each folder and transfer it across. Shoutbox (the chat system) is pretty bloated (has lots of icons and stuff). I've had problems sending it across and it's taken me a few tries - sometimes I have to upload each folder at a time inside the smilies folder... Just make sure all the orange ones upload - that's the default theme in the Shoutbox configuration file.
Once you've moved all your files over, we need to do a few more things before we're ready to test out the Demo game. Great work if you've gotten this far without a problem!
Top
Setting up Textpad
Textpad is my most favorite text editor program. It's so good I recommend that you buy it if you have the chance. You can buy it from their web site www.textpad.com.
Download Textpad and install it. You can use it for free, but it has this lil pop up reminder every once in a while. I check the show tips checkbox OFF! Then I click Configure in the menu, select Preferences and under View I check off Line Numbers. This will help when I explain stuff later about data files for the game. While you have Preferences open, click on Document Classes and make sure PHP is showing. This means PHP code will have syntax highlighting when you view it in Textpad.
You should be able to right click on setup.php and open it with Textpad. When I right click setup.php I select Open With, Choose Program, Textpad, Always use the selected program..., and click OK. So from now on you can double click PHP files and they will open in Textpad. I know, I'm genius :)
If you've gotten this far without problems, keep on going to the next step.
Top
Configuring Setup file
So you have setup.php open in Textpad, now we need to edit some settings to make the demo work for you. I'll describe all the settings here, but ones in red are the bare essentials to get the game demo to run on your web server.
There are two types of settings in the setup file - settings you should edit, and ones you shouldn't. You'll want to replace most of the setup file values. The ones in red need to be replaced.
| Setting | Description |
| SCRIPT_FILENAME | This is a value that you need to get by going to your info.php file in your web browser. Example: my info file lives at http://simplerpg.freehostia.com/simplerpg/info.php. When you can see your info.php file in your web browser, it's going to have a whole lot of settings - look for one called SCRIPT_FILENAME. You'll see a line like /home/www/simplerpg.freehostia.com/simplerpg/info.php, remove the simplerpg/info.php from this line. Replace the value in the setup file. |
| URL | This is your web address. For example, mine is: http://simplerpg.freehostia.com/simplerpg |
| gameFolderName | This is the folder your game lives in. My example lives in /simplerpg as a folder. You can rename the simplerpg folder to be whatever you like, just change the name in the value too. |
| siteURL | This is a combination of your URL and your gameFolderName values. |
| startingMap | This is the number at the beginning of your starting map file. If you look in v2/maps folder you'll see my starting map is called 1_lower.txt and 1_upper.txt - this is where the 1 comes from. If you make a new map and name it differently, change this number to your number. |
| startingXCoord | This is one of two coordinates (X,Y) needed by the Java applet to know where to place your player when they start. |
| startingYCoord | This is the 2nd coordinate for your player's starting position |
| startingHealth | This is the amount of health the player will start with. |
| startingFatigue | This is the amount of fatigue the player will start with. |
| startingStrength | This is the amount of strength the player will start with. |
| startingMind | This is the amount of mind the player will start with. |
| startingLuck | This is the amount of luck the player will start with. |
| startingGold | This is the amount of money the player will start with. |
| startingBuilding | This is the name of the building your player will start at. If you look in data/buildings you'll see the data file. |
| currencyType | The name of the money used in your world |
| currencyAbbreviation | The short form version of your currency type |
| preferredExtension | I like to use GIf file because I can make them transparent and they will fit nicer in the game. Read the comment in the setup file about this. |
| invCellWidth | This is a number used by the inventory screen to make the items in the player's inventory display nicely spaced apart |
| viewIcon | The image name of the view building icon. I put this here so you wouldn't have to go into the PHP code to change the image. |
| chatIcon | The image name of the chat bubble icon. I put this here so you wouldn't have to go into the PHP code to change the image. |
| helpIcon | The image name of the game guide icon. I put this here so you wouldn't have to go into the PHP code to change the image. |
| lockPickItem | This is the name of the item in your game that can pick locks. If you look in the data/items folder you'll see the text file and GIF image for this item. |
| trapProbeItem | This is the name of the item in your game that can probe for traps. If you look in the data/items folder you'll see the text file and GIF image for this item. |
| startingInventory | These are the items that a player starts with when they begin the game. You can make the player's starting inventory anything you want, you just have to create the item text files and image files in the data/items folder. |
| maxVendorRows | This value tell the vendor screen how many items to display across before making a new row if inventory items for sale. |
| Variables you shouldn't edit | The game depends heavily on these values and unless you know what you're doing - I wouldn't edit them if I were you! |