djmango / BlackMarket2

A mod for Factorio economics
https://mods.factorio.com/mod/BlackMarket2
GNU General Public License v3.0
18 stars 12 forks source link

Error placing Buy Chest. (Source of Issue Found) #27

Open SkornClaw opened 4 years ago

SkornClaw commented 4 years ago

Found Source of issue for the following error The mod Black Market 2 (2.0.4) caused a non-recoverable error. Please report this error to the mod author.

Error while running event BlackMarket2::on_built_entity (ID 6) BlackMarket2/control.lua:2057: attempt to index field 'coal' (a nil value) stack traceback: BlackMarket2/control.lua:2057: in function <BlackMarket2/control.lua:2010>

I have noticed that when I first place the sell chest sometimes both stone and coal when pressing the 'Evaluate' Button will come back with 0, and I have to re-scan the market until they come back with prices, In one save this took several times, but I was saving the game after every research to see if it was research/mod related, but it has to do more with the way the game is giving the price to 'coal'. If there was any mod that might be impacting this I believe it might be 'Deadlock's stacking because I used noxy's stack size multiplier before, but when I added this mod, this issue crops up every once in a while and I think its because its somehow "Dodging" the scan. At any rate i've spent over 7 hours tracking down the source of this bug, and I can confidently say it has something to do with the way stone, and coal (The base resources themselves) are "scanned" into the market. Once these can be evaluated for more than 0 the buy chest will always place correctly and never throw the error again in that save. BUT if they evaluated at zero, that's when the error gets thrown.

Went back to try to source out the error more, I don't think the prices can be scanned into the market for the first time for the base resources when deadlock's stacking level 1 has not been researched yet. So this is BOTH related to a research gating the base items from being scanned in, until you have Deadlock's Stacking Level 1 Researched, Black Market Will not work. THIS IS FOR SURE THE SOURCE OF THE CONFLICT, Deadlocks Stacking (from the deadlock's Stacking Belt boxes and loaders) mod-pack, research gates your mods ability to scan the base resources for copper, Iron, coal and stone, and with Coal being indexed as null it throws the error when placing the buy chest. I have triple checked the source of this error, and can confidently trace it back to NOT having done this research, and then running the scan (Went back 30 minutes from before i found source from one of my many saves i was taking to resolve issue, and found that it is BOTH gated by the research and the lack of ability to scan those base resources into the market without deadlocks stacking 1 having been researched). I have now triple confirmed this with two other fresh starts, So longs as you have deadlocks stacking level 1 researched, and black market researched, it will work without errors. Deadlocks Stacking Level 1 research is the source of the issue for your mod that people have been having conflicts with.

Fresh Start With Mods2.zip

This save throws the error.

More than that if you want to re-create the error yourself, Load a new game with this modpack, and these map settings.

eNpjZEAAewaGA/acLMn5iTmrV62yY2BoAIowOHAl5xcUpBbp5 helIgtzJheVpqTq5meiKk7NS82t1E1KLE6FCEGwSEZxbopuelFiW WZJYl5maS7CNBBosOfILMrPQ7eCtbgkPw9VpKQoNbUYyLAHioJN5 i4tQjMQopKB0Tdeu72hRY4BhP/XMyj8/w/CQNYDoDwIMzA2AFUDV QLFoIBFIjk/r6QoP0e3OLWkJDMv3SqxtMIqKTOxmFPXQM/QAAQ0s ClJK0otLE3NS660yi3NKcksyMlMLeIw0gNrMJBF15Gbn1lcUlqUC jaZA2iwKUiZLk5lWE031DMGA9bknMy0NAYGBUcgdgL7i5Fxh1zr6 8Ad8+wZIf7Sc2D8Dwb8DhCRA0lQBoMnlOEwH7dUP0zEBMkciO2f7 RGMapF17g+rSoCWQpVzOCAYEMkWkCQjY7xkqvuXmuV2jH9Wfrzkm 5Rgz+ixfs+sT9e77IDS7CAvMMGJWTNBYCfMKwwwMx/YQ6Vu2jOeP QMCb+wZWUE6RECEgwWQOODNzMAowAdkLegBEgoyDDCn2cGMEXFgT AODbzCfPIYxLtuj+0PFgdEGZLgciDgBIsAWwl3GiAgwB3mYrCRCC VC/EQOyG1IQPjwJs/Ywkv1oDlFBighMf6CJqDhgiQYukIUpcOIFM 9w1wPC8wA7jgVIDM4gBUvUFKAbhgXMW1CgILeDAjFSEfLBnWFz8N xwA5Tj8Kw==<<<

Then start a new game yourself and use cheats (set QOL bonus in mod settings while playing to 9999 bonus mining/crafting speed or just add resources you need with)

/c game.player.insert{name="iron-plate", count=10000} /c game.player.insert{name="copper-plate", count=10000} /c game.player.insert{name="automation-science-pack", count=10000}

Race your research (I've removed any mods gating it)

and place the buy chest before placing a sell chest or scanning the market to re-create this error.

Research deadlocks stacking level 1 and you'll notice you can scan and place buy chest fine after.

Still love your mod which is why i've been hunting down the source of this issue.

image

You'll notice there are no prices for Stone/Coal or several of the ores in fact.

Vs

image

djmango commented 3 years ago

Thanks so much for providing all the details, this is much appreciated. I'm going to add this incompatibility into the mod manifest.

Fatmice commented 3 years ago

This affects liquids as well. If you place a sell tank down without having researched at least the oil related stuff, it will null error out.

djmango commented 3 years ago

This affects liquids as well. If you place a sell tank down without having researched at least the oil related stuff, it will null error out.

Is this specific to deadlocks?

Fatmice commented 3 years ago

I think so. An easy solution is simply only allow the blackmarket tech to be unlocked later; after both the simple oil cracking and deadlock stack 1 tech have been researched.

I'll test this again in a scenario.

marcoboy123 commented 3 years ago

Have a suspicion, im not playing with Deadlocks Mod, but with "Miniloaders" might be the exact same issue? https://mods.factorio.com/mod/miniloader

Dont know really yet where the problem lays, but i definetly have not Deadlock installed and have the same issue, even after having researched the first Loader tier in the Miniloader mod