Items

Things you put in your cargo bay, or install in a ship

Items are things ships can discover on planets, and pick up either to use, or just to value as "treasure". They all need entries in the gamedata/items folder.

Item types (and scoring)

Items have a file name structure, that is basically "prefix_itemname.ini". The prefix is chosen from this list:

Source: !item_files.txt
dr_ : star drive
dv_ : device
fb_ : fighterbay
it_ : non-functional item (plain loot)
lf_ : lifeform
sy_ : ship system (anything in a round slot)
th_ : thruster
wp_ : weapon
ps_ : passenger

It's not immediately clear from the documentation just how important those prefixes are. Some experimentation has shown that, at least for some item types, having the wrong prefix doesn't seem to cause any problems.

Items fall into three broad scoring categories:

These categories are used primarily for scoring purposes. However, most mercenaries won't accept lifeforms as payment, so scoring isn't the only difference. Which category the item falls into is a function of two entries in the file, both the FLAG entry and the COST entry. The former dictates whether mercenaries accept it, the later determines which scoring category it ends up in.


Codes and commands in items

The following commands and codes appear in the .ini files for items.

Nested / second-level entries on that list are flags or values that follow the first-level code before them. For example, you might have a line that reads "TYPE weapon", but you wouldn't have a line that just says "TYPE" or just says "weapon".

Things in bold are ones all main-game items have in common. It's highly likely you'll need them in your items' .ini file in order for it to function properly.3


Generating Items

Items are placed at the start of the game by several methods:

Random items, placed automatically

  • Items are randomly scattered amongst planets automatically.
    • The FLAGs and KEYS lines of the item determine whether or not it can spawn this way. Only one copy of each item will be placed this way, and no two items with the same KEYS will be generated.
    • The DIST line of the item determines what sort of planets it can show up at, which can impact how frequently the item shows up in the game.

Klakar items

  • Items automatically appear in the Klakar Trade Emporium.
    • It's clear that FLAGs and KEYS affect whether or not they can appear in this way, as above.
    • However, it seems likely that DIST does not influence it.
    • See also: Klakar and trader.

Quests and the ITEM and ITMS codes

  • Items can be generated by Quests as well, using the ITMS or ITEM code.
    • In this case, DIST is ignored completely, and FLAGs and KEYS can be over-ridden.
    • See also: Quests and STAR.

The ITEMS section of game.ini

In game.ini, there is a list of all the items that will appear in your mod. The list itself is in the "ITEMS" section, between "HULLS" and "RACES" in roughly the middle of the game.ini file.

  • In order for an item to exist in the mod, it must be on that list.
    • If it is not on the list, the item will not generate randomly.
    • The game may crash if a quest tries to generate an item that is not on the list.
    • If an item that is not on the list is mentioned in a SHIP block in a (race).ini file, it will not generate. Instead that slot of the ship will be empty.
  • Everything on that list must either be in the main game, or appear in the gamedata/items folder.
    • If the game tries to generate an item whose (item).ini files are not in either location, it will crash.
  • The list is of file names, without the ".ini" extension.
    • It is not a list of NAME entries from the files, and putting a NAME entry on that list will probably result in a crash.
    • Typos of any sort in game.ini will generally crash the mod. Be careful and meticulous.
  • The list is organized by the item type prefix, and then not completely alphabetically after that. It's unclear whether or not this order is important at all, so I generally always add my new items to the end of the prefix section.
    • If you've encountered crashes, randomness failure, or other weirdness due to reorganizing this list, please post your experiences here to benefit others.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License