[Mod] Item shelf [itemshelf]

zorman2000
Member
 
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

[Mod] Item shelf [itemshelf]

by zorman2000 » Fri Jan 19, 2018 15:23

Description:
The item shelf mod is a simple mod that adds to shelves that can hold up to 4 or 6 items. This small limitation is due to the fact that shelves show the items they are holding using entities. The entities are purely static and consume 0 CPU (like the ones in itemframes for example), but still the limitation is to avoid lag.

There are no crafting recipes at the moment. To get an item shelf, play on creative or use:
Code: Select all
/giveme itemshelf:small_shelf
or
Code: Select all
/giveme itemshelf:large_shelf

Both shelves are of the same size, however they can hold 4 or 6 items respectively.

Screenshot:
Image

Developers API:
Developers using this mod can register a particular node to use the item shelf functionality. To do that, the following function is used:
Code: Select all
itemshelf.register_shelf(name, def)

See more here: https://github.com/hkzorman/itemshelf/blob/master/readme.md

License:
MIT

Dependencies:
  • default

Download:
Download here: https://github.com/hkzorman/itemshelf/archive/master.zip
Or, browse the code here: https://github.com/hkzorman/itemshelf
Attachments
screenshot_20180119_101009.png
(274.53 KiB) Not downloaded yet
 

User avatar
Lone_Wolf
Member
 
Posts: 1979
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam
 

User avatar
TumeniNodes
Member
 
Posts: 2539
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Item shelf [itemshelf]

by TumeniNodes » Fri Jan 19, 2018 16:28

Haven't even tried it yet and I already like it!
The visual alone is appealing
I'm not your buddy, guy...
 

User avatar
the_raven_262
Member
 
Posts: 315
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: the_raven_262 Raven262 Corvus262 corvus
In-game: the_raven_262 Raven262 Nevermore

Re: [Mod] Item shelf [itemshelf]

by the_raven_262 » Fri Jan 19, 2018 16:36

I never knew that I needed something like this. Nice work!
[amber] [conjuration] [warzone] | Why is #minetest-mod-dev so empty?
 

ShadMOrdre
Member
 
Posts: 128
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] Item shelf [itemshelf]

by ShadMOrdre » Fri Jan 19, 2018 23:04

zorman,

Love the AdvancedNPCs and the gramaphone. This one will get some love too, I'm sure.

However, let's talk context. AdvancedNPCs cannot navigate formspecs. They have to eyes, ears, mouth or mouse. And navigating formspecs really deadens a world anyway.

Anyway you can implement this fine mod without the formspecs? Same for the gramaphone, since your already more than half way there. This way, NPCs only need rudimentary knowledge of a given mechanism. Put record on gramaphone, punch to start. Put item on shelf, and well, no formspeccythingymerbober.

Take a peak at my lib_tools, for where I'm going with this. Look especially at the anvil, not my creation, and the altar of enchantment, totally my creation, with some help from xdecor.enchanting table and aforementioned anvil.

I'm looking to bring interactive life to the worlds I create, versus just more formspec based stuff, which IMHO, takes away from both the gameplay and immersion.
My other virtual world is an Opensimulator.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7460
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Mon Jan 22, 2018 02:03

What about half deep shelves? I started messing with it but the items were in front of the cabinet instead of within.
Check out my Mods: BBQ Mod Crops Plus
 

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

Re: [Mod] Item shelf [itemshelf]

by Sokomine » Sat Jan 27, 2018 19:31

Where can those shelves be ordered? My houses need some. An open version without the back side and with slightly smaller sides might also look great.

ShadMOrdre wrote:However, let's talk context. AdvancedNPCs cannot navigate formspecs. They have to eyes, ears, mouth or mouse. And navigating formspecs really deadens a world anyway.

It's just some other inventory for them - like chests. No problem there :-) Learning to punch and right-click items is also something they're not exactly born with (they need context). To avoid formspecs is just your personal preference. It has some appeal, but...it is not useful for all situations.
A list of my mods can be found here.
 

hajo
Member
 
Posts: 596
Joined: Thu Oct 13, 2016 10:45
Location: DE

Re: [Mod] Item shelf [itemshelf]

by hajo » Sat Jan 27, 2018 21:01

zorman2000 wrote:shelves that can hold up to 4 or 6 items .. show the items they are holding

Less packing density, but much more decorative and homely :)
There are no crafting recipes at the moment.

How about a recipe like for a chest, but with glass instead of steel ?
 

User avatar
azekill_DIABLO
Member
 
Posts: 7460
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Sun Feb 04, 2018 03:12

Any idea why items don't rotate to match the itemshelf?

Image
Attachments
Screenshot from 2018-02-03 21-11-17.png
(339.61 KiB) Not downloaded yet
Check out my Mods: BBQ Mod Crops Plus
 

User avatar
TumeniNodes
Member
 
Posts: 2539
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Item shelf [itemshelf]

by TumeniNodes » Sun Feb 04, 2018 06:20

I believe you need to add
Code: Select all
paramtype2 = "facedir",
I'm not your buddy, guy...
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Sun Feb 04, 2018 12:10

I don't think it's that simple. If it is, I am completely missing it. I am pretty sure its in the api.

I was thinking it was in these three lines, if I am interpreting them right it looks like they are trying to figure out which direct the shelf is facing and setting the item on it to match.

Code: Select all
   local node = minetest.get_node(pos)
   local node_dir = minetest.facedir_to_dir(((node.param2 + 2) % 4))
   local obj_dir = minetest.facedir_to_dir(get_obj_dir(node.param2))


Or in this offshoot

Code: Select all
local function get_obj_dir(param2)
   return ((param2) % 4)
Check out my Mods: BBQ Mod Crops Plus
 

User avatar
azekill_DIABLO
Member
 
Posts: 7460
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Sun Feb 04, 2018 16:04

Meh, I'm in over my head. Hoping the original author can swat this bug.
Check out my Mods: BBQ Mod Crops Plus
 

zorman2000
Member
 
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Item shelf [itemshelf]

by zorman2000 » Tue Feb 06, 2018 23:57

Hello everyone, first of all, huge thanks for all the positive comments!

My apologies I have not been active over here, I have been looking at the feedback and doing some work on this mod, but haven't updated yet. Here is an update:
  • Add half-width shelf, with open back as well (asked by GrizzlyAdam and Sokomine)
  • API updated to support custom vertical and depth displacement of items (allowing for different types of shelves)
  • Fixed bug with item not rotating with shefl

The bug should be fixed by now.
Image

Please download the latest version in GitHub

Regarding crafting recipes, I like the idea by hajo, however I don't think crafting recipes will work for this mod, given all the possibilities there are. I'm already working on an idea for this that will solve the issue with this mod and other mods I'm planning to make in the future.
Attachments
screenshot_20180206_185018.png
(220.2 KiB) Not downloaded yet
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Wed Feb 07, 2018 00:02

Any word on the items not rotating with the shelf bug?
Check out my Mods: BBQ Mod Crops Plus
 

User avatar
Lone_Wolf
Member
 
Posts: 1979
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: [Mod] Item shelf [itemshelf]

by Lone_Wolf » Wed Feb 07, 2018 00:08

Grizzly Adam wrote:Any word on the items not rotating with the shelf bug?

Reread :P (Or did I misunderstand you?)

zorman2000 wrote:Hello everyone, first of all, huge thanks for all the positive comments!

My apologies I have not been active over here, I have been looking at the feedback and doing some work on this mod, but haven't updated yet. Here is an update:
  • Add half-width shelf, with open back as well (asked by GrizzlyAdam and Sokomine)
  • API updated to support custom vertical and depth displacement of items (allowing for different types of shelves)
  • Fixed bug with item not rotating with shefl

The bug should be fixed by now.
Image

Please download the latest version in GitHub

Regarding crafting recipes, I like the idea by hajo, however I don't think crafting recipes will work for this mod, given all the possibilities there are. I'm already working on an idea for this that will solve the issue with this mod and other mods I'm planning to make in the future.
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Wed Feb 07, 2018 00:12

Sorry, I didn't see that. But I did just download and test before replying and at least with the small shelf it was still persisting.
Check out my Mods: BBQ Mod Crops Plus
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Wed Feb 07, 2018 00:16

OK, I see. It is now being placed in in the proper direction but when the shelf is rotated it does not rotate with.
Check out my Mods: BBQ Mod Crops Plus
 

zorman2000
Member
 
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Item shelf [itemshelf]

by zorman2000 » Wed Feb 07, 2018 00:43

Grizzly Adam wrote:OK, I see. It is now being placed in in the proper direction but when the shelf is rotated it does not rotate with.


Are you rotating the shelf with the screwdriver by any chance?
I haven't considered this usecase I guess.
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Wed Feb 07, 2018 00:44

Yes sir. I am going through all the current changes and working them into my mediapack for the laptops-- its a definite improvement at this point.
Check out my Mods: BBQ Mod Crops Plus
 

User avatar
Grizzly Adam
Member
 
Posts: 251
Joined: Sat Aug 05, 2017 01:28
Location: Lost in America
GitHub: Grizzly-Adam

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Wed Feb 07, 2018 01:02

Might I suggest group choppy instead of group cracky since these are wooden shelves?

When I destroy the shelf I get items back but not the shelf itself. Can anything be done about that?
Check out my Mods: BBQ Mod Crops Plus
 

zorman2000
Member
 
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Item shelf [itemshelf]

by zorman2000 » Wed Feb 07, 2018 01:12

Grizzly Adam wrote:Might I suggest group choppy instead of group cracky since these are wooden shelves?

When I destroy the shelf I get items back but not the shelf itself. Can anything be done about that?


Yes, everything added! Check out the latest code changes in GitHub.
  • Group changed to "choppy" now instead of "cracky"
  • Support added for screwdriver rotation
  • Shelf drops on dig and on blast

Thanks for the feedback, enjoy!
 

Next

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests