Advanced Trader Framework 2.1.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.

Edit, customize and even create new traders easily. Share you custom made trades with the community and add them to the trader of your choice.

UPDATE NOTE: ATF is now a Standalone Trader Example for you to customize. The old files ATF files are still compatible with the new Version, just drop them into the /db/assort/ folder.

The Utility functions will be moved to a new separate mod! It's gonna take some time to get done.

Features:

  • Create new Standalone Trader easily
  • Create new Trade Files that can be shared with others
    • Any Trades Trades in the /db/assort/ folder will be added to the Trader


Installation:

  • Just put the mod into the /user/mods/ folder

Adding a Trade:

  • Just put any Trade file into the /db/assort/ folder

Changing a Trader Avatar:

  • your new avatar must be .jpg or .png
  • add your new avatar to the /res/ folder
  • edit "avatar":"/files/trader/avatar/YourAvatarName.jpg" in the base.json

Share your Mod:

  • change the TraderID in the base.json in the /db/base/ folder
  • change the Modname in the config
  • change the Foldername


Notes on sharing Trade files:


If you share your presets you should make sure that your presets are valid without mods otherwise you should create a new TradePackage with Mod requirements. Mods like Makes Sense and alevesThings (cool mods btw) let you put certain attachments on weapons which would be normally not possible. I dont know how the game reacts if you load such a preset without those mods.


I hope the community creates some cool new Trade Overhauls. My reason for creating this mod was exactly that. I just wanted to play a hardcore run, but I didn't like the default barter trades. At first I wanted to edit the default traders, but then I thought why not make it very customizable and add the ability to save trades in different files which you can edit easily and share.


I am gonna upload some unique trades in the next couple of days or weeks depending on how much time I have. I hope you have fun with this mod and I also hope that there are not too many problems I have to fix. ;(


Notes for modders:

  • feel free to use, improve and update any of my code
  • some credits would be nice if you use my code ;)
  • Version 2.1.0

    • Updated to AKI 3.1.1
  • Version 2.0.0

    • Updated to Aki 3.0.0
    • Changed to a standalone Tradermod
    • Old ATF files are still compatible
    • The Utility Fuctions will be moved to a new Mod
  • Version 1.5

    • updated to AKI 2.2.0
    • repeatable Quest should work for custom Traders
    • all Traders using ATF should also work in AKI 2.2.0
    • should also work with AKI 2.2.1
  • Version 1.4

    • Fixed the insurance Issue for custom Traders
    • The Modded Trader Example now has a dialogue.json
    • Prapors dialogue is used as default in case there is no dialogue.json
    • To update from V1.3 to V1.4 just replace the old /src/ folder with the new /src/ folder.
    • Thanks to ZxregretzxZ for the help with the insurance issue.
  • Version 1.3

    • Removed deletion of old avatars in localappdata
    • ATF now throws an error if a Trade ID doesn't match with a barter_scheme and loyal_level ID
    • Traders now get added to the Flea and all their trades should be available on the flea
  • Version 1.2

    • Jaeger had the Mechanic base.json causing problems
    • Renamed the /moddedTrades/ folder to /TradePackages/
    • Removed the old /assort/ folder added the /DefaultTradePackage/ Folder instead
    • the requiredMods.json is now called PackageConfig.json
    • added the ability to enable a Package in the PackageConfig.json
    • renamed the traderConf.json to TraderConfig.json and removed the enableBlacklist option
  • Version 1.1.0

    • Custom avatars can now be loaded.
    • moved the Export preset functionality to the utility folder.
    • added a mergeTrades functionality to the utility folder.
    • added a unpackTrades functionality to the utility folder.
    • added a mod requirement check for Modded Trades.
  • Version 1.0.0

  • keep getting this error


    TypeError: Cannot set properties of undefined (setting 'Potnak')

    TypeError: Cannot set properties of undefined (setting 'Potnak')

    at Potnak.postDBLoad (C:\Users\ravin\OneDrive\Desktop\SP Tarkov\user\mods\Pontak\src\mod.js:72:49)

    at PostDBModLoader.executeMods (C:\snapshot\project\obj\loaders\PostDBModLoader.js)

    at PostDBModLoader.onLoad (C:\snapshot\project\obj\loaders\PostDBModLoader.js)

    at App.load (C:\snapshot\project\obj\utils\App.js)

    TypeError: Cannot set properties of undefined (setting 'Potnak')

    TypeError: Cannot set properties of undefined (setting 'Potnak')

    at Potnak.postDBLoad (C:\Users\ravin\OneDrive\Desktop\SP Tarkov\user\mods\Pontak\src\mod.js:72:49)

    at PostDBModLoader.executeMods (C:\snapshot\project\obj\loaders\PostDBModLoader.js)

    at PostDBModLoader.onLoad (C:\snapshot\project\obj\loaders\PostDBModLoader.js)

    at App.load (C:\snapshot\project\obj\utils\App.js)

  • im getting an error i cant make any sense of when i try to install in visual studios.


    * Executing task in folder ATF_ExampleTrader: npm install


    npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At line:1 char:1

    + npm install

    + ~~~

    + CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException



    * The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm install" terminated with exit code: 1.

    * Terminal will be reused by tasks, press any key to close it.


    * Executing task in folder ATF_ExampleTrader: npm install


    npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

    At line:1 char:1

    + npm run build:unzipped

    + ~~~

    + CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException



    * The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm run build:unzipped" terminated with exit code: 1.

    * Terminal will be reused by tasks, press any key to close it.

    • The error is CommandNotFoundException and that means you didn't install node.js because it can't find the npm command in your environment.

      I am guessing you downloaded the Node.js installation and only ran the install_tools.bat file and called it a day. So you most likely only installed chocolatey and python.


      I installed Node.js via chocolatey but because of that I run a newer version. I am not sure why the getting started guide for AKI modding states that Version 14.15.3 is the one needed. I tried the npm install on my end and it works but I don't really use it. So it is most likely better to install the right version as the documentation states.

      Thumbs Up 1
    • it was the node version i think. i deleted everything tried anain no dice so i deleted again and got chocolaty first. then then used that to install node. it works now! thanks for the help!

    • hi me again! when this is put in assort folder, the server crashes before i can get an error message in the server. maybe you know what I'm doing wrong.


      {
        "items": [
      {
          "_id": "Glock_Preset",
          "_tpl": "5a7ae0c351dfba0017554310",
          "parentId": "hideout",
          "slotId": "hideout",
          "upd": {
            "UnlimitedCount": true,
            "StackObjectsCount": 999999
      }
      },
      {
          "_id": "Glock_Slide",
          "_tpl": "5a6f5e048dc32e00094b97da",
          "parentId": "Glock_Preset",
          "slotId": "mod_reciever",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "Glock_grip_mod",
          "_tpl": "5a7b4960e899ef197b331a2d",
          "parentId": "Glock_Preset",
          "slotId": "mod_pistol_grip",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "Glock_extended_frontsight",
          "_tpl": "5a71e0048dc32e000c52ecc8",
          "parentId": "GLock_Slide",
          "slotId": "mod_sight_front",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "Glock_extended_rear_sight",
          "_tpl": "5a71e0fb8dc32e00094b97f2",
          "parentId": "GLock_Slide",
          "slotId": "mod_sight_rear",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "Glock_33rd_Mag",
          "_tpl": "5a718da68dc32e000d46d264",
          "parentId": "Glock_Preset",
          "slotId": "mod_magazine",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "Glock_barel_Threaded",
          "_tpl": "5a6b5e468dc32e001207faf5",
          "parentId": "Glock_Preset",
          "slotId": "mod_barrel",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "x400_flashlight",
          "_tpl": "56def37dd2720bec348b456a",
          "parentId": "Glock_Preset",
          "slotId": "mod_tactical",
          "upd": {
            "StackObjectsCount": 1
      }
      },
      {
          "_id": "sdn9_supressor",
          "_tpl": "5c7e8fab2e22165df16b889b",
          "parentId": "Glock_barel_Threaded",
          "slotId": "mod_muzzle",
          "upd": {
            "StackObjectsCount": 1
      }
      }
      ],
        "loyalty_level_items": {
          "Glock_Preset": 1
      }
      }

    • (node:1832) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '96d0efd58ba74b93d97657e5' of undefined <------------- the error has to do with the preset

      at RagfairOfferGenerator.generateTraderOffers atleast to me it looks like it does. (C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:8671:54)

      at RagfairServer.update (C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:2469:40)

      at C:\Users\jacob\Desktop\SPTAKI\user\mods\zz-CustomTradersOnFlea\src\mod.js:52:52

      at Array.forEach (<anonymous>)

      at CustomTradersOnFlea.postAkiLoad (C:\Users\jacob\Desktop\SPTAKI\user\mods\zz-CustomTradersOnFlea\src\mod.js:48:14)

      at PostAkiModLoader.executeMods (C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:13605:46)

      at PostAkiModLoader.load (C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:13594:14)

      at ModCallbacks.onLoad (C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:1833:31)

      at App.load (C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:18157:59)

      at C:\Users\jacob\Desktop\SPTAKI\obj\bundle.js:19855:47

      (Use `Aki.Server --trace-warnings ...` to show where the warning was created)

      (node:1832) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.htm…unhandled_rejections_mode). (rejection id: 1)

      (node:1832) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.



      when the server runs it gives this error. i know the error is linked to another mod. but the server dosent run without it oddly.

    • That most likely happened because you file is missing the barter_scheme section which is basically the price. I am guessing that is why RagfairOfferGenerator.generateTraderOffers throws the undefined error.


      Code
          "barter_scheme": {
              "Glock_Preset": [
                  [
                      {
                          "count": 100,
                          "_tpl": "5449016a4bdc2d6f028b456f"
                      }
                  ]
              ]
          }
      Heart 1
  • Is there a way to add trades to existing traders, rather than to make a new trader?

    • It should be possible. You have to copy the trader base from your AKI installation. The files are in Aki_Data/Server/database/traders/. Each Folder there is a trader. To find the trader your looking for just look into the base.json of each folder.


      If you have the base.json of the default trader you want to edit, you just use that with this mod and if you only want to add stuff to the trader assortment you have to grab the assort.json and put it in the assort folder of this mod alongside with all your trades you want to add to it. If you don't use the default assort only your added trades should show up.

  • Update to 3.2.0?

    • Is it broken? I haven't read about any issues that need to be adressed in the AKI 3.2.0 update.

      If it is broken comment again and let me know and I will try to look into it. I haven't had the time to test the new update.

  • Hey, what is the best way to export a preset? i cannot figure it out by myself sadly.

    • Normaly you would use the export preset utility function but I haven't updated that to the newest version yet. So at the moment, there isn't a easy way.

  • Why did you remove Utility Fuctions from 2.0 ?

    • Because the Utility functions will be seperate in a new mod.

    • And how then on 3.0.0 SPT.AKI Export assemblies?

    • I am sorry, but I don't understand your question.

    • I mean how to export weapon presets

    • It's just that I understand that before the removal of Utility Functions, you had a weapon export function that could be placed in "assort" after which the trader could sell these weapons ( Sorry, I can only communicate through a translator)

  • Is there a good guide anywhere for creating new trades? I'd like to add some presets with unique names, but I don't know how to do that in the JSON :P

    • At the moment there isn't. I am working on the ATF Utility mod that helps with creating new Tradefiles and Presets. I hope that I can get the mod done as soon as possible.

    • Great to hear. Thanks for the response :)

  • hey i have too many traders(so i cant acces the top ones like therapist) but dont want to get rid of them, could you make it so you can scroll to see the rest of your traders on the trader menu ?

    • sorry but I can't really help with that problem.

  • just wondering if this works with 2.3.0

    • Probably not. The 2.3.0 update has major changes to the modding structure.

    • unlucky, thanks for letting me know! have a wonderful day/night

    • Testing. On 2.3.1 seems works, though warning messages about "trader ID not found" types in server console. Will see, can I disable them or not. Trader appears, I tried to buy some supplies... it was done, without errors. Next try will be creating some simple quest with "Custom Quests" mod.


      Upd: Seems warning connected with other mod, it is not ATF problem, I guess. It looks like setting, which changing trader's assort update, probably from KMC ServerValueModifier. Nevertheless, your mod is still working, thank you, yoshka! Upd upd: warning appears also with clean spt with ATF mod only. Seems, it is messages from server itself.


      Upd2: Yup, quests working too. Yoshka, cheers! Your mod works still great! People, you CAN download this mod to playing with spt 2.3.1, it's definitely WORKS (I ran some simple tests, but I think it is enough)

    • Although it's a necropost - the addition with warning messages is not SVM's fault but AKI change of internal configs related to insurance and stock time.


      let AkiFix = {"traderId": "INSERTID","seconds": 3600}
      TraderConfig[
      "updateTime"].push(AkiFix);
      InsuranceConfig.insuranceMultiplier[
      "INSERTID"] = 0.30
      Here is the fix, change "INSERTID" to trader ID you're about to fix, you can duplicate this without `let` in the beginning if you have multiple custom traders, some of mods already have that treatment, I think it'll be LeKaiju's work and Thunderbags.


    • Thanks for informing me about the issue. I will look into it.

  • Aloha,

    I'm having an issue with exporting presets. They almost always export with the word 'export' still attached.

    https://ibb.co/D9pdC2xD9pdC2x

    I've tried seperating them by a space and putting export at the end of the filename, neither of which have helped.

    If there's a way to change the name manually I am fine with doing it that way, I just don't know how.

    Thanks in advance,

    • The names are only saved in your profile and won't be shared with other if you share your trade files.

      You can either change the name of the preset directly in your profile or if you delete the preset in the in game preset editor, the name will be gone. Then you should be able to save the preset under a different name.

      Thanks 1
    • Thanks Yoshka, much appreciated. :)

  • Is it possible to use this mod to edit current trader prices? i was looking for a mod to increase item values bought at traders by X% but haven't found anything.

    • Any luck figuring out how to edit the current trader prices? I've been trying to figure out the same thing but have had no luck. I figured out how to edit the flea market prices but everything I've tried to do to increase costs of trader items hasn't worked for me thus far.

    • In the base.json of each Trader there is a discount value, that affects all the traders prices as far as I know. You might be able to achieve your desired results with that option. The discount might also affect the sell price of items, so you might have to tweak the buy_price_coef which only affects the sell values.


      Sorry for the late answer, but I am not that active at the moment.

  • Hi nice work on this mod here !


    I just created TrapModLoader and it seems to have an issue with your mod because of how the `exportPresets` static method is made,


    Can you retrieve profile using the conventional way ? (i.e. `SaveServer.profiles`)

    If profiles are not available at the moment or you access it, you can retrieve them with `SaveServer.load()`


    This would be very appreciated ^^

    • Hmm actually I can do a hack in TrapModLoader directly, if ATF mod is found, I can export presets by myself.

    • Fixed in TrapModLoader 1.0.1

    • Hey,

      I am gonna fix that probably in the next update, but that might take a while, because I am way too busy at the moment. Thanks for letting me know. I didn't even know that the profiles could be accessed that way.

      Like 1
  • Hey, is there a way to make trader stock be randomized per restock timer similar to Fence?

    • As far as I know there doesn't seem to be a way to do that, but I am not 100% certain.

    • Yeah, its frustrating that there is no way to make stock limited either X(
      Maybe in newer AKI?

    • Limiting the trades should be possible.

      Each trade should have the following attributes:

      Code
                      "UnlimitedCount": true,
                      "StackObjectsCount": 999999


      If you set the UnlimitedCount to false and the StackObjectsCount to something like 10.

      The trade should be limited to 10 per restock, but I haven't tested it.

    • Sadly this doesn't work at all. Even using
      "BuyRestrictionMax": 1,

      "BuyRestrictionCurrent": 0
      does not work and allows for multiple purchases.

  • Love the mod. Works great easy to use. Quick question: Im trying to set up a trade for dogtags, is there a way to set a level requirement for them? I am a bit on the low IQ side

    • Here is an Example


    • You're the man! Really appreciate it. Keep up the good work

  • is it possible to make a new item that doesnt exists in the game and make it tradeable in a trader i created in this game? if yes, i dont know how to do it. Tell me if you can. Thanks.

    • This mod doesn't create new items. If you want to create new items, then this isn't the right mod and I haven't seen any mod that lets you easily create new items, for that you most likely have to learn a tiny bit of javascript and json.


      With this mod you can only create a trade for a custom item but not create it.

  • Sorry I'm a little dumb but I have no idea where to even really start on this mod. I want to use it but I just have no idea how.


    That's all I can really say, any help would be nice I guess but I'm not sure how you could help me.

    • I also don't know how I could help you, because I don't know what you want to accomplish with this mod.

      Most things should be covered in the Mod description.

      You could just try to copy the examples, change some values and see if it works. If you have troubles with something specific, you can always leave a comment and I or someone else might help you out.

      My replies might take some time depending on how busy I am.


      You might want to get a look at the examples that already come with this mod or take a look at Traders, that were created with ATF. There is the Hardcore Traders Mod or Valkyrie Trader Mod for example.


      For getting Item IDs I can recommend you the How to get Item IDs Tutorial in the Documentation Section.

    • Thank you for the reply, I will continue to attempt and learn how to use this. I also appreciate the links you provided to help me.

  • need help


    1. [ERROR] ATF: Error: Trade replacemegasblock missing loyal_level_items with same ID
    2. [ERROR] Trace:
    3. TypeError: Cannot use 'in' operator to search for 'Durability' in undefined
    4. at Function.addMissingCondition (C:\Users\T.000\Desktop\SPT\EFT\obj\bundle.js:27097:40)
    5. at Function.getItemCondition (C:\Users\T.000\Desktop\SPT\EFT\obj\bundle.js:27074:32)
    6. at Function.createOffer (C:\Users\T.000\Desktop\SPT\EFT\obj\bundle.js:26959:27)
    7. at Function.generateTraderOffers (C:\Users\T.000\Desktop\SPT\EFT\obj\bundle.js:26873:21)
    8. at new Trader (C:\Users\T.000\Desktop\SPT\EFT\user\mods\zzzAdvancedTraderFramework\src\mod.js:393:18)
    9. at C:\Users\T.000\Desktop\SPT\EFT\user\mods\zzzAdvancedTraderFramework\src\mod.js:193:41
    10. at Array.map (<anonymous>)
    11. at Function.loadTraders (C:\Users\T.000\Desktop\SPT\EFT\user\mods\zzzAdvancedTraderFramework\src\mod.js:189:28)
    12. at Mod.load (C:\Users\T.000\Desktop\SPT\EFT\user\mods\zzzAdvancedTraderFramework\src\mod.js:80:21)
    13. at Function.executeMods (C:\Users\Tr.000\Desktop\SPT\EFT\obj\bundle.js:26082:28)
    • [ERROR] ATF: Error: Trade replacemegasblock missing loyal_level_items with same ID

      Means the trade with the ID replacemegasblock doesn't have the same ID listed in the loyal_level_items section (at the bottom of Trade files).


      For a trade the same ID has to be used at

      • First at "_id"
      • Second under "barter_scheme"
      • Last under "loyal_level_items"
    • fixed the first one, what about this?


      1. TypeError: Cannot use 'in' operator to search for 'Durability' in undefined
    • I am not entirely sure what causes this. My best guess is that one of the trades causes problems.

      Try removing the trades and test if the problem is still there. If not the add them one at a time back in and test again and see if it breaks.


      Should you find the trade that causes this problem, then please post the code so I can take a look.


      Also please tell me what kind of mods your using.

  • dude are you gonna credit me for the new version?


    Edit: at the end of your mod description you literally say "some credits would be nice if you use my code"

    • only if you ask nicely. ;)

      It wasn't really a big issue. I only took so long because I am busy.

      But oh well I guess you kinda helped. :thumbup:


      Edit: I didn't use your code.

      Like 1
    • 🗿

      "Please credit me in the 1.4 version description"

    • For the next time you make code suggestions, you should actually look at that persons code and not someone else's.

  • I'm not sure if I'm just not doing this correctly but I made a trader and he shows up in trade but the picture and his inventory won't load and my stash won't either when I'm in the trade screen

    • I just noticed that i get this error when opening the trader


      [ERROR] Trace:

      SyntaxError: Unexpected token u in JSON at position 0

      at JSON.parse (<anonymous>)

      at Function.clone (C:\Users\tearl\Desktop\Tarkov Single Player\obj\bundle.js:27710:17)

      at Function.getAssort (C:\Users\tearl\Desktop\Tarkov Single Player\obj\bundle.js:23517:33)

      at Object.getAssort [as aki] (C:\Users\tearl\Desktop\Tarkov Single Player\obj\bundle.js:16797:50)

      at Function.getResponse (C:\Users\tearl\Desktop\Tarkov Single Player\obj\bundle.js:26277:62)

      at Function.sendResponse (C:\Users\tearl\Desktop\Tarkov Single Player\obj\bundle.js:26504:29)

      at Inflate.cb (C:\Users\tearl\Desktop\Tarkov Single Player\obj\bundle.js:26539:22)

      at Inflate.zlibBufferOnEnd (zlib.js:153:10)

      at Inflate.emit (events.js:315:20)

      at endReadableNT (internal/streams/readable.js:1327:12)

    • SyntaxError: Unexpected token in JSON means you made a mistake while editing one of the .json files. The How to edit Json Files Tutorial in the Documentation Section might help you out, if your having problems.

    • OK thank you

    • @Tydog47 Whenever I get json errors I use this site https://jsonformatter.org Just copy paste the code in, hit verify json and it'll show you where it's broken and (usually) how to fix it. I'm dogwater with anything but css and it's helped me figure out more than a few hopeless bugs.

    • @Tydog47 I had a similar error when I was trying to port over an existing trader to ATF. It took me a while to figure out the issue, but it seems that it was due to some presets that were built with modded parts. It's likely that is the same issue with you. If you use the unpackTrades (located in /zzzAdvancedTraderFramework/utility/unpackTrades), you can add the trades one by one till you narrow it down to what it was that was causing the issue.

  • [ERROR] Trace:

    TypeError: Cannot read property '0' of undefined

    at Function.generateTraderOffers (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:52467:58)

    at Function.update (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:52427:23)

    at Function.load (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:52374:19)

    at Object.load [as aki-ragfair] (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:43855:19)

    at Function.load (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:52921:27)

    at Function.main (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:42371:9)

    at Object.161../Lib.js (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:42376:9)

    at o (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:1:265)

    at C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:1:316

    at Object.245.../Program.js (C:\0.12.10.2.12893_AKI_1.5.1_AIO\obj\bundle.js:51758:1)

    I'm new to this, am I doing anything wrong?

    • Something definitely went wrong. Would you mind giving me some more information?


      When did the error occur? directly after the server start or when you clicked on a trader?


      Did you edit some of the files? If yes, which ones did you edit?


      Do you have other mods loaded?

    • Server Start and I'm trying to use the 12.11 guns mod.

    • @Pre I had a similar error when I was trying to port over an existing trader to ATF. It took me a while to figure out the issue, but it seems that it was due to some presets that were built with modded parts. It's likely that is the same issue with you. If you use the unpackTrades (located in /zzzAdvancedTraderFramework/utility/unpackTrades), you can add the trades one by one till you narrow it down to what it was that was causing the issue.

  • Hey, are you able to make heads or tails of this? I have made one trader that works perfectly but on my second attempt I started getting errors when opening the trader in game.


    [ERROR] Trace:

    SyntaxError: Unexpected token u in JSON at position 0

    at JSON.parse (<anonymous>)

    at Function.clone (F:\Tarkov Offline 2.1.2\obj\bundle.js:27710:17)

    at Function.getAssort (F:\Tarkov Offline 2.1.2\obj\bundle.js:23517:33)

    at Object.getAssort [as aki] (F:\Tarkov Offline 2.1.2\obj\bundle.js:16797:50)

    at Function.getResponse (F:\Tarkov Offline 2.1.2\obj\bundle.js:26277:62)

    at Function.sendResponse (F:\Tarkov Offline 2.1.2\obj\bundle.js:26504:29)

    at Inflate.cb (F:\Tarkov Offline 2.1.2\obj\bundle.js:26539:22)

    at Inflate.zlibBufferOnEnd (zlib.js:153:10)

    at Inflate.emit (events.js:315:20)

    at endReadableNT (internal/streams/readable.js:1327:12)


    Thxs!

    • I figured out what was wrong, It turns out that you can not add 3 items to a barter trade. Max is 2.

    • SyntaxError: Unexpected token in JSON means you made a mistake while editing one of the .json files. The How to edit Json Files Tutorial in the Documentation Section might help you out, if your having problems.

      Most likely you forgot a comma. The max isn't 2. Here is a example.


    • Works fine now, thanks for getting back to me. Must have missed the comma like you said. :)

  • could you possible make the trader grid 5 vertical collums instead of 4? Having over a certain amount of extra trader forces prapor, skier and therapist off the top of the screen, or even make the trader window scrollable

    • I know the problem your talking about, but unfortunately I can't really help you with that. As far as I know there isn't an easy way to modify UI elements in general. If there was an easy way, someone would have already made a mod for this problem. Especially with mods like andruis questmaniac which already adds 6 traders.


      The active SPT developers are more likely able to help you out with this request, but keep in mind that they are most likely quite busy and have more important matters to do.

  • Works. Just works. And works perfect! Now I can buy Dolg Exoskeleton from SamSWAT mod (it doesn't appears in flea on current SPT) at my new custom trader, hah!

    • The reason why the item doesn't show up on the flea is most likely that the mod that adds the item, doesn't add it to the flea in general. My mod just adds trade offers to the flea, but if the item isn't added to flea, it can't create a offer for it.

    • Indeed. I figured that. But I can't add an item to flea-market, too difficult for me (or I'm just lazy). Your mod solved my "problem", so - thanks a lot, bro!


      P.S. On previous SPTs (before 2.1.x) flea worked differently... items was appears. By the way.

  • Great mod, works as it says it does. Really helps for hardcore style players.

    Question, If I wanted to share my custom trader, is there a good way to do that? Don't know if it is allowed to upload here since its not really it's own 'mod' per se. I'm rather new here.

    • If you wanted to share your trader, you would just share your created files that can be put into the Advance Trader Framework folder. So everything is made by you and your files just will be added to my mod, so I don't see the problem, with you uploading your creation. I am also kind of new here so I also don't know all the ins and outs here either, but my mod was created with the purpose of easily sharing creations with the community.


      When you create your mod page you just add my mod as a dependency and write that ATF is required.


      It would be best if you share you folder in the same file structure as my mod so people can install it easily.

      You just zip the /db/ folder which has all the files that you created and leave everything out that is already there in the default mod. There is no point in uploading it again and overwriting.

      For example your mod folder would have /db/ folder, in there is the /avatar/ folder, with your trader avatar and you would also have the /traders/ folder there. In the /traders/ folder is your new trader folder, with all the files you created.

      So someone just has to put your /db/ folder into the Advanced Trader Framework folder and everything is at the right place.


      I hope that kind of helps you out. If not just leave a comment again and I will try to respond within reasonable time.

  • the new profile picture for my trader isn't showing up. I get the following error in the launcher:


    [INFO] ATF: Debug: file doesnt exist:C:\Users\[REDACTED]\AppData\Local/Temp/Battlestate Games/EscapeFromTarkov/files/trader/avatar/NEWTRADER.jpg


    new profile pic is in the same folder as the other avatar pics you have in your mod folder, which also get the same error. Do i need to change the file location to match the error?

    • That error is just some debug message I forgot to disable. Don't pay to much attention to it.


      in the base.json you only have to change the filename, to the .jpg that you put in the avatar folder, if you copied the base.json.


      "avatar": "/files/trader/avatar/NEWTRADER.jpg",

      It should look like this.


      If you copied my ExampleTrader you only have enable Trader, modifyBase, and modifyAssort in the TraderConfig.json and change the ID in the base.json and TraderConfig. Then just edit the "avatar" line in the base.json like mentioned up top.


      if it still doesn't work it might be the .jpg, I don't really know if you can use .jpg that are too big.

      Try if my example works with the example images.


      If you still have problems after that, just let me know and I will try to look into.

  • Pretty new to all this, but I'm trying to get a trader to sell the parts he sells on the flea, so when i go to modify a preset, i can buy the parts from the new trader. I've got the trader working, all the stuff i want him to sell are available, but he's not selling it on the flea. Does your mod cover that by any chance? If so, how do I go about configuring it to do that?

    • I haven't really looked into the flea market stuff. That's a feature I forgot to add. I will look into it later and depending on how much effort it is to add that feature, I am either gonna update it later or it's gonna take some time.

  • Absolutely great mod, very easy to use and works like a charm.


    One question: I'm planning on creating trades that represent hideout crafts (e.g. 2 Alyonka → Sugar) which works, but it's not FiR obviously.

    Is there a way to change the items you buy from a specific trader, not all, to be FiR?

    • I don't really know. I think the KMC Server value modifier has an option, that makes all traded items FiR, that's pretty much all I know about FiR. I haven't looked into the FiR item status, but I am working on a hideout customization mod, that lets you modify crafts and the requirements for each workstation. (gonna take some time, because I am quite busy for now)


      I don't really know why you want to recreate hideout crafts with traders, but if its because of the long crafting time of some items. You should be able to find a mod that reduces the crafting time.

  • how do i make my trader sell guns its confusing

    • For that, you best use the export preset functionality. First make a preset of the gun you want to sell with all the parts you want. Then save it with the name including "export", for example name it "exportMyNewAk74NTrade" or something like that. On the next server start my mod looks at all the profiles and grabs all the preset containing "export" in the name. Your new Trade should be in the /utility/exportedPresets/ folder. The default cost will be 1 Bit coin and 1 roler watch and will be sold at trader Loyalty Level 1.

      You have to change that manually in the file. Under the section "barter_scheme" there are 2 entries. with _tpl and count, with the _ tpl being the ItemID you have to change and with the count being the number of times you needing that item to be bought. To sell the new weapon at different Loyalty level you have to change the number at the "loyal_level_items" section.

  • when i fixed the trader problem and stuff nothing loads in and theres a error in my server and the trader is stuck in loading??? how fix

    • I can't really help you if I don't know what kind of error your having. I can only guess what the problem might be. Most likely there are either multiple Traders with the same ID, or you have 2 trades with the same tradeID in a Trader. If the error is "unexpected token } " or something like that, that means one of the .json file wasn't edited correctly.

  • i installed the mod but i do not see my traders ingame where do i have to put the traders??

    • The new Traders have to be in the /traders/ folder where all the others are. The traders need to be enabled to be active. NOTE: make sure that each Trader has a different ID. For each Trader you have to change the ID in the base.json and in the TraderConfig.json to the same unique ID.