-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[WIP]NPC and player auto-crafting from workbench bills #34246
Conversation
Fixed some problems.
|
Been playing with it a fair bit, and cant detect any further problems. |
Woops managed to merge in some stuff I was working on with NPC repairing activity into this one. |
Updated a bit of a messy merge to new generic_activity structure, will test tomorrow. |
seems to still work ok , post-merge conflict resolutions, minus some shenanigans when NPCs are all pathing to adjacent spots to do their job at connected workbenches, and get in each others way, but thats normal for them. |
Was playing with this merged locally, and need to change the inventory code a bit - will do so post 0.E |
rebased. still think theres some performance problems , with the changes to the crafting code, but that can wait until its closer to merging time post 0.E anyway. |
Just wanted to say I am stupendously thankful for this and I can't wait to see this happen! Even though it doesn't include liquid crafting (my dreams of an NPC slave compound producing biodiesel from rendered tainted fat to feed my zombie-powered death mobile still won't be realised!) this is game changing and will make NPCs much, much more useful. If only they'd get back to work without being told to... 😉 👍 Seriously, this is absolutely brilliant, well done! |
I think I can do liquid crafting post 0.E, just need to decouple the "what to do with this liquid" code from being avatar-centric. And thanks! |
Regarding the recipes... Not sure if this might end up being a rabbithole or a nightmare in some way, but what about generating a new recipe list for individual NPCs and have those added to the workbench, too, with crafting limited to the ones who know how to do them? One approach would be to have targeted bills that only the named NPCs (or PC) can craft, or workbenches dedicated to an individual. With workbench dedication the nice touch would be that the in progress item wouldn't need to be intrinsically tied to one person (death issues) and could be reassigned relatively easily. Also, the recipe list could be limited intuitively to the character in question. Though I imagine these would all touch on a great many different areas of code, hence my disclaimer at the start. 😕 I'd love to see this kind of thing but I'm not sure how feasible it is. |
Currently, with this PR, unfinished items are not tied to any particular NPC. If that person walks away from the workbench, another NPC can slot in and finish the task ( if they have the skill for it ) as for reserved recipes/workbenches, I think maybe that might be useful in the future for static NPC bases, but as this PR is focused on player follower NPCs and basecamps, its not something Im going to focus on immediately. |
Well, I was suggesting those mostly as workarounds to allow the player to specify a recipe that they themselves can't craft. It's one of the lacking features that would allow me to set skill gain to 0.01x, and it's also something that's generally bugged me from functionality and RP perspectives. The other thing that's missing is having NPCs build and modify vehicles from dynamic player made templates. Still, I'm really excited to test all these out! 😁 Roll on 0.E! |
Summary
SUMMARY: Features "NPC and player auto-crafting from workbench bills"
Purpose of change
Allows players to set desired crafting bills on a workbench, then press a button to fetch tools and components and work through the bills automatically, or ask an NPC to do that for you.
Describe the solution
Similar to the other multi-zone activities, this time however, there is bit of data attached to the submap, that can be set/edited/removed via the workbench menu, this is similar to partial constructions and graffiti in the way its attached to submap.
So far the
crafting_bill
struct only contains a map of recipe and int( batch size ), but could, in future, contain more data.You set the recipe you want via a modification of the crafting menu( you can only set bills for things you know how to craft ), set the batch size in the normal way, you can then edit the quantity or delete any of the bills youve set there. ( if the workbench is destroyed - the bills are too, if the workbench is dragged - the bills move with it too - a bit of a hack around the fact we cant store data in furniture ).
You can then ask an NPC to do any crafting that they can, and if they have the skills for it, they will go and fetch tools and components and work on the bill.
They will create the unfinished craft item, and then start working on that, for the menus that normally would pop during crafting for selection of components or when tools go missing etc, then the NPC will favour things on the map nearby and just use what they can.
This command can also be used by the player in the shift+O zone menu.
Any unfinished craft items on that workbench will be prioritised to be worked on first, before any bills, that way, unfinished stuff is done first before any new bills are started.
As with all these other multi-zone activities, the NPC ( or player ) will tidy up afterwards and move unused tools and the finished item to an unsorted loot spot.
Describe alternatives you've considered
N/A
Additional context
Current limitations:
No liquid crafts - sorry - the liquid handling is a step too far for me at the moment, it looks a right headache for NPCs to handle that cleanly, so - just for the moment - no liquid craft bills on workbenches, or NPCs working on unfinished liquid craft items.
No vehicle workbench bills - there is probably a fairly workable solution to this, but for the moment I didnt want to get into that whole thing of vehicle movement moving the crafting_bill data with it.
Marking as WIP, as I tweak it and try and shake out all the numerous bugs that will inevitably result, and that others will surely raise, that ive not considered yet.
Im gonna test this thoroughly as it changes a lot of the crafting code. consider this v0.1
also: I dont do UI. its awful - https://cdn.discordapp.com/attachments/598535827169083403/625792508885991424/unknown.png
any pointers in this area would be appreciated.