Hey there,
because of a special request I'll translate the tutorial for adding new items and upgrades
In case you want to add a simple new item for production (so no raw material but a normal product) the work is quite easy.
Step 1: open DB/Items.dbt with an editor of your choice (I use the windows editor for dbt-files)
Example:
I will explain what every number means.
id : 23
This number is the ID, the identification number of the item. As all IDs it has to be unique. For your own item, take a number between 1 and 999 but choose a number that has not been taken already You can use the ID for functions like "AddItems("", 23, 1, INVENTORY_STD)" but I recommand using the actual name for better reading. Some function though need the ID and only work with them.
name: "Wheatbread"
The name should be unique aswell obviously. Also the Name is important for the text.dbt because you will need to add Entries based on your chosen name (see below).
type: 3
I'm not completely sure about the importance of every type. 8 is important, because it means you need a actual source where the item can be gathered, so it does need an entry in GuildResource.dbt. 6 and 4 are not traded at the market and have no sell or buy price, normally you never should use that. Most time you will use 1,2,3 and 5. Items with 3 will be bought by the hardcoded market AI depending on the datatype.
List of all types:
-- ITEM_TYPE_RESOURCE = 1,
-- ITEM_TYPE_INTERSTAGEPRODUCT = 2,
-- ITEM_TYPE_NEED = 3,
-- ITEM_TYPE_SUPPLY = 4,
-- ITEM_TYPE_ARTIFACT = 5,
-- ITEM_TYPE_ANIMAL = 6,
-- ITEM_TYPE_PRODBYMEASURE = 7,
-- ITEM_TYPE_GATHERING= 8,
-- ITEM_TYPE_QUESTITEM = 9
datatype: 4
Also not completely sure about this, but if you look at the different items you can see that 4 is "food", 5 "alcoholic drinks" and 10 seem to be "artifacts". There seems to be some hardcoded selling/buying if you have a need-type, but other than that, I can't see any real use of this.
weight: 3
Every inventory slot (not counting workshops) has a weight of 10, meaning you can store 3 items with weight 3 of the same kind in that slot. Normally artifacts have 3 or 10 and every kind of raw material has 1 but you can do as you want. Obviously it might be imbalanced if you can carry 10 high-level items in one slot ...
Datavalue: 2
You can keep this slot at 0 if you don't have a weapon or a need item. It looks like it does influence how important a item is to fulfill a need when automaticly bought from the market, but at this point this is pure speculation from me.
Buildtime: 2
This is THE most important number to influence the base price of an item. Every item has the same value, but high level items will take more time to make (unless you boost your productivity). Whenever you want to have a high buildcount, you should consider raising the buildtime to at least 2 or higher because you will lose value otherwise. Also always consider the ingredients of your product - if it has expensive raw materials, you should raise the build time to make working on the item cost effective. In my experience it's a good idea to limit raw materials as much as possible and instead raise buildtime or lower build count to raise the price.
Buildcount: 2
How many items you will get after the work is complete. While it is nice to have multiple items quickly, every point will cut the value of a single unit by a significant amount.
In case you wonder, the base price formular is this: math.floor((58.3*buildtime + baseprice*count of every raw material)/buildcount)
costmodifier: 1
You should always use 1 or 2. the cost modifier influences how strong/weak the actual buy- and sellprice will sink/raise when the market-stock of the items changes. So a high value means it will barely change and be around base price while 1 means that every bought/sold item can make a difference to the price. In my experience the gameplay works best with huge price changes based on stock. The only item-type I can think off where you maybe want a more stable price is for ressources - but that will also mean that it will be really hard to get a "green" buy/sell-price for ressources.
substlevel: 2
What social rank have the buyers for that item? I'm not sure if this has an actual impact in the game, but it does show "For rich/poor people" in the tooltip so it's something you should consider.
1 - desperately poor, 5 filthy rich
Fixedprice: 0
if this is NOT 0 you will have always the same price for buying/selling. Never use this for production items because it will break the AI production. You can use this for special event items, like church bells, but normally you should not change this.
Category: 2
Choose the section of the market where this item will appear (1 = raw material, 6 = iron stuff)
Manufacturer: 120
This is actualy not important ingame, because only those buildings are listed which have the upgrades, but it's nice if you enter the building-ID here for the main workshop for this item just for us modders.
Nr 1/2/3: 1
The count of raw materials needed for this item. If you only need 1 or 2 raw materials set the rest to 0
Prod 1/2/3: 20
The items.dbt ID of the raw materials needed for this item. No item needed = set everything to 0
Slot:
This is only needed for armory and weapons
min_stock:
This is very important to influence the buying/selling price. If the actual stock is below this value you can buy things for a green price.
max_stock:
After the actual market stock is higher than this value, the price will become more and more red, but setting a high value will also have an
effect on the sell-price (it will get more green)
I recommand you to copy an existing entry and change the values accordingly.
2. icon
After this work has been done, you need to design a icon for the item, max size 45x45 with tga and alpha canal. The name has to be item_NAME.tga (depending on the name in items.dbt) put it in the folder Textures/HUD/Items
3. text.dbt
Add new entries at the bottom of the file (as always, IDs have to be unique, if you want to combine your work with other mods, you should take numbers +10000 to keep them compatible for updates). You don't need new entries or images for the upgrades, because it will use the same as your item.
You need:
18106 "_ITEM_MyItem_NAME_+0"
18107 "_ITEM_MyItem_NAME_+1" (for plural)
18108 "_ITEM_MyItem_TOOLTIP_+0"
and maybe you also need
18109 "_ITEM_MyItem_TARGET_+0"
in case you have made a new measure/artifact where you need to choose a target first.
4. BuildingUpgrades.dbt
You need a new line like this one
First number is ID
Second number is the Building ID out of buildings.dbt where the upgrade should appear (it contains also the level of the building)
Third number is the name of the upgrade. You should use the same name as the item.
forth number is impact receiver, 1 means the building gets the impact (and not your employees)
The next number asks if you have the upgrade already unlocked by default (1) or not (0)
The 6 is the impact (see impacts.dbt). 6 is a new product.
impactvalue (998) can be multiple things. In this case we need to add the items.dbt ID here.
Room (0) is for the display-position in the tech tree. Maybe you want it to appear below another item, then you need
to set the buildingupgrades-ID from the other upgrade here.
"indoorscene" can be left at 0
"cost" if you have not set it to default, you need to set the price for the upgrade here
"visible" -1 means you can see the item in the tech tree even if you have a lower building-level, 0 is hidden.
That should be all. If you've done everything right, you can see the item ingame now.