[Solved] Is it possible to use nodeboxes in entities

Post Reply
Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

[Solved] Is it possible to use nodeboxes in entities

by Sires » Post

And dats my question.
I tried doing it by setting a nodebox parameter but I dunno, the nodebox seems like "So buggy like depending in the direction you look you may see some sides or not or you see a hollow cube instead of an solid one"

Edit: I want to know where do I put the nodebox in the entity defenition to make it use a nodebox as the model

Edit2: I guess I found it and it's a complete code kludge(uuh, *Insert english is not my native language response here*), I saw that ppl register a node with the nodebox you want and then register an entity with visual wielditem of that block, that made me cry while I was reading it T-T Anyway, a bit offtopic but have anyone ever requested the feature of the "nodebox" visual?
Last edited by Sires on Thu Jan 04, 2018 01:34, edited 4 times in total.
I don't have anything important to say.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Hello, is it possible to use nodeboxes asmodels for enti

by Krock » Post

Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: Hello, is it possible to use nodeboxes asmodels for enti

by Sires » Post

I read this code but it's too confusing, I didn't get it
I don't have anything important to say.

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: Hello, is it possible to use nodeboxes asmodels for enti

by Sires » Post

Can you make me a "sample" code plz? so I can understand
I don't have anything important to say.

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: Hello, is it possible to use nodeboxes asmodels for enti

by Sires » Post

But yeah, basicly I just want to be able to use nodeboxes like in this mod
I don't have anything important to say.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Hello, is it possible to use nodeboxes asmodels for enti

by Krock » Post

First of all, please consider editing your posts instead of creating a new one. This is a forum, not a chat.
Here some help if you can't find the edit button:
Image

I couldn't find an API reference there, so I suggest looking at the already existing mods, like this lion. If you create a new mod, ensure you add a "depends.txt" file with the line "nmobs" inside, so you can use the API functions.
For further questions or help, try asking in the mod thread.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: Hello, is it possible to use nodeboxes asmodels for enti

by Sires » Post

Ok...

Edit: But anyways this still uses the api, look first post to see more details of my question :P
Second edit: solved -_-
I don't have anything important to say.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Solved, I guess] Is it possible to use nodeboxes in ent

by stu » Post

Sires wrote:And dats my question.
It is possible in a round-about kinda way. First you need to register a regular node for your nodebox then create an entity with the `wielditem` visual type and use the item name-string in the `textures` table.

example:

Code: Select all

minetest.register_entity("your_mod_name:nodebox_entity", {
	visual = "wielditem",
	textures = {"your_mod_name:nodebox_node"},
})
You may also need to adjust the scale, I don't remember :)

Note: some moderator might correct the title of this issue, it seems to have become somehow self-depleting.

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: [Solved, I guess] Is it possible to use nodeboxes in ent

by Sires » Post

stu wrote:
Sires wrote:And dats my question.
It is possible in a round-about kinda way. First you need to register a regular node for your nodebox then create an entity with the `wielditem` visual type and use the item name-string in the `textures` table.

example:

Code: Select all

minetest.register_entity("your_mod_name:nodebox_entity", {
	visual = "wielditem",
	textures = {"your_mod_name:nodebox_node"},
})
You may also need to adjust the scale, I don't remember :)

Note: some moderator might correct the title of this issue, it seems to have become somehow self-depleting.
The solved I guess because I found it myself, I wrote your solution in the Edit2, but I think it's too hacky, but anyways work
I don't have anything important to say.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Solved, I guess] Is it possible to use nodeboxes in ent

by stu » Post

Sires wrote:The solved I guess because I found it myself, I wrote your solution in the Edit2, but I think it's too hacky, but anyways work
Sorry, I didn't read that, guess we must have cross-posted :)

I would expect a `nodebox` visual wouldn't be too hard to implement given that nodeboxes are converted to meshes anyway, iirc. I am not sure how involved it would be code-wise or whether the developers would even consider this worthwhile.

Meshes are way more versatile and efficient, however, there does seem to be a demand for this seeing the number of mods that currently (ab)use this method. I guess it's because many people are afraid of 3d editors, esp. blender. Does Rubenwardy's NBE app not have a feature to export as .obj or something?

Sires
Member
Posts: 190
Joined: Mon Jan 02, 2017 21:00
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me
Location: :noitacoL

Re: [Solved, I guess] Is it possible to use nodeboxes in ent

by Sires » Post

stu wrote:
Sires wrote:The solved I guess because I found it myself, I wrote your solution in the Edit2, but I think it's too hacky, but anyways work
Sorry, I didn't read that, guess we must have cross-posted :)

I would expect a `nodebox` visual wouldn't be too hard to implement given that nodeboxes are converted to meshes anyway, iirc. I am not sure how involved it would be code-wise or whether the developers would even consider this worthwhile.

Meshes are way more versatile and efficient, however, there does seem to be a demand for this seeing the number of mods that currently (ab)use this method. I guess it's because many people are afraid of 3d editors, esp. blender. Does Rubenwardy's NBE app not have a feature to export as .obj or something?
Maybe I'm dumb and I'm implementing the .obj wrong but the obj is the description of what happens when I try to use the nodebox parameter(I was using a mesh parameter at the same time so the mesh is pretty buggy), buy anyway, It's real buggy the thing that results from the .obj for me

Also I said many times, blender is too complicated for my brain ;-; if there was a simpler 3d editor that is just like rubenwardy's NBE I would love it
I don't have anything important to say.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Solved, I guess] Is it possible to use nodeboxes in ent

by rubenwardy » Post

Sires wrote:Also I said many times, blender is too complicated for my brain ;-; if there was a simpler 3d editor that is just like rubenwardy's NBE I would love it
NBE can export to .obj, but it's unoptimised. It's better to use node boxes in most cases.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Solved, I guess] Is it possible to use nodeboxes in ent

by stu » Post

rubenwardy wrote:
Sires wrote:Also I said many times, blender is too complicated for my brain ;-; if there was a simpler 3d editor that is just like rubenwardy's NBE I would love it
NBE can export to .obj, but it's unoptimised. It's better to use node boxes in most cases.
I am pretty sure the meshes generated by the `wielditem` visual are also sub-optimal, otherwise you could just borrow the code from there, right?

For nodes however, I agree, nodeboxes still very much have their place.

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: [Solved] Is it possible to use nodeboxes in entities

by Rochambeau » Post

So what you both are saying is that nodebox mobs are more ressource hungry than similar Blender/Wings3D meshes (without animation of course), because the nodeboxes have to be converted to meshes by the engine?

Can I somehow get those converted meshes and save minetest this step?

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Solved] Is it possible to use nodeboxes in entities

by stu » Post

Rochambeau wrote:So what you both are saying is that nodebox mobs are more ressource hungry than similar Blender/Wings3D meshes (without animation of course), because the nodeboxes have to be converted to meshes by the engine?

Can I somehow get those converted meshes and save minetest this step?
The meshes generated by the engine may have a few unnecessary faces as compared to a well designed mesh. Unless you spawn hundreds of entities in a very small area you are unlikely to see any tangible performance improvement. The biggest advantage of meshes IMO is that you have much greater control over the texturing.

User avatar
Tcll
Member
Posts: 87
Joined: Thu Jul 25, 2019 21:43
GitHub: Tcll
IRC: Tcll Tcll5850 DarkPikachu
In-game: Tcll
Location: The Gates of Darkness.

Re: [Solved] Is it possible to use nodeboxes in entities

by Tcll » Post

is this possible in 5.3.0 yet??
or is it still broken??
(there's no documentation on it which leads me to assume it's still broken)

reason I need this is because emissive maps aren't a thing yet...
so I can put an emissive nodebox entity inside a primary nodebox node to work around the lack of support.

yeah it's a bit smelly, I know...
it'll be cleaned up when emissive maps are a thing.

EDIT: just to clarify, by "possible", I mean this:

Code: Select all

minetest.register_entity(name, {
    visual = "nodebox",
    node_box = { ... },
})
this way, devs won't be forced to write an obnoxious amount of code just to make the engine work for them.

EDIT2: well, this won't work for me even if entity visuals could do "nodebox"
I was hoping the connect functionality would work for more performance, but it looks like the C++ engine doesn't even support this...

looks like I'm better off re-inventing the wheel with a basic mesh-node and numerous mesh-entities just to get the functionality I need...
that's a shame...

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest