Dynamic crafting recipes? Per-player crafting recipes?

Post Reply
User avatar
Yvanhoe
Member
Posts: 131
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Dynamic crafting recipes? Per-player crafting recipes?

by Yvanhoe » Post

Hello all,

I am trying to write an educational game where crafting recipes are obtained as a reward. I was wondering if there was an easy way to add crafting recipes at runtime and to activate them on a per-player basis?

Or do I have to go through an approach like this mod and reimplement a crafting system?

Is there a way to override the default inventory and replace the crafting system this way?

I am looking for a way to do that server side, but am open to solutions that would require client side modding.

User avatar
Linuxdirk
Member
Posts: 2555
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Linuxdirk » Post

Such contents can't be loaded on runtime. You need to re-implement the crafting system to do the necessary checks if a player already got the recipe.

User avatar
FreeGamers
Member
Posts: 627
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: Dynamic crafting recipes? Per-player crafting recipes?

by FreeGamers » Post

Maybe you can do something like that with simplecrafting_lib. Facedeer has a system called workshop that has workshop areas that you need to use to make certain categories of recipes. They come with recipe guides or books. But its a very early concept at this point. Perhaps you can find a creative way to make it work?

I'm not really sure how you'd go about this. It's not exactly what you're asking I understand...

I've thought about this before. If you have ever played divinity original sin, the books you read in game give you new recipes to use. I thought that would be interesting to use with lorebook mod or something like that , but I'd be curious to see what your search turns up.

User avatar
Yvanhoe
Member
Posts: 131
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Yvanhoe » Post

That's what I feared. I look into simplecrafting_lib though, thanks for the pointer!

Is there a way to "cover"/deactivate the crafting grid from inventory though and replace it with a different crafting system?

My idea was to propose some building quests before people could unlock tool making. This is for one-hour long workshops, so it does not necessarily need to be a workable solution long-term for minetest-game. I am open to different suggestions. I may simply deactivate the tool making recipes and add a workbench from [crafting] with custom code.

At one point I had considered giving players blueprints that would be parts of recipes (i.e. the pickaxe recipe would require the "pickaxe blueprint" object) but my two problems with that are that:

1. all ingredients are destroyed when crafting (it would be great to have a "tools" style of ingredients that would not be consumed over crafting)

2. blueprints are not attached to a player and can be exchanged. A player can do 3 times the same quest and get a blueprint for everyone. Or lose it as s/he dies.

I'd really love to have a crafting book that would work like a spell book in RPGs: learn new recipes, it is now part of your book and you can do them! But I guess I would need to code something like that.

User avatar
Yvanhoe
Member
Posts: 131
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Yvanhoe » Post

Yvanhoe wrote:Is there a way to "cover"/deactivate the crafting grid from inventory though and replace it with a different crafting system?
I'll answer my own question there. simplecrafting_lib's documentation states on the second paragraph:

"if you set the "simplecrafting_lib_override_default_player_crafting" configuration variable to "true" it will replace the player's inventory crafting interface with one derived from this system."

Sounds like the way to go!

User avatar
texmex
Member
Posts: 1752
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Dynamic crafting recipes? Per-player crafting recipes?

by texmex » Post

rubenwardy’s crafting mod may also work.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

User avatar
Yvanhoe
Member
Posts: 131
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Yvanhoe » Post

Ohhhh, rubenwardy's seems to have a per-player recipes list. Probably what I am looking for! Needs a bit of configuration though, I need to populate the recipes list manually, but can do!

He mentions that it is developed for one of his games, would you know which one it is? It can't hurt to look at some example code.

User avatar
texmex
Member
Posts: 1752
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Dynamic crafting recipes? Per-player crafting recipes?

by texmex » Post

Yvanhoe wrote:Ohhhh, rubenwardy's seems to have a per-player recipes list. Probably what I am looking for! Needs a bit of configuration though, I need to populate the recipes list manually, but can do!

He mentions that it is developed for one of his games, would you know which one it is? It can't hurt to look at some example code.
He uses it in his CTF game.

Do you need code to migrate recipes from the default recipe list? I got code for that if need be.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

User avatar
Yvanhoe
Member
Posts: 131
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Yvanhoe » Post

Thanks! I'll check the CTF game.

If you have code for that, that would save me some time!

Sokomine
Member
Posts: 4073
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Sokomine » Post

Yvanhoe wrote: 1. all ingredients are destroyed when crafting (it would be great to have a "tools" style of ingredients that would not be consumed over crafting)
There's the replacements part of the craft receipe which allows you do do just that. It's often used for buckets of milk and the like.
Yvanhoe wrote: I'd really love to have a crafting book that would work like a spell book in RPGs: learn new recipes, it is now part of your book and you can do them! But I guess I would need to code something like that.
Yes, that'd definitely be nice to have. I'd love to have a book (probably on an extra page in unified_inventory) that the player can't loose and where his/her progresses are stored. Obtaining new receipes could be done by talking to mobs in diffrent villages and learning from them. But that'd require beeing able to talk to mobs, which in turn requires better formspecs...
A list of my mods can be found here.

User avatar
Yvanhoe
Member
Posts: 131
Joined: Fri Jul 05, 2019 03:18
Location: Japan

Re: Dynamic crafting recipes? Per-player crafting recipes?

by Yvanhoe » Post

Sokomine wrote: There's the replacements part of the craft receipe which allows you do do just that. It's often used for buckets of milk and the like.
I was not aware of that! That's great! Thanks!

User avatar
PolySaken
Member
Posts: 620
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: djelibabi
Contact:

Re: Dynamic crafting recipes? Per-player crafting recipes?

by PolySaken » Post

Why not just use register_on_craft?
You can modify the results with that.
dev wiki page

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests