Farm Services

Show off your mod creations or just a work in progress.
User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Farm Services

Post by John Doom »

:) New WIP mod to make farms sell goods.

FEATURES:
- you can buy ingredients from selected containers;
- compatible with my mod Acquisition, making possible to buy farms (make sure Farm Services has a higher priority than Acquisition);
- compatible with my mod Crafting, which adds food items.

TODO:
- less purely alchemy ingredients;
- sell;
- ?
Attachments
Farm Services.zip
(7.16 KiB) Downloaded 103 times
Last edited by John Doom on Thu Dec 23, 2021 4:52 am, edited 2 times in total.

User avatar
Magicono43
Posts: 1141
Joined: Tue Nov 06, 2018 7:06 am

Re: Farm Services

Post by Magicono43 »

I like the idea for having them sell ingredients and such, anything that can make the awfully impractical vanilla alchemy system less impractical is a good thing, and giving those small farm houses some more purpose.

User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Re: Farm Services

Post by John Doom »

:) Thanks for your reply. I've just updated the mod, now farms can sell modded items too.

User avatar
emmathepony
Posts: 248
Joined: Sat Jun 29, 2019 5:26 pm

Re: Farm Services

Post by emmathepony »

Is this mod compatible with Harvestable Crops?

User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Re: Farm Services

Post by John Doom »

Yes :)

andromacus
Posts: 113
Joined: Sat May 23, 2020 9:07 am

Re: Farm Services

Post by andromacus »

Hi there,

where I am supposed to click to see this mod in action (you mentioned containers, but I can't find anything new in farms once I have installed this)?
I gave higher loading priority to this mod compared to Acquisition.

Thanks for your help!

User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Re: Farm Services

Post by John Doom »

Check their wardrobes and furnitures :mrgreen:

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Farm Services

Post by Hazelnut »

Did you make any changes to the code copied from DaggerfallLoot.StockShopShelf() method? It occurs to me that if that method was refactored and split slightly you could simply call it rather than having the code copied into your mod? What do you think?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
John Doom
Posts: 126
Joined: Wed Dec 01, 2021 5:59 pm
Location: Italy
Contact:

Re: Farm Services

Post by John Doom »

Hazelnut wrote: Wed Jan 12, 2022 5:42 pm Did you make any changes to the code copied from DaggerfallLoot.StockShopShelf() method? It occurs to me that if that method was refactored and split slightly you could simply call it rather than having the code copied into your mod? What do you think?
I think it was mostly to bypass its switch, because farms aren't considered shops by the game. That method was either private or couldn't be overriden, so I butchered it :lol:
I don't know about refactoring, do you mean reflections? As magicono I don't know this witchcraft yet :mrgreen:

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Farm Services

Post by Hazelnut »

John Doom wrote: Thu Jan 13, 2022 6:32 am
Hazelnut wrote: Wed Jan 12, 2022 5:42 pm Did you make any changes to the code copied from DaggerfallLoot.StockShopShelf() method? It occurs to me that if that method was refactored and split slightly you could simply call it rather than having the code copied into your mod? What do you think?
I think it was mostly to bypass its switch, because farms aren't considered shops by the game. That method was either private or couldn't be overriden, so I butchered it :lol:
I don't know about refactoring, do you mean reflections? As magicono I don't know this witchcraft yet :mrgreen:
Ah sorry, it's a software engineering term that I assumed you'd be familiar with since you've been kicking out code for mods without needing much help. Refactoring just means re-structuring the code without changing any of its behaviour. (nothing to do with reflection which is code discovery at runtime)

So in this case if the stocking method is split then your mod could call the inner method unless you changed any of the copied code. This simply means that you don't need to maintain the mod if the DFU stocking code is changed in the future. Also it could be useful for other mods as it's quite an ingenious and simple way to enable selling items other than the standard game stores, and it would e a shame if they all had to contain a copy of the stocking code.

I'll create a PR for DFU then, once I double check there's no changes.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply