MnBmodSnWteam / MnB_mod_SnW

3 stars 2 forks source link

如何让添加的物品进入市场流通? #4

Open Rachmaninover opened 4 years ago

Rachmaninover commented 4 years ago

城镇里的食物的生产来源是村庄,同时又可以通过商队和玩家流通(领主是否会跑商我不知道,应该是不会)。Taleworlds.Campaign.Town里面有关于商品来源的方法 1、private float GetItemProductionPerDayAtArea(ItemObject item, float radius) 2、private static float GetItemProductionPerDayAtVillagesOfTown(Settlement town, ItemObject item)可以对此进行一些佐证。 2里面有一句是float num2 = Campaign.Current.Models.VillageProductionCalculatorModel.CalculateDailyProductionAmount(settlement.Village, item); 从这个计算村庄生产物品的模型里猜测和 Taleworlds.Campaign.VillageType有关。

psynull commented 4 years ago

\Modules\SandBox\ModuleData\settlements.xml 可以看到村庄有Village_type, 这个属性决定特产

Rachmaninover commented 4 years ago

我看到过village_type,但是这里面填的内容,如VillageType.lumberjack是在哪里定义的?

psynull commented 4 years ago

Mount & Blade II Bannerlord\Modules\SandBox\ModuleData\spprojects.xml 但是VillageType.*没有找到

Rachmaninover commented 4 years ago

Make it merchandisable, just search for a item you find in the shop in the xml files and you should find a reference to something like “merchandise” just copy that for your item ——t社网友对我的的回答

psynull commented 4 years ago

Make it merchandisable, just search for a item you find in the shop in the xml files and you should find a reference to something like “merchandise” just copy that for your item ——t社网友对我的的回答

这个是是否能交易,我在新建物品时也用到过,但和村庄生产还有一定区别。

Rachmaninover commented 4 years ago

VillageType也不能完全决定村庄的生产内容。很多村庄都是生产多种物品的。

Rachmaninover commented 4 years ago

CampaignSystem.DefaultVillageTypes是关于villageType的代码