[Mod] Craft Table [v1.0.0][craft_table]

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

[Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Wed Dec 11, 2019 03:24

Image
Description:
Add a craft table with a 3x3 grid and modify the inventory craft grid to 2x2.

Recipes:
Image
*Any wood type can be used

Requirements:
  • Minetest 5.1.0 (or later)
  • default mod
Supported mods:
  • sfinv
  • xdecor
License of code: LGPL 3.0

License of textures and sounds: CC BY-SA 3.0 and WTFPL
Thanks for BlockMen by craft table textures

Download: craft_table-master.ZIP

Links:
Attachments
recipe craft table.png
(13.56 KiB) Not downloaded yet
screenshot.png
(109.54 KiB) Not downloaded yet
 

User avatar
Miniontoby
Member
 
Posts: 330
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Miniontoby » Thu Dec 12, 2019 16:27

That makes Minetest more like Minecraft. Cool mod
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Thu Dec 12, 2019 16:30

Good ideas should be taken advantage of.
Minetest really is the game more similar to Minecraft than GTAV.
 

User avatar
Miniontoby
Member
 
Posts: 330
Joined: Fri Mar 01, 2019 19:25
Location: The Netherlands
In-game: Miniontoby

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Miniontoby » Sat Dec 28, 2019 08:43

Please put it on content.minetest.net for more simple downloading
My English isn't very good because I'm Dutch ---- Check my mod "Doorbell"
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Mon Dec 30, 2019 14:52

Miniontoby wrote:Please put it on content.minetest.net for more simple downloading

Working on it. I am awaiting approval.
 

Martno
Member
 
Posts: 78
Joined: Thu May 28, 2015 07:09
Location: Hungary

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Martno » Wed Jan 22, 2020 05:10

Hello
This mod is not working for me. I can't put anything on the 2x2 grid. Everything is going back to my inventory instantly. I use Minetest 5.1.
 

Astrobe
Member
 
Posts: 294
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Astrobe » Sun Jan 26, 2020 11:17

I confirm there is an issue with the 2x2 in 5.1, using sfinv.

FWIW, I disabled it entirely. It allows to make a craft table on the spot, which kind of defeats its purpose. In the same "hard mode survival" spirit, one could consider making the crafting recipe of the table optional too. The game designer can come up with ways for the players to get them (quests, NPC trade, dungeon loot, ...).

I guess it is difficult to deal with the bazillion of inventory mods in this context. It is not clear to me what register_craft_predict() does, but it seems it could be used to prevent crafting (that would avoid touching existing formspecs). I could try it myself, but I am not familiar with formspecs and inventories, so I am afraid of missing some corner case even if it is appears to work.

Also, is there a reason why the inventory of the table is dropped when one closes the formspec? I was expecting a behavior similar to furnaces and chests (one cannot remove the node if it is not "empty").
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Sun Jan 26, 2020 14:03

Are you sure you are not using other mods? And is you using the stable version of 5.1?
 

Astrobe
Member
 
Posts: 294
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Astrobe » Sun Jan 26, 2020 15:17

BrunoMine wrote:Are you sure you are not using other mods? And is you using the stable version of 5.1?


I would say that I use fewer mods than average; I have also modified most of them, so I know them pretty well generally speaking. I do use 5.1 stable.
 

User avatar
bhree
Member
 
Posts: 157
Joined: Tue Jun 19, 2018 07:45
Location: Alone In The Wild Land
GitHub: bhree
IRC: bhree
In-game: bhree

Re: [Mod] Craft Table [v1.0.0][craft_table]

by bhree » Thu Feb 20, 2020 12:20

Code: Select all
-- Clear metadata when exit from craft table formspec
minetest.register_on_player_receive_fields(function(player, formname, fields)
   if formname == "craft_table:craft_table" and fields.quit then
      local meta = player:get_meta()
      drop_craft(player, minetest.deserialize(meta:get_string("craft_table:craft_table_pos")))
      meta:set_string("craft_table:craft_table_pos", "")
      meta:set_string("craft_table:craft_table_grid", "2x2") --maybe should add this line to return to 2x2 mode after finishing accessing the table
   end
end)
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Thu Feb 20, 2020 13:44

Astrobe wrote:Also, is there a reason why the inventory of the table is dropped when one closes the formspec? I was expecting a behavior similar to furnaces and chests (one cannot remove the node if it is not "empty").

Well, technically the items are on the table, just take them back. XD
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Thu Feb 20, 2020 13:49

Martno wrote:Everything is going back to my inventory instantly. I use Minetest 5.1.

I tested it and this is not happening to me. Can you explain to me exactly what you did, what mods and etc.
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Thu Feb 20, 2020 14:02

bhree wrote:
Code: Select all
-- Clear metadata when exit from craft table formspec
minetest.register_on_player_receive_fields(function(player, formname, fields)
   if formname == "craft_table:craft_table" and fields.quit then
      local meta = player:get_meta()
      drop_craft(player, minetest.deserialize(meta:get_string("craft_table:craft_table_pos")))
      meta:set_string("craft_table:craft_table_pos", "")
      meta:set_string("craft_table:craft_table_grid", "2x2") --maybe should add this line to return to 2x2 mode after finishing accessing the table
   end
end)

I could do that, but is is not the safest way to return the inventory 2x2 because it can be changed by another mod, that is, I must always define this the moment the inventory is accessed.
 

Astrobe
Member
 
Posts: 294
Joined: Sun Apr 01, 2018 10:46

Re: [Mod] Craft Table [v1.0.0][craft_table]

by Astrobe » Thu Feb 20, 2020 17:55

BrunoMine wrote:
Astrobe wrote:Also, is there a reason why the inventory of the table is dropped when one closes the formspec? I was expecting a behavior similar to furnaces and chests (one cannot remove the node if it is not "empty").

Well, technically the items are on the table, just take them back. XD


Sure but is there a technical reason why they are "popped"? I figured out after some use that this behavior is probably intended to prevent players from forgetting something there, but OTOH when you realize you miss an ingredient in the middle of a craft that you have to fetch from some chest, you have to restart from scratch.

For my game I don't mind the former but the latter is a bit annoying. I also believe that items could vanish if a player is disconnected and cannot come back in time. So if you tell me there is no corner case that forced the implementation of that behavior, I can try to change it.
 

User avatar
BrunoMine
Member
 
Posts: 1070
Joined: Thu Apr 25, 2013 17:29
Location: SP-Brasil
GitHub: BrunoMine

Re: [Mod] Craft Table [v1.0.0][craft_table]

by BrunoMine » Fri Feb 21, 2020 03:03

if you allow items to stay on the bench (like a chest) allow other players to pick up your items while you use them. furthermore i don't know how to code this, since the crafting grid is an player attribute (and not a node attribute). maybe there is a way but it doesn't seem viable.
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 9 guests