Limited Traders 1.3.0

Please do not ask when mod authors will update their mods to 3.9.X
Bothering mod authors will lead to warnings and repeat offenses will lead to eventual bans.

Reduces the stock of all traders. Also allows for a chance for items to drop down loyalty tiers

This mod will make traders have a much more limited stock of items available for purchase. I use this for more hardcore economy runs.


{
    "timeBetweenUpdates": 115, //How often to re-shuffle their inventory. Should be run more often than traders reset.
    "tradersToLimit": //remove or add traders you want to have adjusted. Probably works for modded traders, but havent tried.
[
        "5a7c2eca46aef81a7ca2145d", //Mechanic
        "5ac3b934156ae10c4430e83c", //Ragman
        "5c0647fdd443bc2504c2d371", //Jaeger
        "54cb50c76803fa8b248b4571", //Prapor
        "54cb57776803fa99248b456e", //Therapist
        "5935c25fb3acc3127c3d8cd9", //Peacekeeper
        "58330581ace78e27b8b10cee"  //Skier
],
    "categories": //Check Traders Currencies and Handbook IDs for category IDs or https://db.sp-tarkov.com/
{
        "5485a8684bdc2da71d8b4567": //Ammo
{
            "base": 150, //The base count of an item. In this case 300.
            "random": 50 //The variance of the base count. With this being 200, and Base being 300. The total spread is 100-500, or 300+/-200
},
        "543be6564bdc2df4348b4568": //Throw weapon (Grenades)
{
            "base": 7,
            "random": 4
},
        "543be5dd4bdc2deb348b4569": //Money
{
            "base": 3000,
            "random": 1500
},
        "5447e0e74bdc2d3c308b4567": //Special items (markers, cameras, etc)
{
            "base": 100,
            "random": 0
},
        "5448bc234bdc2d3c308b4569": //Magazines (for weapons)
{
            "base": 4,
            "random": 3
}
},

    //If an item isnt under a specified category above. It will use the settings below.
    "defaultBase": 5,
    "defaultRandom": 2,

    //Remove max buy count?`
    "removeMaxBuyRestrictions": true,
   
    "loyaltyMixup": false, //Alllow items to rarely drop down an item category.
    "loyaltyMixupChance2": 0.03, //Roll 1 to drop down 1 category
    "loyaltyMixupChance3": 0.03, //Roll 2 to drop down 1 category
    "loyaltyMixupChance4": 0.03    //Roll 3 to drop down 1 category.
    //each roll is made individually and compound.
    //This means the odds of dropping down tiers are: (if the math is wrong, sue me. IDGAF)
    //1 tier: 8.7%
    //2 tiers: 0.27%
    //3 tiers: 0.0027%
}


This mod was inspired by some of the options of realism mod, but no code have been copied. (or even looked at)

  • Hi I think I've found a bug or perhaps an incompatibility. I was noticing that the price of ammo was exponentially increasing over time and noticed that "priceAdjustment" was set to 1.35 for ammo in the config. Could this be incorrectly applying to the already increased ammo price each reset?

    • Possibly lmao. Ill look into it for 3.10 probably

    • Is it also possible the same bug might apply to trader level drop down chance? I have that on and after a long session it seems like there's more stuff than usual dropped down a trader level. Maybe just a coincidence but thought I'd mention it.

    • After some time I think it's safe to say the same bug applies to the trader drop down chance, after a few days of the server being on, there are many more dropped down trades. Restarting the server significantly lowers it again.

  • I need some help I want to see if I can up the Insurance price on a custom trader and what location in base.json do I need to edit to do this.

    Writing this because you know traders well.

    Thanks in advanced.

    • you'll have more luck asking in the discord probably.

    • alr

  • Hey leaves I’ve loved using this mod and barter economy, relooked and fuckery


    Question though


    Would it be possible to apply more limitation or barters only on items at specific trader levels - so that limits are less severe over time


    Example:


    Loyalty level limitation multiplier


    Base=0.5

    Level 1 multiplier=1

    Level 2 = 0.75

    Level 3 = 0.5

    Level 4= 0.25


    On barter economy I would presume this multiplier would take the number of available items in the assort and use that multiplier to determine number % of offers = barters vs % offer = cash


    This system could allow someone to progress through the system


    It’s just an idea but if feasible it would be a game changing feature for me and my friends using both mods 🙂

    • It would be in theory possible, but it would have to be calibrated against a single account. But it wouldn't work if multiple people are on the same server. It could all be solved, but then it would make the server use a ton of ram instead to cache the traders for each player. Ultimately a big undertaking that I might only consider next time I actually play tarkov.


      tl;dr: possibly in theory, difficult to implement, and also quite performance intense.

    • Fair enough


      I didn't realize it would be so intense client side with multiple clients... as the mods themselves were not


      Thank you for getting back to me though

  • I love clever little mods like this that increase difficulty in immersive ways. Great work, can't wait to add it to my next play through on 3.9. Not sure how I missed this one for 3.8!

    Heart 1
  • I'm a bit confused about how the shuffle and trader reset work together. First of all, is the update timer setting in seconds or minutes?


    What exactly happens during one trader reset cycle? Does each update reduce the stock randomly and the reset then fills everything up or what?

    • It's deprecated. I forgot to update the config. The traders reset whenever traders normally reset.

      Thumbs Up 1
  • is it possible to add a feature that allows merchants to sell weapons with randomly reduced durability?

  • Has anyone figured out how to use this mod to effect custom traders?


    Traders I use:

    Lotus

    Artem

    Scorpion

    MFAC SHOP (Alice)


    I Can't seem to figure out how to import their IDs into the config of this mod


    If you have found a way - can you past the trader ID that worked inside of the config for you ?


    Thanks!

    • you can use my barter economy mod to output the IDs of all installed traders.

    • Oh wow ok


      I will read up on what you left there and post back if I run into issues

    • I tried your suggestion, and this is what came up


      image.png?ex=666d0c72&is=666bbaf2&hm=3f97d0aff7b98d116e5be00b897f6f6d3850d8e3c38344f5b1a19c4da79b755e&


      I then added those IDs to the Limited Traders config and they are not affected


      image.png?ex=666d0d70&is=666bbbf0&hm=c5b74b5a3964ba515856bdc25b1dad2f4074f1d4b336a30a6ecdf1f0b9ef50cd&


    • Make sure limited traders load AFTER the mod traders.

      Thumbs Up 1
    • I will make sure that done this evening, but im 90% sure that was already the case- as my modded traders were almost at the top before installing this mod

  • By stock do you mean various items? Or the amount of those items?

    • It changes the availability of items of the trader. For example: Instead of prapor selling 100000 AKMs, he now sells 1-5.


      It's very customizable (see config).


      It does not fundamentally change what traders are actually selling, just how much of each thing.

    • Thank you for the quick response, that makes it more clear for me, and makes the game much more interesting!

    • I should make it clearer though. if you have the stock of an item drop below 0, it will remove the item. This is intended and allows for a more limited trader experience. No trades will do this with the default settings however.

    • Oh, ok. And then they will return on Reset?

    • I havent added my new way of tracking trader resets on this mod yet. So it returns when this mod runs it's update. Which can be set in the config. I will in a future release make it so it follows the traders schedule instead. But for now that's how it works.

  • One suggestion I'd like to ask for this is to also have randomized prices like in realism as well?

    Happy 1
    • a good feature would also be randomised stock as well

      Thinking 1
    • @Foxxee

      Ill see what I can do.


      @MrHighLife

      The stock is randomized though, that's what this mod does.

  • hey buddy, thanks for the mod always wanted this separated from realism. just installed it and it's throwing me this error


    TypeError: Cannot read properties of undefined (reading '_parent')

    TypeError: Cannot read properties of undefined (reading '_parent')

    at LimitedTraders.modifyTraders (N:\3.7.2\user\mods\Leaves-LimitedTraders\src\mod.ts:87:54)

    at LimitedTraders.postDBLoad (N:\3.7.2\user\mods\Leaves-LimitedTraders\src\mod.ts:59:8)

    at PostDBModLoader.executeMods (C:\snapshot\project\src\loaders\PostDBModLoader.ts:66:45)

    at PostDBModLoader.onLoad (C:\snapshot\project\src\loaders\PostDBModLoader.ts:26:13)

    at App.load (C:\snapshot\project\src\utils\App.ts:56:13)

    TypeError: Cannot read properties of undefined (reading '_parent')

    TypeError: Cannot read properties of undefined (reading '_parent')

    at LimitedTraders.modifyTraders (N:\3.7.2\user\mods\Leaves-LimitedTraders\src\mod.ts:87:54)

    at LimitedTraders.postDBLoad (N:\3.7.2\user\mods\Leaves-LimitedTraders\src\mod.ts:59:8)

    at PostDBModLoader.executeMods (C:\snapshot\project\src\loaders\PostDBModLoader.ts:66:45)

    at PostDBModLoader.onLoad (C:\snapshot\project\src\loaders\PostDBModLoader.ts:26:13)

    at App.load (C:\snapshot\project\src\utils\App.ts:56:13)


    edit: so i thought it was a load order error and i believe i was right as soon as i put it first the server started working then it started throwing me a new error



    Scheduled event: 'custom-onupdate-mod' failed to run successfully.

    Cannot read properties of undefined (reading '_parent')

    TypeError: Cannot read properties of undefined (reading '_parent')

    at LimitedTraders.modifyTraders (N:\3.7.2\user\mods\aaaaLeaves-LimitedTraders\src\mod.ts:87:54)

    at LimitedTraders.customFunctionThatRunsOnLoad (N:\3.7.2\user\mods\aaaaLeaves-LimitedTraders\src\mod.ts:40:9)

    at OnUpdateMod.onUpdateOverride (N:\3.7.2\user\mods\aaaaLeaves-LimitedTraders\src\mod.ts:30:41)

    at OnUpdateMod.onUpdate (C:\snapshot\project\src\services\mod\onUpdate\OnUpdateMod.ts:14:21)

    at App.update (C:\snapshot\project\src\utils\App.ts:75:44)

    ? 1
    • Is this with the default settings?

    • yeah nothing has being changed, i just dragged and dropped it into the mods folder

    • Uploaded a version that might fix this issue. The issue is technically not the fault of my mod (if it is what I think it is) but I added some safeguards against other mods doing things they really shouldn't be doing.

      Heart 1
    • whatever you changed appears to have fixed the load order error and the second error :) thank you for the quick reply and quick fix!

    • the server log might output something like this


      Code
      [Limited Traders] Found trade with item that doesnt exist in the global database. This is most likely caused by a mod doing something wrong.
      
      [Limited Traders] Item ID of broken trade is: <ID>


      It would be interesting to see what ID/mod is doing this.

  • Finally I always wanted to have this without needing to install realism. ^^


    thank you

    • That's why I made it, I realized the only feature I used from realism was this.

      ? 1 Heart 1
    • Glad I'm not the only one! not to mention I love that it's way more customizable too. <3

      ? 1