Table of Contents
15/10/2012 4:00:28 PM
Turn Display XML
Setup
- Unzip the files and make sure you preserve the directory structure
- Directory structure:
- crews - where you store the crew list. Each list of crewmembers needs a unique name.
- setup - blank files, backups in case you want to start from the beginning again.
- ships - where you store your ships. Each ship needs a unique name.
- turns - where you store your turns. Each turn should have a unique name, but it doesn't need to follow any particular naming scheme.
- xsl - this is where all the processing happens, the XSL and CSS files are here - don't change anything unless you're familiar with who XML and CSS works.
- Upload all these files, with the directory structure to your website.
Creating your Campaign
First thing you need to do before you start issuing turn reports to your players, is to setup the ship they are in (and optionally any ships they may board) and the list of who is in their crew.
Creating Ships
In the \ships\ directory create a new file and give it a unique name with the extension “.xml”. This file must be text, must be lowercase, and must not contain any spaces or punctuation in its name. You need to enter information between the tags.
An empty ship file
<?xml version="1.0" encoding="UTF-8"?> <ship> <name></name> <registry></registry> <size></size> <map> <type></type> <orientation></orientation> <enhancement></enhancement> <location> <x></x> <y></y> </location> </map> </ship>
- name can be any name at all
- registry can be any race
- size should be from 5 to 10
- map you will need to create a map for each module on the ship
- type legitimate module types (currently) are: cargo, cannon, engine, helm, hyperdrive, life support, missile bay, science bay, teleporter, tractor, fighter bay, mine layer, damage control and sick bay — Note: you will need to enter the type as I've written it here, in lowercase.
- orientation can be one of four compass directions - north, east, south or west.
- enhancement can either be upgraded or it can contain items for the cargo bay. The three states for enhancement are with nothing inside the tag, with the word upgraded inside the tag or with item tags—
<item location="topleft">EAME</item>
- An item tag can have one of only for location attributes - topleft, topright, bottomleft or bottomright. The text inside the tag can be anything you like
- location consists of an X and a Y co-ordinate that should be in the range of 4 to 10. Note that XML isn't a “do this processing then do that processing” linear language, so you don't have to put the modules of the ship in any particular order. You could list all the combat modules first, or all the upgraded modules, whatever you like.
Creating Crew Lists
In the \crews\ directory create a new file and give it a unique name with the extension .xml“. This file must be text, must be lowercase, and must not contain any spaces or punctuation in its name.” You need to enter information between the tags.
An empty crewlist file
<?xml version="1.0" encoding="UTF-8"?> <crew> <crewmember> <image></image> <name></name> <race></race> <class></class> <player></player> </crewmember> </crew>
- crewmember you will need to create one set of crewmember tags for each member of the crew
- image an URL to where the crew member's image is located. These get resized to 200px widths in the display.
- name can be anything - but it should be unique
- race can be anything
- class can be one of the following types- marine, combat, science, scientist, pilot, engineer, diplomat, psionic
- player can be anything
Writing a Turn File
Now that you've made those two files, you can make as many turn files as you like. They should all be stored in your \turns\ directory. This file must be text, and must not contain any spaces or punctuation in its name.
An empty crewlist file
<?xml version=1.0" encoding="UTF-8"?>" <turn> <number></number> <playership> <name></name> </playership> <playercrew> <crewlist></crewlist> <character> <name></name> <location> <x></x> <y></y> </location> </character> </playercrew> </turn>
- number should be a unique number, but could be anything you like. It gets displayed in the title of the page and the box in the top middle.
- playership you will need to put in the name of the ship to display in the name tag. This should be the same name as the file you created for the ship, but with the extension. Otherwise you'll get an error.
- playercrew this is where you list where each character is.
- crewlist this is the name of the crewlist file you created previously. Again - if it isn't the same or the file doesn't exist you'll get an error. Don't use the extension here either.
- character you should create these tags for each character you want to show on the ship.
- name the name of the character - it should match the name in the crewlist file.
- location consists of an X and a Y co-ordinate. Note that the system I've used is for the module location to be in the “tens” and the square inside the module to be in the “digits”. So a module located at 7,8 would consist of squares in the X axis of 71-75 and in the Y axis of 81-85.
And you're done.
Have fun.
Make sure to direct your players to the correct turn XML file.