The following is a reference for every object that can be placed in a .tmd file and will actually be useful to you. Each subsection is titled with the name of the object, followed by its fields, children, and lists.
Emphasized children indicate that this object expects only one element in that child, and will therefore choose the last added.
Emphasized fields indicate that the field takes a string, otherwise the field is numeric.
Descriptions enclosed in (internal: ) indicate that portion of the object is for internal use, or can be for internal use in some cases, but the object is not entirely internal. The explanations provided for internal descriptions are simply for completeness' sake; they are not likely to be useful for writing plugins or scenarios.
Any fields or children which were not introduced in v0.2 are marked as such.
Actions represent things that happen within the game universe as a result of something, usually a condition( reference) being met or a mission being accepted.
Changes the description of the mission.
Changes the title of the mission.
If non-zero, end the mission.
(internal: whether or not this action was generated on the fly)
Display this message as a pop-up dialog for the player to read
Award the player this amount of money. Negative is fine if you're feeling vengeful.
Set the current stage to this number. For multi-stage missions, you must set this to some non-zero value when the mission is first given, as the onStage field of Condition only works with nonzero values. A zero value (the default) for this has no effect.
Give these frozencargos( reference) to the player.
Spawns the given fleets; only effective if the player is not on a planet. Note that if this fleet is going to be of importance to the mission (i.e. for a kill quest or an escort job) it must be unique to this mission and the player must only have one instance of this mission at a time.
Take these frozencargos away from the player. If the player doesn't have a given cargo, (or does but it's not marked as being mission related) the action is ignored.
This object has no lists.
Addons represent things which can be bought in parts shops; these are either weapons, ammunition for weapons, or enhancements for ships.
The cost of this addon.
The text that will be displayed in the "buy parts" dialog as the description of this addon.
The number of hardpoints required for this addon. Mainly for 'external' addons, like weapons or more cargo room, but not a more efficient engine.
The amount of mass that this addon takes up.
For non-zero numbers, this is the most of this particular addon that a ship can have. An amount of zero means that there is no limit.
The text that will be displayed in the "buy parts" dialog as the name of this addon. Note that this can be different from the weapon's title, if this is a weapon addon.
What kind of addon this is. If type is set to 0, the program will expect a ship enhancement. If it's set to 1, a weapon or ammunition for a weapon will be expected.
The actual item which will be added on. For weapons and ammunition, this is the weapon/ammo object itself. For ship enhancements, this should be a ship object with its attributes modified toward whatever enhancement is desired. The ship being added on to will be 'added' to this ship - all the target's attributes will be changed by the addon's. For example, an addon which would raise the maximum fuel capacity of a ship by 100 would have a ship with its maxFuel field set to 100, and everything else set to zero.
This object has no lists.
This is used to specify a generic kind of cargo - for varying prices, a frozencargo( reference) is required.
The name that appears in the 'trade goods' dialog.
The base price of this cargo - how much, on average, it costs.
This object has no children or lists.
This is used primarily within missions( reference) to lay out a set of conditions which must be met before an action will be taken, or a mission will be made available.
For non-zero values of this entry, more than this many days must have passed for the player since the mission was undertaken.
Player must answer 'yes' to the question in this field
The player must have at least this much free cargo space.
(internal: Whether or not this condition was generated on the fly)
The mission must be on the given stage. Note that this only works for non-zero values.
Just a probability between 0 and 1 (exclusive; since the default is 0, it's treated like a 1) Note that this chance may not be entirely accurate; missions can have their conditions checked more than once in certain conditions.
If all the conditions of this condition are met, perform the given actions( reference) - note this will only happen in the 'conditions' child of missions. Actions associated with prerequisites, for example, will not be taken.
The player must have never undertaken any of the missions on this list.
The player must not be currently undertaking any of the missions on this list.
The player is at any of the given locations. Note that, if the player is on a planet, the location for the purposes of this condition is that planet and not the sector it's in.
All of the given fleets, presumably spawned by an earlier action, must have then been destroyed or driven off.
This object has no lists.
This is used to provide a generic grouping of a number of ships, as well as to give them behaviors
When the player jumps out, there's this much a chance that this fleet will follow.
Upon being hailed, this is the message which will first appear.
The type of fleet. Current types are:
Jumps in, goes to a planet, stops for a bit, then leaves
Jumps in, wanders about aimlessly. These never jump out.
Jumps in, wanders about for a while, jumps out. The duration of its stay is determined by the min/maxStay fields.
For wandering patrols, the maximum amount of time that the fleet will stay in the sector
For wandering patrols, the minimum amount of time that the fleet will stay in the sector
The reaction of this fleet to being attacked. Valid reactions are:
Just go on about our business.
Accelerate as fast as we can, begin jumping out.
If our owner's feelings toward the attacker are <0, we'll attack.
Attack!
If this fleet follows the player, it will only follow if the sector the player is going into is on this list. If the list is empty, however, there are no restrictions on where the fleet will go.
(internal: If this fleet is currently in use by a mission, this will point to it.)
This child holds the ships in the fleet. Note that these should be frozenships( reference)- regular ships are not used because frozenships can hold cargo (which may at some point be capturable), weapons (with which the ships can fight back), or generic addons to provide variety.
The organization ( reference) to which this fleet belongs. This is who will get angry at you if you shoot at this fleet.
This object has no lists.
A frozencargo is a specific instance of cargo - i.e. one for sale on a specific planet or one on board your ship.
This is the change to the base price that this specific cargo should be. -50 would mean that the cargo is selling for 50 less than the base price, while 50 would mean 50 credits more. (internal:In saved games, this price is the average price that the player purchased the cargo for)
This indicates how much of this cargo the ship assigned to it has. Only useful if this object is getting assigned to a ship.
This indicates that this cargo is mission related. Players can't sell mission related cargo, nor does the price matter. Set to 1 for cargo you're using on missions.
The cargo( reference) that this is an instance of.
This object has no lists.
A frozenship is a specific instance of a ship. This is mostly internal, but is used by planet( reference), gamestate( reference), and fleet( reference).
(internal: The current angle of the ship, where 0 = directly up)
(internal: whether or not this ship has been boarded before)
(internal: current computer integrity)
The amount that this ship costs. Required for planet usage.
(internal: current engine integrity)
The amount of fuel aboard this ship. Required for gamestate and planet usage; be sure to gas ships up before giving them to the player!
(internal: The current hull integrity)
(internal: current navigation integrity)
(internal: The current shield level.)
(internal: The current speed of the ship along the X-axis)
(internal: The current speed of the ship along the Y-axis)
The name that will be displayed in the user's targeting box when this ship is targeted. This is the only required field for fleet( reference) usage.
(internal: current weapons integrity)
The current x-location of the ship. Required for gamestate usage; the initial location of the player.
The current y-location of the ship. Required for gamestate usage; the initial location of the player
The kind of ship( reference) that this frozenship is an instance of.
Any cargo that the ship is carrying. Note that these are frozencargo( reference)s, so be sure to set the amount and price of anything you put here.
Any addons ( reference) this ship has.
(internal: The fleet that this ship belongs to)
This object has no lists.
The gamestate object is bootstrapping information for the entire system. There should only be one; it indicates where the game should begin (internal: In saved games, it indicates where the player left off - most these entries are applicable to saved games as well).
The current day upon the start of the game.
(internal: The name of the player.)
The amount of money the player has.
The player's ship; a frozenship( reference).
The sector( reference) that the player is in.
(internal: Every other ship in the player's sector)
A hudstates( reference) object indicating the default HUD configuration.
The map( reference) of the universe that we'll be using.
(internal: The player's current missions( reference))
(internal: The player's chosen options( reference))
Every organization( reference) in the game.
Which of those organizations is the one the player belongs to
This object has no lists.
These are used on startup and internally in saved games to keep track of the status of the various HUD boxes.
Whether or not the console is visible
Whether or not the navigation box is visible.
Whether or not the radar is visible
Whether or not the status box is visible
Whether or not targeting information is visible.
Whether or not system (engines, weapons, nav, etc.) information is displayed in the status box. Unlike the other settings, this is not changeable by the player, and is in place for backwards compatability and any scenario which either does not want to deal with systems or likes to keep the player guessing. [New in 0.9]
This object has no children or lists.
This is a bitmapped image.
The filename of this image. Note that this is not the path; TraderMissions will search along the paths given in the options for the filename, and use the last one it finds. The image itself can be in any format that the SDL_Image library supports. Any magenta (R: 255, G: 0, B: 255) pixels will be regarded as transparent.
This object has no children or lists.
This indicates every sector in the universe. Not every sector defined must be in this list, but every sector you want the player to be able to reach should be.
(internal: Because the game doesn't require you to set a planet's ( reference) "parent" child, it must generate it itself. Since, in future versions of the TM engine, a planet's parent may change, this flag is set to indicate that the parents are still valid. Any actions which change a planet's parent should reset this flag.) If you are setting the 'parent' child of the sectors yourself, set this field to '1'.
Every sector the game knows about. If you put a sector in another sector's 'links' child, but not in this list, strange things will happen. Try it out!
This object has no fields or lists.
Missions are half of what makes up TraderMissions. They represent tasks for the player to undertake, whether voluntary or not. (Note: due to the way that actions are processed, any list of actions that includes an 'end mission' action will be completely processed regardless of whether other actions follow the 'end mission' action or not)
A mission, when created, goes through a step called 'solidification'. During this step, any randomization required is done, and the longdesc and title fields go through substitution processes. Tags that will be substituted are as follows:
The amount of random cargo.
The name of the cargo chosen.
The destination chosen at random
The number of days the player has to complete the random destination mission
Note that substitutions will not take place for inappropriate tags. For instance, if the mission has a random destination but not random cargo, ^AMOUNT will remain untouched.
(internal: The day on which this mission was assigned)
A longer description of this mission. Shown in the same places as the title, but with more detail.
Minimum amount of cargo to assign for this mission. Note that an amount of zero for this field indicates that this mission does not have random cargo
The maximum amount of cargo to assign for this mission. If you want a fixed amount of cargo, set this to a number less than or equal to randomCargoMin.
Minumum number of jumps that any random destination mission must include. Zero is perfectly fine, if you don't care that you might get missions to the same planet you're on. Just ensure that this isn't so restrictive that no locations match the criteria, otherwise the game will freeze up.
If non-zero, this indicates that the random destination mission also has a time limit on it. The amount of time allowed will be sectors*(shipDaysPerSector+randomTimePadding)
(internal: What stage the mission is on)
(internal: Whether or not this mission has ever been taken)
A short description of this mission. It will be displayed on the mission job board and the 'missions' panel of the information dialog.
Conditions that will be checked as the mission goes on. Currently checked upon entry to a sector and upon landing on a planet. If any are true, their associated actions are performed.
(internal: When the player accepts a (non job-board) mission, or it is created for the job board, this mission is cloned. Some elements are filled in (i.e., if this is a random mission, values are generated) and it then becomes the player's responsibility. This child points to the original mission.)
The actions to take once the player accepts or is given the mission.
The conditions that the player must satisfy before getting this mission
One of the items in this list will be chosen at random to be the cargo. If this is empty or randomCargoMin is less than or equal to zero, this is not a mission involving random cargo. Note that ordinary cargo( reference) objects should be used here, not frozencargo( reference).
One of the locations in this list will be chosen at random to be the destination. If this is empty, this is not a mission with a random destination
(internal: Fleets created by actions are listed here, unless they're dead, in which case they're moved to the spawnsDead list)
(internal: If an action creates a fleet, and that fleet is later destroyed (or jumps out), it will be added to this list.)
The organization(s) which are sponsoring this mission.
An action( reference) to take place if a random destination mission times out.
This object has no lists.
An organization is like a government, corporation, or the player. Essentially, it's anything that you want to be able to own ships and sectors.
hitPenalty is multiplied by this if our attitude toward the attacker is positive. This is to prevent accidental fire from ruining attitudes.
If this organization's feelings toward you are below this cutoff, they will not give you fuel if you ask.
When an allied/enemy organization reports that it is changing its feelings toward another organization, this is the extent to which we change our feelings toward the other organization.
If this organization's feelings toward you are below this cutoff, they won't help you if you're under attack.
If this organization's feelings toward you are above this cutoff, they'll help you when you ask even if they're currently busy.
If a ship we own has been hit by a weapon, this is the base amount by which our attitude toward that weapon's owner goes down.
If our attitude toward another organization is below this threshold, and we spot one of their ships in the same sector as us, we react as though we've been shot at.
The message to display when we've agreed to give the player fuel.
The message to display when we've agreed to help the poor besieged player
If this organization's feelings toward you are below this cutoff, they'll ban you from landing on their planets.
The message to display when a ship of this organization rejects the player's plea for help/fuel/whatever
If this organization's feelings toward you are below this cutoff, they won't even answer your hails.
The name of this organization as it will appear to the player.
Those organizations considered by this organization to be its allies. Friendly fire by allied organizations is ignored for reputation purposes. Any event which raises an organization's standing with this organization will also raise its standing with its allies. The same holds for events which lower attitude.
Those organizations considered to be enemies of this organization. Essentially the opposite of allies; any event which raises an organization's standing with this one will lower its standing with its enemies.
Our attitude toward every other organization. This list must be as long and in the same order as the list of organizations in gamestate( reference)
Planets are landable objects within a sector.
A more verbose description of the planet
The name of this planet as it appears when you land on it.
The x-location of this planet within a sector.
The y-locatio of this planet within a sector
The minimum distance you must be from this planet to land upon it.
If non-zero, this planet cannot refuel the player. [New in 0.9]
The image ( reference) representing the planet.
Missions( reference) possibly available on the job board for this planet. 'Job board' button will appear if this is non-empty, even if player is not qualified for any of the missions.
(internal: The sector( reference) that this planet is in. This is generated on the fly whenever it's needed.) You do not need to set this, but you can if you want missions that have random destinations to be processed faster.
frozencargo( reference) for sale on this planet.
frozenships( reference) available for sale.
These are Missions that do not appear on the job board for this planet, but which are automatically given to the player provided the prerequisites are met.
An optional image that will be shown in the background of the planet upon landing. [New in 0.9.0]
addons( reference) available on this planet.
This object has no lists.
A sector is the basic area of space. Sectors can have zero or more planets within them, and can also have links to other sectors.
Every second, there this chance that we'll re-examine the fleets child and possibly choose another to jump in.
Detailed information about the sector, will be shown alongside the map when this sector is selected.
The x-location of this sector on the map
The y-location of this sector on the map
The name of this sector, as shown on the map and navigation HUD.
(internal: Whether or not this sector has been visited.) Set to 1.0 for sectors you want visible on the map (i.e. not labeled as "Unknown") upon the start of the game. The sector the game starts in will automatically be made visble.
Every possible fleet( reference) that can be in this sector. Their chances of appearing are defined in the 'fleetChance' list.
Other sectors that the player can jump to from this one
The organization( reference) that owns this sector.
planets( reference) in this sector.
These are missions( reference) which will automatically be given to the player upon arrival in the sector (either from another sector, or from a planet), provided the conditions are met.
When the sector is first created, and every second thereafter, the game checks this list to see what, if anything, should jump into the sector. Each child of 'fleets' has a corresponding entry in the fleetChance list (therefore, they should be in the same order) which is the chance that it will jump in. The only caveat is for chances of exactly 1.0 -- the fleet will be in the sector at the beginning, but no more will ever jump in. This is useful for patrolling-type fleets, which never jump out.
Ships are those things you fly around in space.
The acceleration of this ship, in pixels per second squared.
The number of degrees this ship can turn in one second
The maximum units of cargo that this ship can hold.
The number of hardpoints on this ship.
The distance (in pixels) that the ship will arrive from the center of the destination sector's center.
The amount of time (in seconds) that the player must hold down the 'jump' key in order to jump.
The amount of mass this ship has for addons.
Integrity of computer systems. If zero, targeting and HUD is disabled when shields are disabled. [New in 0.9]
Engine shielding integrity. If zero, engines are disabled when shields are disabled [New in 0.9]
The maximum amount of fuel that this ship can carry. One jump requires 100 fuel.
Hull integrity of the ship. If zero, the ship is destroyed when shields are diabled.[New in 0.9]
Integrity of navigation system. If zero, ability to jump is disabled when shields are disabled [New in 0.9]
This is the delay between the firing of each primary weapon. (To prevent them from clumping up on the screen when fired, there is a small delay)
The maximum speed, in pixels/second, that this ship can attain.
Weapons system integrity. If zero, weapons are disabled when shields are disabled. [New in 0.9]
The amount of shielding that this ship will regenerate in one second.
The maximum amount of shielding on this ship.
The name of this type of ship.
The number of days that a jump in this vessel will increment the global "current day" counter by.
A specially-formatted image( reference). The image is six times the ship's width by six times the ship's height. In each shipWidth x shipHeight 'cell', there is an image of the ship at a certain angle (where the angle is increased 10 degrees for each cell, starting with 0 degrees in the upper left, 50 in the upper right, and 350 in the lower right).
This object has no lists.
The test object was created to test the parser and repository. It is included in this reference for practice purposes; those unfamiliar with writing TMD code can use test objects with no worries.
A string.
A numeric field.
A child.
And its brother.
A list.
A weapon is used to shoot at other ships. If this is a secondary weapon with ammo, the only required portions are the primary, isAmmo, rof, and title fields. If this is ammo, fill out everything as normal except for rof and title
If a seeking weapon, the amount of acceleration it has, in pixels per second squared.
The number of degrees this weapon can turn in one second
The amount of damage this weapon does upon impact.
Whether or not this is ammunition for a weapon.
Whether or not this is a primary weapon. Primary weapons are fired all at once (more or less) while secondary weapons must be selected and can only be fired one at a time. Secondary weapons may also have ammunition. If this is ammunition for a secondary weapon, it counts as a secondary weapon.
The rate of fire of this weapon; the minimum number of seconds between shots.
One of the following flags:
The weapon does not seek. (it's a 'dumbfire' weapon)
The weapon will seek in the same manner that ships do (i.e. has to turn, accelerate, etc)
The title of this weapon. If this is a secondary weapon, this is the name that will appear on the HUD. Otherwise, this name will not be used.
Whether or not this is a 'turreted' weapon - turreted weapons start aimed at their target.
The top speed of this weapon - Note that non-seeking (and some seeking) weapons always travel at their top speed.
The time-to-live of this weapon; the number of seconds after it is fired that it will vanish.
The ammunition that this weapon requires, if any. Only secondary weapons may require ammunition.
The image( reference) of the projectile that this weapon shoots. It is in the same format as the ship( reference) image.
This object has no lists.