[Solved] Is it possible to use nodeboxes in entities

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

[Solved] Is it possible to use nodeboxes in entities

by Sires » Wed Jan 03, 2018 14:39

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: 4408
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

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

by Krock » Wed Jan 03, 2018 17:50

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

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

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

by Sires » Wed Jan 03, 2018 17:54

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: 187
Joined: Mon Jan 02, 2017 21:00
Location: :noitacoL
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me

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

by Sires » Wed Jan 03, 2018 17:54

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

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

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

by Sires » Wed Jan 03, 2018 17:55

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: 4408
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

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

by Krock » Wed Jan 03, 2018 18:08

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: 187
Joined: Mon Jan 02, 2017 21:00
Location: :noitacoL
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me

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

by Sires » Wed Jan 03, 2018 18:41

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
Location: United Kingdom
GitHub: stujones11

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

by stu » Wed Jan 03, 2018 21:57

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: 187
Joined: Mon Jan 02, 2017 21:00
Location: :noitacoL
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me

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

by Sires » Thu Jan 04, 2018 01:35

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
Location: United Kingdom
GitHub: stujones11

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

by stu » Thu Jan 04, 2018 18:09

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: 187
Joined: Mon Jan 02, 2017 21:00
Location: :noitacoL
GitHub: Sires0
IRC: Sires
In-game: Sires Sores Siri Seris or anything ppl call me

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

by Sires » Fri Jan 05, 2018 19:01

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: 5883
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

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

by rubenwardy » Fri Jan 05, 2018 19:39

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.
 

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

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

by stu » Fri Jan 05, 2018 20:45

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: 116
Joined: Tue Sep 23, 2014 11:37

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

by Rochambeau » Fri Jan 26, 2018 06:42

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
Location: United Kingdom
GitHub: stujones11

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

by stu » Fri Jan 26, 2018 18:48

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.
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests