Killing Floor 2

Killing Floor 2

137 Bewertungen
Custom Trader Inventory
2
   
Preis verleihen
Favorisieren
Favorisiert
Entfernen
Maps and Mods: Mutators
Dateigröße
Veröffentlicht
Aktualisiert
255.943 KB
5. Juli 2022 um 6:11
28. Apr. 2024 um 11:05
26 Änderungshinweise (anzeigen)

Abonnieren zum Herunterladen
Custom Trader Inventory

Beschreibung


📋 Description
Trader inventory management

✨ Features
  • Add items to trader
  • Remove items from trader
  • Preload weapon models (prevents lag when players buy weapons)
  • Unlock DLC weapons
  • Proper item sorting (by price)
  • Add an unlimited number of items to the trader
  • Players can sell weapons that were removed from the trader inventory

❌ Whitelisted?
No. This mod is not whitelisted and will de-rank your server. Any XP earned 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 content:
    [CTI.CTI] Version=0
  3. Launch KF2.
  4. Open console (~) and start any map with the mutator (this will generate the default KFCTI.ini content):
    open KF-BioticsLab?Mutator=CTI.Mut
  5. Close the game and configure the mutator (see ⚙️ Setup (KFCTI.ini) below).
  6. Launch KF2 again, open the console, and start the game:
    KF-BioticsLab?Game=KFGameContent.KFGameInfo_Survival?Difficulty=3?GameLength=2?Mutator=CTI.Mut
    (replace the map and set/add parameters you need).

🖥️ Usage (server)
Note: If this is unclear, first read: Dedicated Server Guide (KF2 wiki)[wiki.killingfloor2.com]
  1. Open PCServer-KFEngine.ini / LinuxServer-KFEngine.ini.
  2. Find [IpDrv.TcpNetDriver] section and ensure line exists (add if missing):
    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 server and wait for mutator download.
  5. When the download is complete, stop the server.
  6. Create a file (*):
    <kf2-server>\KFGame\Config\KFCTI.ini
    with 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. Stop the server and configure the mutator (see ⚙️ Setup (KFCTI.ini) below).
  9. Start the server.

🐞 (*) Buggy config initialization
This mutator (like many others) relies on UnrealScript's default values (0 for int type) to detect first-time use and generate a config.
However, the game contains a bug that initializes unset values to random data, which can lead to incorrect settings or missing configs.

As a workaround, I recommend explicitly setting Version=0 in the config during the first initialization.

Unfortunately, I can't fix this issue because it's a game engine problem (not the mutator's fault).

⚙️ Setup (KFCTI.ini)
  • bDisableItemLimitCheck: The original game does not support more than 256 trader items: exceeding this limit causes issues. 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 game 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 may 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 trader weapons), leave at least one line there:
    Item=
    This is necessary to explicitly initialize the list (because of the bug mentioned above) to avoid initialization with incorrect values.
  • This mutator does not include custom weapons. You must have the required weapon packs in your subscriptions to be able to add them to the trader.
  • If you use this mutator to add weapons, avoid enabling mutators from weapon packs (having them in subscriptions is enough).

🌍 Credits
  • The cat on the cover is Meawbin (original character by Cotton Valent[x.com]).
Translators:

☑️ Status: Completed
✔️ The mutator works with the current version of the game (v1150) and I have implemented everything I planned.
⛔️ Development has stopped: I no longer have the time or motivation to maintain this mod. No further updates or bug fixes are planned.

📜 Sources
https://github.com/GenZmeY/KF2-CustomTraderInventory (GNU GPLv3)
154 Kommentare
∀ℳΞ¡ƧΞɲþɘɼ 26. Apr. um 1:42 
Thanks @GenZmeY for the explanation. Not sure how to proceed with the problem, but I will test some things. I have a weapon pack on the server which has a modified version of the sentinel, but I'm not currently using it...
elbotellas888 25. Apr. um 14:22 
esta puta mierda no funciona
The Rat eating your Insulation 20. Apr. um 15:50 
Do I have to create the Custom Folder and name it KFCTI.ini? because I did that, and it doesn't seem to work, I couldn't find the [CTI.CTI] and Version=0 part neither so I created custom folders and named them that, and I couldn't go further, idk what the setup stuff means, is there a video or something to help?
GenZmeY  [Autor] 19. Apr. um 16:16 
I don't fit in the limit, I'll answer in two messages, read from top to bottom.

I can only explain the line from the log, but I can't say why the server crashes (I can only guess).

So, every time a new player joins the game, the game calls the NotifyLogin() function on all mutators. Of course, CTI receives this call and creates a RepInfo object to pass the list of trader items to the player through it.

Apparently, at the moment of spawn, Sentinel creates a fake player, and the game thinks that a new player has connected and starts calling the NotifyLogin() function on all mutators. Surprising behavior, I have not seen this before.

CTI checks that this Controller is KFPlayerController or its derivative:
https://github.com/GenZmeY/KF2-CustomTraderInventory/blob/master/CTI/Classes/CTI.uc#L346
GenZmeY  [Autor] 19. Apr. um 16:15 
And if it is not so, it will output the line you showed. Nothing else will happen, CTI will ignore this weird Controller and continue working. So I don't think that the crash is caused by CTI.

But as I said, NotifyLogin() is called for all mutators, so if you have some other mutator that considers the Controller in NotifyLogin() to be a real player - something can really go wrong during its processing.

But that's not the only thing that confuses me:
First, I've never seen such behavior in vanilla sentinel (I mean calling NotifyLogin() as for a real player)
Second, I searched for "SentinelController" in the original kf2 scripts and found nothing, not a single match.

It feels like this "vanilla" sentinel is not so vanilla.

Do you use any other mods? I have a strong feeling that the answer is somewhere outside the vanilla game and CTI.
∀ℳΞ¡ƧΞɲþɘɼ 19. Apr. um 14:39 
hi, I'm trying to add the vanilla Sentinel with
Item=KFGame.KFWeapDef_AutoTurret.
But when I buy the sentinel and try to spawn it, the server crashes.
log: CTI: ERROR: Can't create RepInfo for: SentinelController_0
Any idea why this is not working?

Warthog works fine.

I used
[CTI.RemoveItems]
Ball=True
because of the amount of custom weapons I have
Deadzombie935 10. Feb. um 11:40 
so, it didnt work at all for single player
hollowdark29 7. Okt. 2024 um 18:03 
i still don't understand how use :C, there some kind of video explained?
UltimateAssassin115 27. Sep. 2024 um 12:38 
I did finally get it to work, I know it has been over a month since I have posted. But everything seems to be working fine now
GenZmeY  [Autor] 23. Aug. 2024 um 13:37 
this all sounds very strange tbh