New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: A station:AddEquipmentPrice(equip,money) #2654
Comments
As far as I can tell from a short view at the code, |
Branch > station:GetEquipmentPrice("PLASTICS")
13.92
> station:SetEquipmentPrice("PLASTICS", 123.45)
> station:GetEquipmentPrice("PLASTICS")
123.45
> station:SetEquipmentPrice("PLASTICS", nil)
> station:GetEquipmentPrice("PLASTICS")
13.92 @impaktor can you please take a lok and tell me if this is suitable? If it is I'll get it cleaned up and documented and tneh push it. |
Awesome. Will try it out. Thanks. |
Thanks! I've tested it and it works for both when increasing and decreasing price (not surprisingly). However, I thought it wise to see if it would persist in saves from a station where I make a price change.
Also, I'm not using the nil functionality of it, but maybe it will be handy to have in the future. (I get the price, then change it with some factor.) EDIT: I will have something runnable in my NewsEvent branch in 5-6 hours (~09:00 AEDT) if you need to test. |
Yeah, the save thing was me not clearing the table out at system destruction, so it still had refs to stations in the previous system that no longer existed. Thanks for reporting that. Fixed and merged the whole thing! |
I've been working on implementing something I call "News Events", that will affect prices (and stock) of specific commodities in some system based on some News reported (on the BBS) from there. I'm almost done, but I find I need to actually be able to change the price of some commodity at a station, i.e. I need a
station:AddEquipmentPrice(equp,money)
to go with the already implementedstation:AddEquipmentStock(equp,stock)
.I've looked a bit in
EquipmentTradeWidgets.lua
andCommodityMarket.lua
, but could not see any obvious way to do it, with my current (lacking) understanding of the code.(it does not have to persist across hyperjumps.)
Alternatively a
SetCommodityBasePriceAlterations
would probably also work.The text was updated successfully, but these errors were encountered: