Killing Floor 2

Killing Floor 2

84 ratings
Custom Trader Inventory
2
   
Award
Favorite
Favorited
Unfavorite
Maps and Mods: Mutators
File Size
Posted
Updated
255.943 KB
5 Jul, 2022 @ 6:11am
28 Apr @ 11:05am
26 Change Notes ( view )

Subscribe to download
Custom Trader Inventory

Description


Description
Trader inventory management

Features
  • remove/add items to trader;
  • can preload weapon models (no lags when someone buys weapons);
  • unlock DLC weapons;
  • correct items sorting (by price);
  • don't have to worry about adding new guns after each KF2 update;
  • add an unlimited number of items to the trader;
  • players can sell weapons excluded from trader inventory.

Whitelisted?
No. This mod is not whitelisted and will de-rank your server. Any XP gained will not be saved.

Usage (single player)
  1. Subscribe to this mutator;
  2. Create a file (*): C:\Users\<username>\Documents\My Games\KillingFloor2\KFGame\Config\KFCTI.ini
    with the following content:
    [CTI.CTI]
    Version=0

  3. Start KF2;
  4. Open console (~) and start any map with CTI (this will generate the default KFCTI.ini content):
    open KF-BioticsLab?Mutator=CTI.Mut
  5. Close the game and configure CTI as you need (see the Setup (KFCTI.ini) section below);
  6. Start KF2, open the console, start the game:
    open KF-BioticsLab?Mutator=CTI.Mut
    (replace the map and add the parameters you need).
Usage (server)
Note: If you don't understand what is written here, read the article Dedicated Server (KF2 wiki)[wiki.killingfloor2.com] before following these instructions.
  1. Open your PCServer-KFEngine.ini / LinuxServer-KFEngine.ini;
  2. Find the [IpDrv.TcpNetDriver] section and make sure that there is a line (add if not):
    DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload
    ❗️ If there are several DownloadManagers= then the line above should be the first ❗️
  3. Add the following string to the [OnlineSubsystemSteamworks.KFWorkshopSteamworks] section (create one if it doesn't exist):
    ServerSubscribedWorkshopItems=2830826239
  4. Start the server and wait while the mutator is downloading;
  5. When the download is complete, close the server;
  6. Create a file (*): <kf2-server>\KFGame\Config\KFCTI.ini
    with the following content:
    [CTI.CTI]
    Version=0

  7. Add mutator to server start parameters: ?Mutator=CTI.Mut and start the server (this will generate the default KFCTI.ini content);
  8. Close the server and configure CTI as you need (see the Setup (KFCTI.ini) section below);
  9. Start the server (with ?Mutator=CTI.Mut) again.

(*) Buggy config variables initialization
CTI, like many other mutators, initializes the config by relying on the unreal script feature which uses default values for each data type that is not explicitly specified. For the int type (which is used to store the config version) this is zero - detecting zero allows to understand that the mutator is being used for the first time (which means it's need to generate a config). But now the game contains a bug that initializes the config values ​​randomly if they are not explicitly set. Thus, the config may have incorrect values ​​or not be created at all. This is why I recommend explicitly set Version=0 in the config for the first time.

Unfortunately I can't do anything about it because it's a game problem (not mutator). I hope TWI fixes this someday.

Setup (KFCTI.ini)
  • bDisableItemLimitCheck: The original game does not support more than 256 trader items, adding items above this limit causes bugs. If this problem is solved (For example, if you are using a mutator that has already fixed this problem or by enabling bApplyPatch) then it can be set bDisableItemLimitCheck=True to remove the limit, otherwise it is better to leave it False.

  • Set bApplyPatch=True to fix some base classes of the game: this fixes problems when adding more than 256 items to a trader and will allow players to sell weapons that have been removed from trader inventory. Note that enabling this parameter replaces the following classes: KFAutoPurchaseHelper, KFInventoryManager, KFGFxMenu_Trader, KFGFxObject_TraderItems. There may be compatibility issues with mutators that also replace them.

  • Set bPreloadContent=True to load weapon models in advance and have no lags when someone buys weapons. In some cases (usually if there is a lot of custom content), enabling preload can cause models to disappear. It is recommended to test how this setting affects the game for your server configuration and then decide whether to enable preloading or not.

  • Set bOfficialWeaponsList=True to have an auto-updated list of all official weapons in the config (for a convenient copy-paste) or leave it False if you want a clean config without unnecessary things.

  • Set UnlockDLC to customize DLC weapon unlocks. Here are the possible values:
    • False - disable DLC unlock.
    • ReplaceFilter - changes the trader filter allowing you to buy original DLC weapons without restrictions, unlocks future DLCs as well (no need to update this mutator). However, it replaces the - KFGFxMoviePlayer_Manager class so it may not be compatible with mods that also replace it.
    • ReplaceWeapons - replaces DLC weapons with their unlocked variants. Compatible with any mods, but may require a CTI update after the release of new DLC weapons.
    • True or Auto - selects the most appropriate option automatically. Recommend putting CTI.Mut last in the mutator load queue if you use this.

  • Use [CTI.RemoveItems] to remove items from the trader inventory.
    example: Item=KFGame.KFWeapDef_Mac10 will remove MAC10 from sale.

  • Set bALL=True if you want to remove all items (can be useful if you want to set the entire sale list in the [CTI.AddItems] section yourself).
  • Set bHRG=True to remove HRG items.
  • Set bDLC=True to remove DLC items.

  • Use [CTI.AddItems] to add items to the trader inventory.
    example: Item=WeaponPackExt.KFWeapDef_XM25 will add XM25 to sale.

Notes
📌 If you need an empty list anywhere (for example, you don't want to delete some of the traders's weapons), leave at least one line there:
Item=
This is necessary to explicitly initialize the list (because of the bug I wrote about above) to avoid initialization with incorrect values.
📌 Mutator does not contain custom weapons. You must have the required weapon packs in your subscriptions to be able to add them to the trader.
📌 If you are using this mutator to add weapons, you should not use mutators from weapon packs (just having them in subscriptions is enough).

Translators:
cheungfatzong - Traditional [CHT] and Simplified [CHN] Chinese.

Sources
https://github.com/GenZmeY/KF2-CustomTraderInventory (GNU GPLv3)
101 Comments
GenZmeY  [author] 3 May @ 5:39pm 
The client and server must be using the same version of the mutator for this to work, you need to figure out why in your case they are different

I have no idea how your server is configured so I can't give you a ready-made solution, but the plan for you is something like this:
1. Make sure that when connecting to your server, the client downloads only one copy of CTI.u and this is the latest version
2. Make sure that your server is configured to receive and distribute CTI.u in only one way (only through workshop or only through redirect, but not both)
3. If your server uses workshop, make sure that its subscriptions have only one version of CTI.u (for example this one, id 2830826239)
4. Make sure that the server uses only one copy of CTI.u and this is the latest version (check the server cache folder, check the BrewedPC server folder)
三笠·阿克曼 2 May @ 8:34am 
I made it clear to them that the cache files still cannot access my server. Could you please tell me how to solve it? Thank you
三笠·阿克曼 2 May @ 6:15am 
I am a server set up on Windows, and when my friends join my server, they will be prompted with CTI version mismatch, but it is strange that I have no problem linking it myself. Thank you very much for answering my question! Thank you!
GenZmeY  [author] 2 May @ 6:09am 
This error means that the CTI version on the client and on the server does not match. This may depend on your subscriptions and/or how the server is configured.
Clearing the cache on the client usually helps; it is located here:
C:\Users\<YOUR_USERNAME>\Documents\My Games\KillingFloor2\KFGame\Cache\
If this does not help, contact the administrator of the server you are trying to connect to
三笠·阿克曼 2 May @ 5:44am 
Why prompt CTI not matching version
GenZmeY  [author] 26 Mar @ 11:13am 
already did it :)
The Renegadist 26 Mar @ 10:54am 
That did it, since that isn't explicitly mentioned in the description I would add that in for people like me who think the entire thing should be filled at creation.
GenZmeY  [author] 25 Mar @ 6:06pm 
Hey

You should not combine config generation and configuration into one action

First, generate a config by placing the "Version=0" there and starting the game/server. Close the game/server. All settings will now appear in the config and the config version will change. Now set up the config as you need and run the game/server again, everything will work as it should
The Renegadist 25 Mar @ 6:01pm 
Hello, having issues getting this to run. I made the KFCTI.ini file and added these lines to it:

"[CTI.CTI]
Version=0

[CTI.AddItems]
Item=Normalizer.KFWeapDef_USP
Item=Normalizer.KFWeapDef_USP_Dual
Item=Normalizer.KFWeapDef_G36C_V3
Item=Spas12xASVAL.KFWeapDef_Spas12
Item=Spas12xASVAL.KFWeapDef_ASVAL"

with the two weapon packs subscribed and they don't show in the trader list even after loading the mutator via console, is my syntax incorrect?
rexjackson 15 Mar @ 6:28pm 
C:\Users\<username>\Documents
when i come here, it empty
pls help