Adding Commodities

  • Adding Commodities (by Tunicle)


    I am sure many will know how to do this however here is a basic thumbnail of information gleaned over the last few months for adding new commodities. I dont expand on what all the bits mean as for some I am not sure, others feel free to unpack and help refine what follows, however this does work .


    All work is on decrypted inis


    Making the commodity exist
    File to alter: Data\equipment\select_equip.ini


    A typical commodity entry
    [Commodity]
    nickname = commodity_niobium (link to goods.ini, what nickname commodity has for the game to recognise it)
    ids_name = 261616 (link to the .dll entry for its name, new commodity will need new name adding, see end)
    ids_info = 65909 (link to the .dll entry for its infocard, new commodity will need new name adding, see end)
    units_per_container = 30 (how many units held per container, important for when ship is killed as FL seems to only spawn 5-7 crates per ship/cargopod. Appears to be 5 per cargopod or 6/7 depending on ship type)
    pod_appearance = cargopod_grey (appears to relate to pod carried on transports, copying one of the defaults works)
    loot_appearance = lootcrate_grey (what it looks like when looted or mined, again choose a default from similar commodity)
    decay_per_second = 0 (how many hit points the commodity loses per second when carried, 0 = non-perishable)
    volume = 1 (the volume taken up in the cargo hold)
    hit_pts = 250 (how many hit points it has when shooting in space and linked to the speed of disappearing with perishable cargo)


    So a new commodity may look like
    [Commodity]
    nickname = commodity_druidfluid
    ids_name = 589827
    ids_info = 589828
    units_per_container = 10
    pod_appearance = cargopod_green
    loot_appearance = lootcrate_green
    decay_per_second = 0
    volume = 1
    hit_pts = 250


    Now you have the commodity, the next stage is the buying and selling, so on to
    Data\equipment\goods.ini


    A typical entry
    [Good]
    nickname = commodity_niobium (what the commodity is called)
    msg_id_prefix = gcs_gen_commodity_niobium (used when the npc references this in game voice can leave out if adding custom commodity, unless you wish to add audio)
    equipment = commodity_niobium (nickname that select_equip.ini file will use, see above)
    category = commodity (so the commodity dealer will know that they sell it)
    price = 320 (the base price per single unit)
    combinable = true (true = they are not listed as individual units in cargo hold but combined as one number, compare with false (e.g. weapons) when they will be listed separately.)
    good_sell_price = 2.550000 (a multiplier of the base price that will show up as good (green) when selling to the dealer, so for this commodity = 320 x 2.55 = 816)
    bad_buy_price = 2.550000 (a multiplier of the base price that will show up as bad (red) when buying from the dealer)
    bad_sell_price = 1 (a multiplier of the base price that will show up as bad (red) when selling to the dealer)
    good_buy_price = 1 (a multiplier of the base price that will show up as good (green) when buying from the dealer)
    shop_archetype = Equipment\models\commodities\nn_icons\cwire_refine dmats_2.3db (what it looks like/which crate appear in the dealers [although not sure always actually happens] but seems to crash without an entry here, copy one used for a similar substance already in file)
    item_icon = Equipment\models\commodities\nn_icons\COMMOD_metal s.3db (the icon that appears at dealer and in cargo hold, choose a default or make own, see Ospreys Ship Icon Tutorial http://downloads.rrjds.com/Tutorials...20Tutorial.pdf, there are quicker methods but this is a good resume of FL icons)
    jump_dist = 7 (I am sure someone knows exactly what this means? But I do not value between 1 and 10 appears ok)


    So a new commodity may look like
    [Good]
    nickname = commodity_druidfluid
    equipment = commodity_druidfluid
    category = commodity
    price = 750
    combinable = true
    good_sell_price = 3.7
    bad_buy_price = 3.7
    bad_sell_price = 1
    good_buy_price = 1
    shop_archetype = Equipment\models\commodities\nn_icons\cwire_rawmat s_1.3db
    item_icon = Equipment\models\commodities\nn_icons\commod_alcoh ol.3db
    jump_dist = 10


    Now it exists and can be bought and sold the final of the basic stages is to decide where it is bought or sold.
    Data\equipment\market_commodities.ini


    A typical base entry consists of
    [BaseGood]
    base = Br01_01_base


    base = the base id used by Freelancer, this is the first, Planet New London, this is then followed by a list of commodities looking either like
    MarketGood = commodity_basic_alloys, 0, -1, 150, 500, 0, 1.500000
    or
    MarketGood = commodity_cardamine, 0, -1, 0, 0, 1, 2.6


    The first number (0) is the level a player needs to be to buy or sell (usually always 0)
    The second (-1) is the rep a player needs with the base to buy and sell this
    commodity (normally -1 so if you can dock you can buy it)
    The next 3 are base buy or base sell 0, 0, 1 (base buys), 150, 500, 0 (base sells)
    The final number is the base price multiplier for the amount it buys or sells at the base.


    In basic form 0, -1, 150, 500, 0, = the base sells and 0, -1, 0, 0, 1, = the base buys


    Plus add a final number to be applied to the base price, so in the above example, if basic_alloys is listed as 100 (in the goods.ini price) then this base will sell at 150.
    And if cardamine has a listed 100 base price this base will buy at 260.


    You add these values at each base for the commodities you wish to buy and sell.


    No entry will mean the base will buy at the default price of one unit as specified in goods.ini.


    So a small base entry may look like
    [BaseGood] ;Grand Void Cathedral
    base = MO01_09_Base
    MarketGood = commodity_civilians1, 0, -1, 0, 0, 1, 120
    MarketGood = commodity_bananas, 0, -1, 0, 0, 1, 20
    MarketGood = commodity_gold, 0, -1, 0, 0, 1, 8.000000
    MarketGood = commodity_pilgrims, 0, -1, 0, 0, 1, 11
    MarketGood = commodity_treasure, 0, -1, 0, 0, 1, 8
    This base buys a limited selection of material but sells nothing at the commodity dealer.


    Two other files you may wish to add to
    commodities_per_faction.ini, to decide which of your npc ships may carry as cargo
    and lootprops.ini to govern how the npc ships drop the cargo if looted.


    Infocards
    Ids_name = is the commodity name as it will appear to players and is usually in the nameressources.dll
    Ids_info = 65887 is the infocard of the commodity, usually in infocards.dll


    However, many mods create a custom .dll to handle this information.

    signew.jpg


    cfmoddblogo.png5904.png5904.png
    http://www.moddb.com/scripts/topsite.php?ts=4766


    Only dead fish swim with the stream.
    Don't discuss with idiots. They only drag you down to their level and then beat you with experience there.


    This is ten percent luck,
    Twenty percent skill,
    Fifteen percent concentrated power of will,
    Five percent pleasure,
    Fifty percent pain,
    And a hundred percent reason to remember the name!