-
Notifications
You must be signed in to change notification settings - Fork 70
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
Non hard-coded commodities #109
Conversation
(This won't compile, and probably will stay that way for a few commits)
(Doesn't work yet in all sorts of ways, of course)
Station and player commodities preserved over load/save properly System market actually used for the main station now
New JS method systemInfo.samplePrice(commodity) - get a sample price for a trade good in an arbitrary system Saves changing oolite-contracts-cargo for every change in the algorithm
More than we need for the rock hermits, but should give OXPers a bit of flexibility
...okay, I think this branch is now (inevitable bugs aside) back to providing about the same core functionality as it did before I started poking at it. Onwards...
- capacity can now be set per-station per-good - import and export legality per station - market_monitored = no; shortcut to make all goods legal
Works okay with keyboard - needs more work with mouse
Whee, I think I will make a Cargoes OXP as soon as this lands!
Does that mean we're getting the 8-loop? |
It means you can implement one in an OXP (in theory, anyway: I haven't extensively tested that bit of the pricing algorithm yet) |
manifest.information(good) / manifest.setInformation(good,info) allow in-game editing or "comment" property in trade-goods.plist
Give the "pirate" and "chaotic" rock hermits (both quite rare) slightly different markets, and the chance to find some interesting but low capacity deals.
Legality column is a placeholder
Now on F8 F8. Can buy and sell from the market info screen, and cycle goods with up/down Can't change filter or sort settings from marketinfo - it just uses what you had selected
Shift-buy/shift-sell will stop at the contracted level
Okay, I think this is about feature-complete, at least for now. Could people compile and test to make sure I've not missed anything, please. |
Windows compiles OK here. Just an observation, because I am not sure how it is supposed to work: Copying the food entry in trade-goods.plist into something like "Different food" and without changing anything else, does not give me any quantity of "Different food" in any of the save games I tried. Attempted duplicating lots of other goods entries, but I never seem to be getting any quantity of those modified goods in the main station. Is that how it is supposed to be? If so, how can I make it have a starting quantity like, say, normal food or computers etc? |
OK, it seems to generate quantities fine if I jump out and back in. I guess the reason it doesn't generate the goods on load game is because the market is already defined in the savefile and does not contain any of these extra quantities. If this is correct, then I guess all works fine here. |
Yes, when loading an existing save game the market will already be defined - but new goods will get generated anyway. At the moment, though, OOCommodityMarket:347 automatically zeroes the quantity of any good that wasn't in the save file. That may not actually be necessary - I think it's left over from when loadStationMarket and loadPlayerMarket were the same function. Taking that out would cause it to generate quantities for new goods immediately. |
I think this is about as done as it's going to get - shall we merge it? |
Affirmative from my side. |
This is probably ready for a bit of testing in a branch.
Note: will currently break Mac build because the
OOCommodities.m
andOOCommodityMarket.m
files aren't in the XCode project.Features:
Loads 1.80 savegames fine as far as I can tell, though doesn't produce savegames that 1.80 will read properly.
OXP compatibility:
commodities.plist
. Whether this is worth fixing depends on how many station OXPs get updated before 1.82illegal-goods.plist
will find that no longer works. That's only New Cargoes, so far as I know, and anyway, the documentation did warn against doing that.liquorWines
rather thanliquor_wines
) aren't supported