[MOD]subnodes registerer[WIP]

Post Reply
tagada
Member
Posts: 14
Joined: Wed Feb 21, 2018 17:09
In-game: tagada

[MOD]subnodes registerer[WIP]

by tagada » Post

Hello all,
the aim of this work is to enable a player to hit a block in order to make this block registered by the registering functions provided by other mods that make sub-blocks (like slabs, stairs, slopes, microblocks, columns, etc.)

why ?
when you build, haven't you never been frustrated to discover that this so beautiful block is not available in circular-saw ? or that you just can't obtain a simple dirt with grass stair ?

that's it : you hit a node with the intended tool and the block you hit, if suitable, will be pre-registered to be processed at next server restart (don't dream, you cant at this time register a node at run time). then you will obtain sub-blocks by the mods whitch can do it.

some very first screenshots :
nothing_to_do_mesh.png
nothing_to_do_mesh.png (39.38 KiB) Viewed 329 times
register4_3mods.png
register4_3mods.png (36.14 KiB) Viewed 329 times
I created this topic from a topic-reply i made in the topic "[Server] Jungle", then the replies had derivated until a member made a remark that my posts are no more suitable and need to start this present topic.

So I will complete it with usefull informations like dependancies, licences, etc, as soon as possible.
Fell free to post any remarks that can help, keeping in mind this is my very first mod.
Thanks for reading, best regards;
Tagada.

tagada
Member
Posts: 14
Joined: Wed Feb 21, 2018 17:09
In-game: tagada

Re: [MOD]subnodes registerer[WIP]

by tagada » Post

following is moved from topic "[Server] Jungle" :

2 questions while developping :
I think about 4 levels of privs :
0 - no priv, unable to use the mod;
1 - "user" : can punch a node (left click) to request a block to be processed (in sub-blocks by the availables mods like moreblocks)
2 - "controler" : user level + able to validate a request from user to add block to be processed (right-click anywhere with the tool to open a controler formspec)
3 - "admin" : controler level + access granted to all options (to be defined) accessible trought an admin formspec.

At this step of the work the name of the mod is subnodes_registerer and
the privs will be named <mod name>_<level name> like : subnodes_registerer_user

1°) Do you think that work in a good way ?
2°) if i well understood minetest's mechanism, the owner of a server have the "server" privilege : what do you think about to automatically grant the subnodes_registerer_admin priv to the player witch right or left click with the tool if this player already have the "server" privilege ? (should be an option with default=yes) ?

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [MOD]subnodes registerer[WIP]

by bell07 » Post

I go slightly other way to solve the described issue. See Customnode - Additional shapes for nodes in already existing mods.

But I do not collect the node names interactivelly but just try to generalize using all "compatible" nodes from mods defined in depends.txt.

The test, which nodes are compatible to be shaped, is implemented in function customnode.check_nodedef(def, depmod)

If you like to use the customnode framework and create new tasks, let me know so I can add them to my mod. At the time only the tasks "stairs:stairs_slabs" and "carpets:carpet" provided for shapes.

tagada
Member
Posts: 14
Joined: Wed Feb 21, 2018 17:09
In-game: tagada

Re: [MOD]subnodes registerer[WIP]

by tagada » Post

Hello bell,
thanks for your interest (i downloaded it and had a view on it) and sorry for this short answer, I do not have much time but work is going on and i'm happy with the progress.
hope to finish soon.

User avatar
aristotle
Member
Posts: 79
Joined: Wed Mar 14, 2018 23:40
GitHub: askotos
IRC: aristotle_
In-game: aristotle
Location: Currently on Melpomene, waiting for the starship to be fixed.
Contact:

Re: [MOD]subnodes registerer[WIP]

by aristotle » Post

tagada wrote:...the aim of this work is to enable a player to hit a block in order to make this block registered by the registering functions provided by other mods that make sub-blocks (like slabs, stairs, slopes, microblocks, columns, etc.)
This would be definitely great. I already love it!

It is something I have been thinking about and I have the impression - but I may be definitely wrong (I am quite a newbie here) - that the current registration method can register only a limited set of blocks whose size I do not know.
For instance, I have tried some time ago to make all of the blocks from the RGB mod usable by the circular saw but - if memory serves me well - they were simply too many (in the order of thousands but I did not investigate enough).
I have simply thought that probably registering every sub-block before ever using one were just a waste of space/stack/.... You may not need - in fact - every possible sub-block of every block but just 4 or 5 at a time: one time to build a stair, another one to build an arch.

I was thus planning to go reading the code of the mods which already provide the sub-blocks functionality to understand if an API might be developed to provide a dynamic registration and at the same time to learn more about LUA and Minetest.

From my point of view your mod is going to provide an initial but powerful solution.

I have not currently enough MT knowledge to properly talk about this at the moment, but if a callback that is called whenever an unknown block is found/passed existed, it would be probably easier to return/inject the proper sub-block instead of registering once all of the possible sub-blocks that might be needed.

Thanks for working on this! I will definitely use your mod and look at how you do it! :)
Happy builds & explorations! | Initiating my Creative Minetest channel on YouTube

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests