Page 1 of 3

[Mod] Angled Stairs [1.2] [angledstairs]

PostPosted: Wed Jun 01, 2016 01:12
by TumeniNodes
License = DWYWPL
Depends = Default

Adds a new and unique style of stairs to Minetest.
Useful for angled elevations, as well as to build spiral-like-ish staircases!
They can also be manipulated with the screwdriver, so they add some other options for building.

My thanks to everyone who took the time to help and advise (as well as time spent working on portions of this mod)
Napiophelios, for all the help adding support for default textures.
sofar, for putting time into helping with models.
pithy, for putting time into helping with models (models provided by pithy).
Nathan S, for offering help with Lua.
azekill_DIABLO, for adding some advice regarding performance.

Also, if anyone wishes to add crafting recipes for them, that would be awesome. I don't use them, I just build stuff : )

Image

Image
sawtooth look has been fixed since this pic, just showing spiral-ish-like ability :D

Image


Source https://github.com/TumeniNodes/angledstairs
Download https://github.com/TumeniNodes/angledstairs/archive/master.zip
Install Instructions http://wiki.minetest.net/Installing_Mods

Updates:

02/03/2017: Updated with _block nodes from 0.04.15 / Updated version to [1.1]

06/10/2017: Update for 0.4.16, added mod.conf / Update version to [1.2]

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Wed Jun 01, 2016 09:44
by azekill_DIABLO
+1

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Wed Jun 01, 2016 15:45
by ErrorNull
looks cool. I'll try these!

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Wed Jun 01, 2016 16:17
by TumeniNodes
Thank you folks : )

There are two shapes ? I they could be easily added to Calinou's moreblocks.

Hmmm, I'll look into this. Thank you

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Wed Jun 01, 2016 21:35
by TumeniNodes
with help from Napiophelios, I finally added support for default textures.
https://forum.minetest.net/viewtopic.php?f=47&t=14804

Image

So, as soon as I make some little tweaks, the new code/changes will be uploaded to github soon. As long as I don;t mess it all up :P
Please hold....

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Thu Jun 02, 2016 04:36
by TumeniNodes
Updated init.lua now includes support for default textures.

Thank you Napiophelios for the help, it is greatly appreciated.

Thank you rubenwardy (again) for the nodebox editor https://forum.minetest.net/viewtopic.php?f=14&t=2840&hilit=nodebox+editor

I "may" make some other tweaks at a later date but for now..., it is what it is : )

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Thu Jun 02, 2016 16:20
by TumeniNodes
Updated / edited init.lua to provide 2 angles of each node.
Now there are left & right of both angled stair, and angled slab.
This fixes an issue with texture alignment with woods and stone bricks.
To be completely "perfect" would require 4 variants of each node and IMO is just far too much. Using 2 variants each resolves this texture issue enough to pass.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Thu Jun 02, 2016 16:25
by azekill_DIABLO
cool

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Thu Jun 02, 2016 17:18
by TumeniNodes
azekill_DIABLO wrote:cool


Thanks

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Sun Jun 05, 2016 04:44
by sofar
TumeniNodes wrote:Useful for angled elevations, as well as to build spiral-like-ish staircases!

Image


You should really make mesh nodes out of these nodes: Right now these have 16+ nodeboxes (which is 192 triangles!!!) per node, while it can be done in a mesh node in 8-14(!) triangles.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Sun Jun 05, 2016 10:07
by azekill_DIABLO
i prefer nodebox! look's more.... polished!

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Sun Jun 05, 2016 15:50
by TumeniNodes
sofar wrote:
TumeniNodes wrote:Useful for angled elevations, as well as to build spiral-like-ish staircases!

Image


You should really make mesh nodes out of these nodes: Right now these have 16+ nodeboxes (which is 192 triangles!!!) per node, while it can be done in a mesh node in 8-14(!) triangles.


I plan on it. I am not extremely skilled with Blender, I have used it only here an there..., and that was mostly back in 2008/2009 when I made a 3d text for Granular Linux with some cool blended graphics on it.
I attempted it like 2 days ago but do not remember how to make all into 1 group, as well as the meshes had no texture, and I do not know how to get the coords from Blender.
my wish, is to group them, but not have the entire node outline when the object is pointed at, I'd like the outline to follow the shape of the mesh
This is part of the reason I am keeping it in "WIP". The other reason is I am thinkng about adding angled slopes as well

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Sun Jun 05, 2016 15:54
by TumeniNodes
azekill_DIABLO wrote:i prefer nodebox! look's more.... polished!


The issue is that it shows a very fractured outline, as well as it sucks up resources to render : / (makes the pc work harder) It may not be very noticeable but, if there are enough similar objects within field of view, then it will be a noticeable diff

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Mon Jun 06, 2016 00:54
by sofar
Optimized high stair blender model and obj file, feel free to use this in your mod with proper attribution:

License: CC-BY-SA-4.0 - Auke Kok <sofar@foo-projects.org>

I can do the low model as well if you want.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Mon Jun 06, 2016 02:44
by TumeniNodes
sofar wrote:Optimized high stair blender model and obj file, feel free to use this in your mod with proper attribution:

License: CC-BY-SA-4.0 - Auke Kok <sofar@foo-projects.org>

I can do the low model as well if you want.


Very awesome of you to take the time to do this sofar, thank you very much.
I do, however have a few of issues with the object though (please do not think me unappreciative, because I am extremely appreciative)
The first issue is, I produced 2 separate nodes for each object, being (angled_stair_right, angled_stair_left then angled_slab_right, and angled_slab_left) to slightly fix a texture alignment problem.
The second issue (may be something I am doing wrong code-wise) is that I can only climb the stairs from one angle (to the side). I still have the same node_box coords in place, and I think they are supposed to be diff when using a mesh?
The third issue is, in inventory, the top of the bottom step is transparent

Other than those, the stair does look 150% better..., and I would love to use if I can resolve those issues.
I am still a complete novice with these things, but trying to learn as best I can.
I would also very much appreciate any sort of "how to" steps to be able to, try to learn how to do this for myself, as I always feel bad pestering others. But, at the same time YES! I would love if you could do the 4 meshes :P cuz they look great. And I smuck with Blender, and hopefully I can return the favor if you ever need something graphics related (aside from Blender haha)
I really hope none of this seems offensive, because I am beyond grateful and it does look awesome as a mesh. As I stated, the issues I am running into are most likely on my end
Here is the way I have it coded:

Code: Select all
function angledstairs.register_angled_stair(subname, recipeitem, groups, images, description, sounds)
   groups.angledstair = 1
minetest.register_node(":angledstairs:angled_stair_right" .. subname, {
   description = description,
   drawtype = "mesh",
   mesh = "angled_stair_high.obj",
   tiles = images,
   paramtype = "light",
   paramtype2 = "facedir",
   is_ground_content = false,
   groups = groups,
   sounds = sounds,
   node_box = {
      type = "fixed",
      fixed = {
         {-0.5, -0.5, 0, 0.0625, 0.5, 0.5},
         {0.0625, -0.5, 0.0625, 0.125, 0.5, 0.5},
         {0.125, -0.5, 0.125, 0.1875, 0.5, 0.5},
         {0.1875, -0.5, 0.1875, 0.25, 0.5, 0.5},
         {0.25, -0.5, 0.25, 0.3125, 0.5, 0.5},
         {0.3125, -0.5, 0.3125, 0.375, 0.5, 0.5},
         {0.375, -0.5, 0.375, 0.4375, 0.5, 0.5},
         {0.4375, -0.5, 0.4375, 0.5, 0.5, 0.5},
         {-0.5, -0.5, -0.5, -0.4375, 0.5, -0.4375},
         {-0.5, -0.5, -0.4375, -0.375, 0.5, -0.375},
         {-0.5, -0.5, -0.375, -0.3125, 0.5, -0.3125},
         {-0.5, -0.5, -0.3125, -0.25, 0.5, -0.25},
         {-0.5, -0.5, -0.25, -0.1875, 0.5, -0.1875},
         {-0.5, -0.5, -0.1875, -0.125, 0.5, -0.125},
         {-0.5, -0.5, -0.125, -0.0625, 0.5, -0.0625},
         {-0.5, -0.5, -0.0625, 0, 0.5, 0},
         {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
      }
   }
})

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 02:03
by pithy
Use collision_box instead of node_box when use meshes.
Use selection_box to define the selection box.
All of the ?_box have the same format.
sofar: I thought only apple could copyright basic shapes.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 14:15
by sofar
pithy wrote:sofar: I thought only apple could copyright basic shapes.


I put fairly permissive licenses on most of my work, so it shouldn't pose any problem for anyone. I'm not a fan of WTFPL or Public Domain, as it potentially can do the exact opposite of what was intended by the licenser.

I'm also receptive to requests for relicensing, but the bottom line is that I think that everyone should get credit for what they do, no matter how small the change is.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 15:36
by pithy
I find it easier to understand lua code than legal code.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 15:42
by TumeniNodes
pithy wrote:Use collision_box instead of node_box when use meshes.
Use selection_box to define the selection box.
All of the ?_box have the same format..


(sigh) Ok..., now I'm confused again haha.
I walked away from this for a bit because I was getting frustrated.
So now, only about 1/2 hr into attempting to set it up right..., I'm getting frustrated again, at my stupidity.

Do I leave the nodebox table the same? I tried using collision box and selection box in every which way, but no changes. I have no idea where in the script I am supposed to insert these lines?
This is the way I have it set right now..., and I am unable to climb the stair in any other way than the side where the wood texture runs side to side

Code: Select all
minetest.register_node(":angledstairs:angled_stair_right" .. subname, {
   description = description,
   drawtype = "mesh",
   mesh = "angled_stair_high.obj",
   tiles = images,
   paramtype = "light",
   paramtype2 = "facedir",
   is_ground_content = false,
   groups = groups,
   sounds = sounds,
   node_box = {
      type = "fixed",
      fixed = {
         {-0.5, -0.5, 0, 0.0625, 0.5, 0.5},
         {0.0625, -0.5, 0.0625, 0.125, 0.5, 0.5},
         {0.125, -0.5, 0.125, 0.1875, 0.5, 0.5},
         {0.1875, -0.5, 0.1875, 0.25, 0.5, 0.5},
         {0.25, -0.5, 0.25, 0.3125, 0.5, 0.5},
         {0.3125, -0.5, 0.3125, 0.375, 0.5, 0.5},
         {0.375, -0.5, 0.375, 0.4375, 0.5, 0.5},
         {0.4375, -0.5, 0.4375, 0.5, 0.5, 0.5},
         {-0.5, -0.5, -0.5, -0.4375, 0.5, -0.4375},
         {-0.5, -0.5, -0.4375, -0.375, 0.5, -0.375},
         {-0.5, -0.5, -0.375, -0.3125, 0.5, -0.3125},
         {-0.5, -0.5, -0.3125, -0.25, 0.5, -0.25},
         {-0.5, -0.5, -0.25, -0.1875, 0.5, -0.1875},
         {-0.5, -0.5, -0.1875, -0.125, 0.5, -0.125},
         {-0.5, -0.5, -0.125, -0.0625, 0.5, -0.0625},
         {-0.5, -0.5, -0.0625, 0, 0.5, 0},
         {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
      }
   }
})


I tried collison_box =
type = "selection_box",
fixed = {
???? Oh, wait.... maybe selectionbox = {
?????

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 16:21
by pithy
use it like this

Code: Select all
collision_box = {
      type = "fixed",
      fixed = {
         {-0.5, -0.5, 0, 0.0625, 0.5, 0.5},
         {0.0625, -0.5, 0.0625, 0.125, 0.5, 0.5},
         {0.125, -0.5, 0.125, 0.1875, 0.5, 0.5},
         {0.1875, -0.5, 0.1875, 0.25, 0.5, 0.5},
         {0.25, -0.5, 0.25, 0.3125, 0.5, 0.5},
         {0.3125, -0.5, 0.3125, 0.375, 0.5, 0.5},
         {0.375, -0.5, 0.375, 0.4375, 0.5, 0.5},
         {0.4375, -0.5, 0.4375, 0.5, 0.5, 0.5},
         {-0.5, -0.5, -0.5, -0.4375, 0.5, -0.4375},
         {-0.5, -0.5, -0.4375, -0.375, 0.5, -0.375},
         {-0.5, -0.5, -0.375, -0.3125, 0.5, -0.3125},
         {-0.5, -0.5, -0.3125, -0.25, 0.5, -0.25},
         {-0.5, -0.5, -0.25, -0.1875, 0.5, -0.1875},
         {-0.5, -0.5, -0.1875, -0.125, 0.5, -0.125},
         {-0.5, -0.5, -0.125, -0.0625, 0.5, -0.0625},
         {-0.5, -0.5, -0.0625, 0, 0.5, 0},
         {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
      }
   }


Code: Select all
selection_box = {
      type = "fixed",
      fixed = {
         {-0.5, -0.5, 0, 0.0625, 0.5, 0.5},
         {0.0625, -0.5, 0.0625, 0.125, 0.5, 0.5},
         {0.125, -0.5, 0.125, 0.1875, 0.5, 0.5},
         {0.1875, -0.5, 0.1875, 0.25, 0.5, 0.5},
         {0.25, -0.5, 0.25, 0.3125, 0.5, 0.5},
         {0.3125, -0.5, 0.3125, 0.375, 0.5, 0.5},
         {0.375, -0.5, 0.375, 0.4375, 0.5, 0.5},
         {0.4375, -0.5, 0.4375, 0.5, 0.5, 0.5},
         {-0.5, -0.5, -0.5, -0.4375, 0.5, -0.4375},
         {-0.5, -0.5, -0.4375, -0.375, 0.5, -0.375},
         {-0.5, -0.5, -0.375, -0.3125, 0.5, -0.3125},
         {-0.5, -0.5, -0.3125, -0.25, 0.5, -0.25},
         {-0.5, -0.5, -0.25, -0.1875, 0.5, -0.1875},
         {-0.5, -0.5, -0.1875, -0.125, 0.5, -0.125},
         {-0.5, -0.5, -0.125, -0.0625, 0.5, -0.0625},
         {-0.5, -0.5, -0.0625, 0, 0.5, 0},
         {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
      }
   }

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 16:26
by pithy
Is there any reason for the saw tooth pattern?

With mesh you can remove it, but the selection box will still have it.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 16:45
by TumeniNodes
pithy wrote:Is there any reason for the saw tooth pattern?

With mesh you can remove it, but the selection box will still have it.


The sawtooth is the result of creating it as a nodebox (using the NBE)
sofar created a mesh for me of the stair (which looks beautiful) but..., I do not know how to set it up in the script, using the mesh .obj file
That is the problem I am having. It is the result of my limited knowledge / experience with Lua (coding in general)
The only part I do know, is to use drawtype = mesh, and then to use mesh = to add a link to the .obj file.
From there..., I'm clueless : /
My only way for learning, is to look at other scripts, and tinker with them. But with using mesh I have not been very lucky. I have looked at other mods which use meshes, I have looked through the mod handbook, and even Lua sites with no luck.
So, at this point, I am of the opinion that (although mesh looks superior...) nodebox, sawtooth, and triangles rock! :D
When I tried both ways which you set... I simply bump into the stair and cannot climb it at all. Those are two ways I tried, among 5 other ways

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 20:23
by pithy
I found a bug, you can't use spaces in your file names.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 21:00
by TumeniNodes
pithy wrote:I found a bug, you can't use spaces in your file names.

I used a space? where?

Do you mean a "bug" which is causing the mod to not load? Because it has been running fine for me
Just thought about it..., maybe you are referring to the models names? Because I just realized when I was messing around with all this, that i used spaces such as "angled stairL.obj" (I have to fix those) But even when I did to test, the game crashed trying to use the .obj's produced from NBE.

Re: [Mod]Angled Stairs[angledstairs]

PostPosted: Tue Jun 07, 2016 22:19
by Nathan.S
The collision box will still be the nodeboxes data. You can't use an obj for the collisions. Use the old code you had from the collisions and just the mesh for the visiuals.