Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: Externalised Merchants
New feature: Externalised Merchants[message #313363]
|
Thu, 20 December 2012 02:04
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
More (and externalised) merchants
As recent features have increased the need to buy local Arulcan products dramatically :angel: , I have increased the number of merchants that Arulco has. There can now be up to 21 additional merchants (arbitrary number, it seems enough for the moment). I also externalised the merchant data.
Thus it is now possible, via xml, to define any NPC to be a merchant or repairguy. I figure modders might have a use for this
There are new xmls in TableData/NPCInventory. The most interesting one is Merchants.xml, which has the following entries (lets look at Tony's entries as an example):
<MERCHANTSLIST>
<MERCHANT>
<uiIndex>0</uiIndex> <-- index of merchant
<szName>Tony</szName> <-- name of merchant (orientation purpose only ;-) )
<dBuyModifier>0.75</dBuyModifier> <-- buy cost modifier (speed modifier for repairguys)
<dSellModifier>1.25</dSellModifier> <-- sell cost modifier (repair cost modifier for repairguys)
<ubShopKeeperID>91</ubShopKeeperID> <-- ID of this NPC. Relevant values are on top of xml
<ubTypeOfArmsDealer>0</ubTypeOfArmsDealer> <-- 0: buy/sell 1: sell only 2: buy only 3: repair
<iInitialCash>15000</iInitialCash> <-- cash at begin of game
<uiFlags>1342177280</uiFlags> <-- behaviour flags, explanation below...
<dailyIncrement>15000</dailyIncrement> <-- add this amount of money every day
<dailyMaximum>15000</dailyMaximum> <-- maximum cash every day
<dailyRetained>0</dailyRetained> <-- we can carry this amount of money to the enxt day
<minCoolness>1</minCoolness> <-- min coolness for our stock
<maxCoolness>10</maxCoolness> <-- max coolness for our stock
<addToCoolness>1</addToCoolness>
<coolnessProgressRate>10</coolnessProgressRate>
<daysDelayMin>2</daysDelayMin>
<daysDelayMax>3</daysDelayMax>
<useBRSetting>0</useBRSetting> <-- use BR settings?
<allInventoryAlwaysAvailable>0</allInventoryAlwaysAvailable> <-- is all inventory always available?
<nonprofile_loyaltyrequired>30</nonprofile_loyaltyrequired> <-- required town loyalty if this is a non-profile based merchant (ubShopKeeperID 200) in a town
</MERCHANT>
...
</MERCHANTSLIST>
The <uiFlags> is a flagmask. Only some of them are relevant to us at this point. They define the merchants' behaviour when dealing items:
#define ARMS_DEALER_ONLY_USED_ITEMS 0x08000000 // 134217728
#define ARMS_DEALER_GIVES_CHANGE 0x10000000 // 268435456 //The arms dealer will give the required change when doing a transaction
#define ARMS_DEALER_ACCEPTS_GIFTS 0x20000000 // 536870912 //The arms dealer is the kind of person who will accept gifts
#define ARMS_DEALER_SOME_USED_ITEMS 0x40000000 // 1073741824 //The arms dealer can have used items in his inventory
#define ARMS_DEALER_HAS_NO_INVENTORY 0x80000000 // 2147483648 //The arms dealer does not carry any inventory
The xml has slots for all merchants, and template fields for 20 new ones, jsut fill them in however ou like. The Inventory of the new merchants is set in TableData/NPCInventory/Additional_Dealer_xxx_Inventory.xml.
Note that UB gets a slightly different Merchants.xml, due to the different merchants there.
Some of the existing ini settings might alter Tony and Devin in a few regards - I'll eventually erase them I guess.
Note that this xml includes all existing merchants and removes hardcoded values. So any change will influence your dealers.
You can now simply define your own dealers, just fill in the correct values. However, when defining a new merchant, it can take a few days for them to get stock - better do that before starting a new game.
Non-merchant NPCs have no fitting speechfiles, thus they might say odd things when selling stuff. A noble exception is Tina. Altough no code section anywhere indicates that she was intended to be a merchant, her ingame story and speechfiles suggest exactly that. For this reason, I made her sell clothes and LBE gear from now on.
A local woman sells food, seems normal...
... but her son clearly has bad music taste, or watches a bit too much 2012 Anime. Or something.
This guy repairs all their stuff.
Lets hope he's not on the manufacturing side as well.
@JMich: I'll pm you the exact datatypes for the editor later.
By the way... this breaks savegame compatibility. Playing with this requires a new game, no way around that.
This is in the trunk since r5744, and requires GameDir >= r1578.
Go shopping! Christmas shows its ugly head!
[Updated on: Sun, 15 May 2016 18:28] Report message to a moderator
|
|
|
|
|
|
New feature: Externalised Merchants
By: Flugente on Thu, 20 December 2012 02:04
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Tue, 04 June 2019 06:02
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: ZedJA2 on Thu, 16 January 2020 02:37
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Mon, 15 June 2020 12:02
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Tue, 16 June 2020 00:14
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Tue, 16 June 2020 02:00
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Tue, 16 June 2020 16:54
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Wed, 17 June 2020 11:32
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Wed, 24 June 2020 20:17
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Thu, 25 June 2020 11:00
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Mon, 29 June 2020 03:38
|
|
|
Re: New feature: Externalised Merchants
By: Vritran on Mon, 29 June 2020 12:35
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Mon, 29 June 2020 23:33
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: kodamaqq on Mon, 08 August 2022 03:12
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Kitty on Tue, 25 July 2023 01:27
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: smeagol on Thu, 20 December 2012 11:26
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Wil473 on Thu, 20 December 2012 18:44
|
|
|
Re: New feature: Externalised Merchants
By: Clarkew on Fri, 21 December 2012 03:59
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Clarkew on Fri, 29 March 2013 07:41
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Thu, 27 August 2015 19:21
|
|
|
Re: New feature: Externalised Merchants
|
|
|
Re: New feature: Externalised Merchants
By: Flugente on Thu, 27 August 2015 20:22
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Thu, 27 August 2015 21:59
|
|
|
Re: New feature: Externalised Merchants
By: Flugente on Fri, 28 August 2015 02:22
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Fri, 28 August 2015 16:38
|
|
|
Re: New feature: Externalised Merchants
By: Flugente on Fri, 28 August 2015 22:22
|
|
|
Re: New feature: Externalised Merchants
By: navaroe on Sat, 29 August 2015 01:33
|
|
|
Re: New feature: Externalised Merchants
By: 88vs1984 on Sun, 31 December 2017 21:06
|
|
|
Re: New feature: Externalised Merchants
By: todd0001 on Fri, 05 January 2018 05:00
|
Goto Forum:
Current Time: Fri Nov 29 02:44:12 GMT+2 2024
Total time taken to generate the page: 0.02774 seconds
|