-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
Simple crafting system #1260
Simple crafting system #1260
Conversation
only useful for editor stuff.
To test, I spawned a knife, took off my hat, place it on the ground, then with the knife active, I clicked on it so that it would start the crafting. If I do nothing else, it works fine. If I walk away, it cancels which is great. But I can pick up the hat while I am interacting with it with the knife. The recipe completes, the items spawn where the hat was in my hand and drop on the ground, and the hat is still maintained by the UI as being in my hand still. Same thing if I put the hat in a pocket quickly. Although while it was in my hand at least I could "drop" it to fix the state. Now it is stuck in my pocket forever. Haha. We may need some kind of check to prevent players from picking up the thing they are interacting with. |
Can't build to test host/client. Console log:
|
Issues above spotted by @singulocity are fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When play testing, the first recipe worked fine for me but the "weird complex recipe" did not. The target is a bike horn which also has it's own interaction when clicked, I noticed this is overriding the crafting interaction and preventing it from happening. Changing the target to something w/o any unique interactions and the recipe works fine. I suggest preventing the item's unique interactions from occurring when holding an item to fix this, as it doesn't make sense for me to honk the bikehorn if i click it with a knife.
@cosmiccoincidence I simply added a condition for the honk interaction, stating you need a hand to honk (so won't happen when holding a knife). I'm afraid always overriding the interaction for all cases, might be a bad idea. I rather have each interaction handle that on their own. Fixed the issue for the bikehorn. |
I'm not sure I agree. Imo I think the default interaction for an empty hand should be to grab the item, but if the hand has something held the interaction would be to use the held item on the target. I don't think people will use interactions on Items without grabbing them first very often. And if they do, they can easily right click it. |
@cosmiccoincidence the default interaction is still picking up. Just try and test and let me know how this feels, I think it'll be the way you wanted. |
Summary
Simple item replacement crafting, as described on gitbook :
https://ss3d.gitbook.io/design/actions/crafting/makeshift-crafting
System is mostly functionnal, does not include "steps" in the recipe for now, it's a simple item replacement.
However, it can handle arbitrary complex recipes.
A recipe is made of a crafting interaction (screw, slice, hammer...), a target (the item on which to apply the interaction), and a list of items and the needed count for each item.
The crafting interaction is only available when all conditions are present :
Items counted as available are items in close proximity from the target item. So to get the crafting interaction available, for now you have to drop all necessary items close to the target item.
The system works when other close items are not part of the recipe as well.
It currently consumes all crafting ressources and spawn the product of the recipe.
It implements some delays for some interactions. So the crafting only occurs after a while.
Currently, if the source interaction moves too far from its position during the interaction, it stops the interaction. This is necessary on some interaction that will have animation such as cutting some stuff. You don't want the player to look like they are cutting air.
Changes to Files
Technical Notes (optional)
Recipes are simple scriptable objects in Assets/Content/Data/Recipes currently. Easy to set up.
For now, you must enter the name of the interaction, in it. Not perfect because strings tend to break easily when code is changed.
Known issues
None as of now
Fixes (optional)
TODO
Futur work