AlmostLuckyDucky Posted June 26, 2017 Share Posted June 26, 2017 After playing avorion for a little while it seems to me the trading aspect is missing something and i wanted to know if there was a way to add more items and trades for these items to exsisting stations as well as new modded stations but i am not sure thats actualy possible yet. i have previously made mods for Space Engineers & Rimworld so know enough to get myself into trouble but not enough to make what i have in mind.. well.. not yet anyway. Link to comment Share on other sites More sharing options...
bzy-xyz Posted June 26, 2017 Share Posted June 26, 2017 The list of all trade goods is defined in `lib/goodsindex.lua`, which populates a table `goods`. If you can arrange for your trade good descriptor to be present in this table when `TradingPost.initialize()` calls `TradingManager:generateGoods()`, then trading posts will potentially buy and sell your good. To be eligible to be produced by some factory you have to also arrange for a production descriptor to be present in a table `productions`, defined in `lib/productionsindex.lua`, when `Factory.initialize()` is called. The population code for both tables is autogenerated by something we don't seem to have, but it's easy enough to extend both tables without modifying the original population code (e.g. by arranging for files that extend them to be require()'d in the appropriate places). I don't guarantee that this is all you need to do, but looking at the code that seems to be the gist of it. If you want some station to have more complex defined behavior, copy `entity/stationscripttemplate.lua`, make it do what you want, and then arrange for it to be added to your new station type when a sector generator script (or something else) creates it in the world. Link to comment Share on other sites More sharing options...
AlmostLuckyDucky Posted June 27, 2017 Author Share Posted June 27, 2017 thanks :) Is there a table of what goods a factory/station will buy as i looked in the productionsindex.lua and it looks like some of the productions are specific to a station ie wool=clothes which can be edited to increase the required items or finished goods but not what the actual clothes factory will purchase.. the same goes for mines/farms.. ie if you wanted a factory to do more than just buy sheep for example and sell fabrics.. i assume the productionsindex.lua can be edited so it consumes sheep and produces not only fabrics but another item as well but it could also buy other items for another production process. So a clothes factory for example would use fabrics to make clothes but if leather was also present it would make clothes from that too. Link to comment Share on other sites More sharing options...
bzy-xyz Posted June 27, 2017 Share Posted June 27, 2017 Factories purchase the ingredients necessary for the production they've been assigned. A given good can have multiple productions yielding it as a result, but as far as I can tell the vanilla Factory chooses exactly one at construction. So in your example you could end up with a station that produces clothes from only fabric, or clothes from only leather, or clothes from fabric that consumes leather if present (via the optional flag), but not a station that produces clothes from fabric and clothes from leather as independent processes. If you wanted a single station that could run multiple independent productions on its own, you'd likely have to produce something that looks like the vanilla Factory (`entity/merchants/factory.lua`) but with appropriate extensions to support multiple production recipes. Or somehow change the existing factory.lua to be smart enough to do The Right Thing when added multiple times to an Entity. Trading posts choose sold goods arbitrarily at construction. Link to comment Share on other sites More sharing options...
AlmostLuckyDucky Posted June 27, 2017 Author Share Posted June 27, 2017 ah i see thanks very much :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now