Description

Who's a good little boy? Not Sidorovich! This is a script to extract all traders' prices for all items. There's also a link to my spreadsheet to compare Anomaly 1.5.2 prices.

Preview
[1.5.2] Banjaji's Price extractor
Post comment Comments
Banjaji Author
Banjaji - - 389 comments

[Notice board]

The spreadsheet: Docs.google.com

There's point to using the script itself if there's new data (new Anomaly version or a mod).

Reply Good karma+2 votes
badgerwaffleton
badgerwaffleton - - 12 comments

FATAL ERROR

[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_pcall_failed
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 206
[error]Description : fatal error
[error]Arguments : LUA error: ...y 1.5.2/bin/..\gamedata\scripts\banjaji_extractor.script:203: attempt to index local 'file' (a nil value)

stack trace:

Happens every time. On new game and loading older saves. Through MO2 and modded exes. With or without any mods.

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

I'm guessing lua can't open output_file because there isn't a folder for it or the folder doesn't have write permissions for Anomaly. Did you modify the variables in the script (2nd point under instructions here)?

Reply Good karma+1 vote
badgerwaffleton
badgerwaffleton - - 12 comments

Yes, didn't save it though, lmao.
Doesn't seem to run though. Unsure what "Try it with only one category first to test output!" exactly entails and do not have the time to mess around with that on my own right now. I'm guessing I just have to give the script the instructions on what to look for, I just have no idea what that'd be.
I assume I'm missing something obvious here?

Reply Good karma Bad karma+1 vote
Banjaji Author
Banjaji - - 389 comments

It's okay, extracting the data again is useful only if you have a mod that changes trade prices in LTX files.

Only thing you actually need to do is change
local anomaly_path = "D:/Games/Stalker Anomaly"
into your Anomaly install path.

Otherwise (optionally) to do a quick test you can write eg
local check_categories = {"w_melee"}
because that category only has about 10 sections.

Reply Good karma+1 vote
badgerwaffleton
badgerwaffleton - - 12 comments

Okay, so I got it working. It didn't want to run when I had E/ the first time so had to reinstall the add-on in MO2 and then it worked (for some reason, checked the two scripts in winmerge and they were identical). it does however crash before fully finishing.

FATAL ERROR

[error]Expression : <no expression>
[error]Function : CScriptEngine::lua_pcall_failed
[error]File : ..\xrServerEntities\script_engine.cpp
[error]Line : 206
[error]Description : fatal error
[error]Arguments : LUA error: ...y 1.5.2/bin/..\gamedata\scripts\banjaji_extractor.script:305: attempt to perform arithmetic on local 'multiplier' (a nil value)

stack trace:

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

It's about a broken price in a trader file (existing, but broken). I'm assuming you're dealing with a mod. A fix is to write the following on line 304:

if not multiplier then
printf("Error| Trade price broken. Item: %s, trader: %s buy/sell: %s", item, trader, buy_sell_str)
multiplier = 1
end

If it's a mod that you're making then the error is actually a good way to point you to a right direction. You can bring the variable "trader" to that function through function arguments from line 241 and 242.

But I'll update the mod with the quick fix some time in the future.

Reply Good karma+2 votes
alfredoh
alfredoh - - 8 comments

The spreadsheet confirms something I found out some time ago. Go to the Train Depot in Garbage and buy a fracture hand from Butcher for 220. Sell it back to him immediately and you have 280. Bug or (cheating) feature?

Reply Good karma Bad karma+2 votes
Banjaji Author
Banjaji - - 389 comments

Only as long as you have progression difficulty settings on easy mode or similar values. Increase buy factor and decrease sell factor and you won't be making a profit anymore.

Reply Good karma+1 vote
ltsobachiy
ltsobachiy - - 163 comments

Oh boy, maybe I can finally put together a proper starting loadout, which uses in-game prices instead of that point-based BS...

And can I just say: HOLY COW THATS A LOT OF PRICES!

Anomaly rules! You rule!
(wow I'm really showing my age as an '80s kid... gotta see a therapist lol)

Reply Good karma Bad karma+3 votes
Banjaji Author
Banjaji - - 389 comments

But if you do make a mod to convert the loadout points to prices (assuming it doesn't already exist) then don't hardcode! As in you can even copy-paste my code to import the price instead of just taking it from the extracted data. Otherwise small change like an update of Anomaly may break your mod.

Reply Good karma+1 vote
2vlado
2vlado - - 16 comments

I would love to have a similar script that extracts detailed weapon stats or at least a script that shows much more detailed weapon stats in-game (degradation, bullet-drop, recoil, time to reload, etc.)

Reply Good karma Bad karma+2 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: