Mega Black Market is a Factorio mod that introduces an advanced economic system, allowing players to buy and sell items, fluids, and energy through a universal black market.
Providing the player with new tools or adjusting the game interface, without fundamentally changing gameplay.
Entities which interact with the circuit network.
Changes to power production and distribution.
More than just chests.
SEND BUGS REPORT AND HOW TO RECREATE THEM
had a sell chest to automatically sell when own inventory was = 160, item filter set for barrels of sulfuric acid
The mod Mega Black Market (1.0.3) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event MegaBlackMarket::on_tick (ID 0)
LuaGuiElement API call when LuaGuiElement was invalid.
stack traceback:
[C]: in function 'newindex'
__MegaBlackMarket/control.lua:766: in function 'gui_sell_all'
MegaBlackMarket/control.lua:1421: in function <MegaBlackMarket/control.lua:1363>
had a sell chest to automatically sell when own inventory was = 160, item filter set for barrels of sulfuric acid
The mod Mega Black Market (1.0.3) caused a non-recoverable error.
Please report this error to the mod author.Error while running event MegaBlackMarket::on_tick (ID 0)
LuaGuiElement API call when LuaGuiElement was invalid.
stack traceback:
[C]: in function 'newindex'
__MegaBlackMarket/control.lua:766: in function 'gui_sell_all'
MegaBlackMarket/control.lua:1421: in function <MegaBlackMarket/control.lua:1363>
FIXED
Tested and confirmed fixed, thank you.
i have an error everytime i click the sell button
Error while running event MegaBlackMarket::on_gui_click (ID 1)
Only callable on choose-elem-button.
stack traceback:
[C]: in function 'newindex'
__MegaBlackMarket/control.lua:803: in function 'gui_sell_all'
MegaBlackMarket/control.lua:1421: in function <MegaBlackMarket/control.lua:1388>
or if i set it to auto sell
Error while running event MegaBlackMarket::on_tick (ID 0)
Only callable on choose-elem-button.
stack traceback:
[C]: in function 'newindex'
__MegaBlackMarket/control.lua:803: in function 'gui_sell_all'
MegaBlackMarket/control.lua:1738: in function <MegaBlackMarket/control.lua:1680>
working on it
With other mods installed there might be this error aswell.
this happend while trying to place a furnace from this mod
Electric Furnaces Revamp
by AJBradburn
Error while running event MegaBlackMarket::on_player_cursor_stack_changed (ID 32)
MegaBlackMarket/control.lua:1357: attempt to index field '?' (a nil value)
stack traceback:
MegaBlackMarket/control.lua:1357: in function 'show_custom_tooltip'
MegaBlackMarket/control.lua:1366: in function <MegaBlackMarket/control.lua:1361>
Edit:
beside these errors i love the idea and implementation of the gui revamp
makes it way more enjoyable
With other mods installed there might be this error aswell.
this happend while trying to place a furnace from this mod
Electric Furnaces Revamp
by AJBradburnError while running event MegaBlackMarket::on_player_cursor_stack_changed (ID 32)
MegaBlackMarket/control.lua:1357: attempt to index field '?' (a nil value)
stack traceback:
MegaBlackMarket/control.lua:1357: in function 'show_custom_tooltip'
MegaBlackMarket/control.lua:1366: in function <MegaBlackMarket/control.lua:1361>Edit:
beside these errors i love the idea and implementation of the gui revamp
makes it way more enjoyable
i have an error everytime i click the sell button
Error while running event MegaBlackMarket::on_gui_click (ID 1)
Only callable on choose-elem-button.
stack traceback:
[C]: in function 'newindex'
__MegaBlackMarket/control.lua:803: in function 'gui_sell_all'
MegaBlackMarket/control.lua:1421: in function <MegaBlackMarket/control.lua:1388>or if i set it to auto sell
Error while running event MegaBlackMarket::on_tick (ID 0)
Only callable on choose-elem-button.
stack traceback:
[C]: in function 'newindex'
__MegaBlackMarket/control.lua:803: in function 'gui_sell_all'
MegaBlackMarket/control.lua:1738: in function <MegaBlackMarket/control.lua:1680>
Fixed all two bugs
Awesome, just tested and its working.
just another question i was thinking about something today and im up to get into modding myself, but i have not that much experience in it,
but since your fast response to this i might just ask if you are interested in some mod "idea" i had today.
if you are interested
xD it's just for fun....when factorio 2 come, the original mod was a bit too late for update... and then i decide to start learning factorio api and made 70% of mod from scratch, remaining 30% is the original mod Black market 2 and his price calculate system
i see, i have some belt idea but im far from even know how to start so i just asked ^^
sorry for this.
happened while clicking add order on buying chest
Error while running event MegaBlackMarket::on_gui_click (ID 1)
MegaBlackMarket/control.lua:664: attempt to concatenate field '?' (a nil value)
stack traceback:
MegaBlackMarket/control.lua:664: in function 'gui_add_order'
MegaBlackMarket/control.lua:682: in function 'gui_add_new_order'
MegaBlackMarket/control.lua:1496: in function <MegaBlackMarket/control.lua:1479>
xD add me on discord : ZeroAinz i will give to you the testing versions
I absolutely love the concept of this mod, but I sadly got an error message when I hit ctrl+c:
157.524 Error MainLoop.cpp:1429: Exception at tick 3959796: The mod Mega Black Market (1.0.6) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event MegaBlackMarket::on_player_cursor_stack_changed (ID 32)
MegaBlackMarket/control.lua:1470: attempt to index field '?' (a nil value)
stack traceback:
MegaBlackMarket/control.lua:1470: in function 'show_custom_tooltip'
MegaBlackMarket/control.lua:1482: in function <MegaBlackMarket/control.lua:1477>
294.896 Info AppManager.cpp:339: Deleting active scenario.
295.868 Quitting: user-quit.
296.323 Steam API shutdown.
296.329 Goodbye
can you give a mod list if you have it and it appears every time or some times?
To answer your question, this happens every time I press ctrl+c
Got three for ya:
Typo in control.lua on ln 1816 and ln 1822, nill
instead of nil
.
ngl I still reflexively type null
like every other language when I have to work in lua, so I get it lol
Error while running event MegaBlackMarket::on_tick (ID 0)
LuaGuiElement API call when LuaGuiElement was invalid.
stack traceback:
[C]: in function '__newindex'
__MegaBlackMarket__/control.lua:929: in function 'gui_sell_all'
__MegaBlackMarket__/control.lua:1856: in function <__MegaBlackMarket__/control.lua:1798>
Triggered when an autosell goes off while any other market is open
The issue: gui_btn_sold
isn't reliably falsey, and market_opened
is the opened market, not whether the currently-open market is the market doing the sale.
Easy example fix, something like hoisting market_opened == market
to a local in the on-tick fn and replacing all current refs to market_opened
to reference the new local.
Error while running event MegaBlackMarket::on_player_cursor_stack_changed (ID 32)
__MegaBlackMarket__/control.lua:1470: attempt to index field '?' (a nil value)
stack traceback:
__MegaBlackMarket__/control.lua:1470: in function 'show_custom_tooltip'
__MegaBlackMarket__/control.lua:1482: in function <__MegaBlackMarket__/control.lua:1477>
Triggered when holding a Factorissimo 3 factory building that has already been built
-- This is probably triggered whenever any super-custom modded entity gets picked up
-- Also probably the same error as HollowN
Crash fix:
add to conditional on ln 1481:: and storage.prices[cursor_stack.name]
Fixing beyond just crash (like, evaluating everything in the factory object) I'll leave to you.
Got three for ya:
Typo in control.lua on ln 1816 and ln 1822,
nill
instead ofnil
.
ngl I still reflexively typenull
like every other language when I have to work in lua, so I get it lol
didn't see that :),tnx
Error while running event MegaBlackMarket::on_tick (ID 0) LuaGuiElement API call when LuaGuiElement was invalid. stack traceback: [C]: in function '__newindex' __MegaBlackMarket__/control.lua:929: in function 'gui_sell_all' __MegaBlackMarket__/control.lua:1856: in function <__MegaBlackMarket__/control.lua:1798>
Triggered when an autosell goes off while any other market is open
The issue:gui_btn_sold
isn't reliably falsey, andmarket_opened
is the opened market, not whether the currently-open market is the market doing the sale.
Easy example fix, something like hoistingmarket_opened == market
to a local in the on-tick fn and replacing all current refs tomarket_opened
to reference the new local.
the fix for this upper a line of 909,921,929 check if market_opened == market(wich is in function)
Error while running event MegaBlackMarket::on_player_cursor_stack_changed (ID 32) __MegaBlackMarket__/control.lua:1470: attempt to index field '?' (a nil value) stack traceback: __MegaBlackMarket__/control.lua:1470: in function 'show_custom_tooltip' __MegaBlackMarket__/control.lua:1482: in function <__MegaBlackMarket__/control.lua:1477>
Triggered when holding a Factorissimo 3 factory building that has already been built
-- This is probably triggered whenever any super-custom modded entity gets picked up
-- Also probably the same error as HollowN
Crash fix:
add to conditional on ln 1481::and storage.prices[cursor_stack.name]
Fixing beyond just crash (like, evaluating everything in the factory object) I'll leave to you.
that is the fix but in a other way before the if....it's because some times you pic a tool or not an item object and it isn't priced
if storage.prices[item_stack.name] then
if item_stack.quality then
storage.market_money_gui[player.index].lbl_money_counter.caption = format_money(get_price_quality(storage.prices[item_stack.name].current, quality_type[item_stack.quality.name]+1))
else
storage.market_money_gui[player.index].lbl_money_counter.caption = format_money(get_price_quality(storage.prices[item_stack.name].current, 0))
end
end
i dont know if this has something to do with having black market (the original) installed but inactive but when i start a py game i can only buy stuff i got the tech for and when i go to settings, remove the mark in the options, and add it again and then click on the buy chest i get a crash so it seems to be incompatible with py.
i dont know if this has something to do with having black market (the original) installed but inactive but when i start a py game i can only buy stuff i got the tech for and when i go to settings, remove the mark in the options, and add it again and then click on the buy chest i get a crash so it seems to be incompatible with py.
same thing happended to me like the previous reply.
Bug Report:
Error while running event MegaBlackMarket::on_gui_opened(ID 95)
Mega.../control.lua:624: attempt to index field '?'(a mil value)
Mega.../control.lua:624:in function 'gui_update_prices'
...lua:727:in function 'gui_update_orders'
...lua:1114: in function 'draw_menu'
that's it.
fixed with last update, waiting for feedback ;)
works now in py but stuff that i noticed so far that is missing and desparately needed:
an overview tab over items where i can check prices without having to check a buy box (like in the other mod when clicking the money icon)
a settings tab to recalculate prices (like the other mod has when clicking the gold coin). i tried to configure it a bit to test different price modes for py stuff and noticed that i dont know how to get the prices to reflect my changes. in the other mod i just click recalculate prices and all is done.
also, basically same issue as the other mod, for py, there are like 200 fluids/gases or so and ive just checked a little bit but the issue is the same as in at least half of them only have a base price of an unknown resource instead of something realistic. this breaks a lot of the resource chains for later products that rely on them.
e.g. an item with recipe depth 6 can cost 150 million but with recipe depth 7 it costs 20 (basic unknown price). this creates a lot of problems when trying to find good recipes to build because there is a huge gap between some items that should be similar in cost but arent. also, especially for py, i noticed with the other mod that the calculations for stuff that uses items in the building to create more of them (e.g. most of the plants and animals from alien life addon) have weird calculations. it probably has to do with there being multiple ways to get them (for the initital setup and then for the actual breeding). no idea if that can be fixed though
both mods defines original resources with a price and then they calculate the other recipes price....with py, with his tons of new resources....they aren't priced and i don't lknow how to estimate their price, this is the problem for the price...for now i can just post a update with a setting to set resource,items price to what you want
Two bugs encountered so far:
1: When playing multiplayer (2 players), there is a purchase box that becomes an invincible item after placing it, you cannot interact with any item after triggering the bug, and when interacting you open the interaction interface and then close it directly.
2: There is a probability that clicking repeatedly in the purchase interface will cause the game to crash.
not a bug report per se but im wondering how feasible it is to make 2 options, one that disabled everything except buildings, that way you cant "cheat" your production lines but you can use the mod as a QoL alternative to a mall. and that QoL is huge!
and maybe a second option that disables all (but buildings when enabled) except science.
the first one would be epic and the second one would be neat to have.
wokring on this https://mods.factorio.com/mod/MegaBlackMarket/discussion/67392f14fa862941692dc1e9 ... this maybe will suit your case, and with taht will be a greater compatibility with other mods
updated, get a try
okay tested it on a new save and the feature is great! two things i noticed elsewhere though.
the other mod has a button to update prices (useful after changing settings). it seems you auto update the prices after changes but im not 100% sure. sometimes i change stuff but some prices dont change and im not sure if its not auto applied correctly or something. maybe its just a different reason but not having the price update button makes me wonder if something is not working right as there is no immediate feedback after changes that i notice.
the other thing is that in a running save i changed the tax rate (and recipe depth) and as soon as i quit the options the game crashes / i get an error. when i check in main menu the tax rate and recipe depth are the changed value but when i load the save the old values were back and changing them again leads to a crash again. i started a new game and in a new game the new values (the ones the main menu shows) are applied.
and one option that might be neat would be to disable buying higher quality items or even better, be able to select which tiers are buyable and which arent (e.g. have only tier 1-3 buyable but not tier 4-x(in case of mods adding more tiers))
Will work on this
okay tested it on a new save and the feature is great! two things i noticed elsewhere though.
the other mod has a button to update prices (useful after changing settings). it seems you auto update the prices after changes but im not 100% sure. sometimes i change stuff but some prices dont change and im not sure if its not auto applied correctly or something. maybe its just a different reason but not having the price update button makes me wonder if something is not working right as there is no immediate feedback after changes that i notice.the other thing is that in a running save i changed the tax rate (and recipe depth) and as soon as i quit the options the game crashes / i get an error. when i check in main menu the tax rate and recipe depth are the changed value but when i load the save the old values were back and changing them again leads to a crash again. i started a new game and in a new game the new values (the ones the main menu shows) are applied.
and one option that might be neat would be to disable buying higher quality items or even better, be able to select which tiers are buyable and which arent (e.g. have only tier 1-3 buyable but not tier 4-x(in case of mods adding more tiers))
1# fixed
2# fixed
3# idea in work - next update (to night)
Two bugs encountered so far:
1: When playing multiplayer (2 players), there is a purchase box that becomes an invincible item after placing it, you cannot interact with any item after triggering the bug, and when interacting you open the interaction interface and then close it directly.
2: There is a probability that clicking repeatedly in the purchase interface will cause the game to crash.
1# fixed
2# i'cant replicate it....it's hard...try to update to last version
fixes in next update
Updated with fixes + new feuture
gonna test the new feature in a couple of hours. one more thing that i noticed is that for automatic sell to work you HAVE to set the filter on what to sell. thats a slight bit annoying when i dont really care whats in the chest and just want him to sell everything thats in it. maybe have a toggle for "sell all" for the automatic option so you dont have to filter it (and maybe make it default as well as otherwise, i already thought it was bugged :D)
okay so quality is blocked now, thats good. but im playing on 100x science so it might be a while until i unlock the first quality for anything so i would like to ask on how this works exactly. say, i managed to build a legendary gun turret. can i now buy legendary gun turrets, or everything legendary? and how does it work when qualities are skipped (with high quality % from mods for example)? do you get the inbetween qualities unlocked as well or only the one you got? either would be fine but i would like to know how its supposed to work :)
edit: nvm i guess i got hoe it works. by checking if the tech that unlocks that quality is unlocked and then unlocks all items of that quality as well. would be cool to have to unlock it per item, as in you need to produce one of that quality and then unlock it, but thats probably a bit too much to ask for
i just remembered something else that is kinda important and missing. an overview over sales / buys.
to be able to calculate how much money im earning per real game minute / second / hour i now need to check every single chest and check how much it sold. but it only says total and not last period or something.
the best obviously would be to have it integrated into the production statistics panel but i dont know if thats even possible at all.
second best would be to have a button to open a window that shows the total value of buys / sells in the last real life second, minute and hour of all chests. bonus points if you can filter it and get total statistics for certain items etc, which might be useful when having very large or multiple factories producing the same thing and you want to check how well that product is doing vs another one.
i guess you get the idea :)
Hi I just got the update a bit ago and now get this error:
Error while running event MegaBlackMarket::on_tick (ID 0)
LuaEntity API call when LuaEntity was invalid.
stack traceback:
[C]: in function 'index'
__MegaBlackMarket/control.lua:1855: in function 'calculate_signal_value'
MegaBlackMarket/control.lua:1890: in function <MegaBlackMarket/control.lua:1878>
Is it possible to roll my version back a little bit?
Well crap... I can't reproduce it anymore! I think it may have been a problem with my computer, I have a habbit of waiting a couple of weeks between restarting. It restarted itself while I was at work and suddenly I don't get the crash anymore. If it matters I was simply doing nothing, but the ID 0 implies to me it's because I have all of my selling chests refer to variable 0 == 0 to determine to sell because I'm lazy.
xD fixed maybe the crash, but you can just pu a random item == 0 and sell automaticaly
another thing i noticed is that when i have a buy chest and i copy and paste its settings onto another one then it copies the current settings but when i change one of them later (either the first or the second, doesnt matter), it also changes the item / value / settings of the one i copied from. its nice that this is possible but imo it shouldnt be default and it should definitely be an option.
imagine when someone builds huge factory, copy pastes the chests and then rebuilds parts of it or adjusts them and suddenly all chests are changed. pure chaos, especially on very large builds
and please dont forget about the statistics window... not sure if you saw my previous comment :)
another thing i noticed is that when i have a buy chest and i copy and paste its settings onto another one then it copies the current settings but when i change one of them later (either the first or the second, doesnt matter), it also changes the item / value / settings of the one i copied from. its nice that this is possible but imo it shouldnt be default and it should definitely be an option.
imagine when someone builds huge factory, copy pastes the chests and then rebuilds parts of it or adjusts them and suddenly all chests are changed. pure chaos, especially on very large builds
and please dont forget about the statistics window... not sure if you saw my previous comment :)
Didn’t notice previous comment, wil work on it and on the bug
@TheGaijin87
edit: nvm i guess i got hoe it works. by checking if the tech that unlocks that quality is unlocked and then unlocks all items of that quality as well. would be cool to have to unlock it per item, as in you need to produce one of that quality and then unlock it, but thats probably a bit too much to ask for
a good idea...but it's hard to create xD, need to trace all created items(huge impact on performance i think)
i read your changelog but when putting a new chest down and selecting automatic, without inputting any item / signal in the field below it still doesnt automatically buy. not sure if thats whats supposed to be fixed but if it is, its not working for me
xD it was fixed but in next update(in a hour) it will work by just click automatic, all conditions will met 0 = 0 -> do stuf
awesome! :)
hmm, it seems my message from yesterday didnt get through. what i was saying is that it seems as if fluids dont get automatically sold. i had a tank trying to auto sell sulfurid acid and i can sell it manually but automatically nothing happened. not when selecting no item / condition, nor when selecting one. it only seems to work when selecting exactly the item thats in it (in this case sulfuric acid). as this is different from how chests work im assuming its a bug?
it's first time when you write about this bug xD, wil check it after the craft to buy mechanic(for items and quality)...better to say with that update i think i will fix it
okay i will check it out then. and another thing, that i also noticed with the original mod. im unsure if the recipe depth calculation is correct. there are items (although i noticed this mainly in py) where recipe depth 10 an item costs, say, 10 million, recipe depth 11 it costs 800k and recipe depth 12 it costs 25 million. as far as i understood it, recipe depth should be progressive. if a recipe has 15 steps, all steps up to recipe depth 15 should be progressive and depths >15 shouldnt change its value. but for py the prices sometimes vary wildly, higher or lower. im assuming this has something to do with unknown items being in the chain as sometimes it goes from like 10 million to 20 (or whatever the base for unknown items is) and next recipe depth higher or lower it changes to something normal again.
im not sure if this is also the reason why in my current playthrough, selling military science is worth 11k while the ingredients combined are worth 15k. shouldnt produced items always be worth more than their ingredients?
I have to be honest... this is the only thing left from the original mod code: the price evaluation... maybe the next big thing, is to rewrite that from scratch :| and show to the player unknown prices before at game start :/
hmm. im always getting expired csrf token errors on this mod portal, which is why my messages arent going through. weird
btw you can technically get infinite money (although very, very, very slowly). copy and paste something and save as blueprint, no matter what, sell the blueprint for 223$ with my current settings. 100% profit :D
xD you mean, desable blue print from selling
The mod Mega Black Market (1.2.0) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event
MegaBlackMarket :: on_player_main_inventory_changed (ID 35)
MegaBlackMarket /control.lua:2616: attempt to index a nil value
stack traceback:
MegaBlackMarket
< MegaBlackMarket
_/control.lua:2616: in function
/control.lua:2615>
When entering in blueprint lab from blueprint sandbox mod.
The mod Mega Black Market (1.2.0) caused a non-recoverable error.
Please report this error to the mod author.Error while running event
MegaBlackMarket :: on_player_main_inventory_changed (ID 35)
MegaBlackMarket /control.lua:2616: attempt to index a nil value
stack traceback:
MegaBlackMarket
< MegaBlackMarket_/control.lua:2616: in function
/control.lua:2615>When entering in blueprint lab from blueprint sandbox mod.
hmm. im always getting expired csrf token errors on this mod portal, which is why my messages arent going through. weird
btw you can technically get infinite money (although very, very, very slowly). copy and paste something and save as blueprint, no matter what, sell the blueprint for 223$ with my current settings. 100% profit :D
for now, if you enable unknow tech you can just go and sell energy, build bigger plants, sell more energy.... xD profit
getting error on selecting the item gui for what to buy
The mod Mega Black Market (1.2.1) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event MegaBlackMarket::on_gui_click (ID 1)
MegaBlackMarket/control.lua:1389: attempt to index global 'item_prices' (a nil value)
stack traceback:
MegaBlackMarket/control.lua:1389: in function 'draw_elem_gui'
MegaBlackMarket/control.lua:2196: in function <MegaBlackMarket/control.lua:1827>
getting error on selecting the item gui for what to buy
The mod Mega Black Market (1.2.1) caused a non-recoverable error.
Please report this error to the mod author.Error while running event MegaBlackMarket::on_gui_click (ID 1)
MegaBlackMarket/control.lua:1389: attempt to index global 'item_prices' (a nil value)
stack traceback:
MegaBlackMarket/control.lua:1389: in function 'draw_elem_gui'
MegaBlackMarket/control.lua:2196: in function <MegaBlackMarket/control.lua:1827>
it happen when i click equiment slot.
if i shit click to put equiment in it will be fine
but if i click on equiment grid it crash
The mod Mega Black Market (1.2.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event MegaBlackMarket::on_player_placed_equipment (ID 41)
LuaEquipment doesn't contain key valid_for_read.
stack traceback:
[C]: in function 'index'
__MegaBlackMarket/control.lua:1859: in function 'set_craft_to_unlock'
MegaBlackMarket/control.lua:2864: in function <MegaBlackMarket/control.lua:2862>
it happen when i click equiment slot.
if i shit click to put equiment in it will be fine
but if i click on equiment grid it crashThe mod Mega Black Market (1.2.2) caused a non-recoverable error.
Please report this error to the mod author.Error while running event MegaBlackMarket::on_player_placed_equipment (ID 41)
LuaEquipment doesn't contain key valid_for_read.
stack traceback:
[C]: in function 'index'
__MegaBlackMarket/control.lua:1859: in function 'set_craft_to_unlock'
MegaBlackMarket/control.lua:2864: in function <MegaBlackMarket/control.lua:2862>
dont know if this is a bug, intended, or not doable at all but the production window does show the amount of money earned (coins produced) but thats only the money you got from sales and doesnt include the money you lost from buys, so its not a real balance sheet. dont know if its possible at all to subtract bought coins from this so it shows real balance
also, i tried changing some science prices (mainly space science) but it wouldnt change anything after changing the values
In teory, it calculates the production consum, by subtracting from total money the new updated value and if it gets - it’s consumption and positive number it’s production, will check tonight the problem with science packs