Page 1 of 1

Is it possible to have two drawtypes in lua?

PostPosted: Fri Oct 19, 2012 06:21
by Aqua
Is it possible to have two drawtypes in lua?

PostPosted: Fri Oct 19, 2012 11:09
by PilzAdam
You mean 2 drawtypes for the same node?
No, you cant. What do you want it look like?

PostPosted: Fri Oct 19, 2012 12:30
by tkerwel
in one lua file
...yes, even more depends how many minetest.register_node's you have in that file

in one minetest.register_node
.. no cause this is a value for the node you discribe with you code, there is only one drawtype posible in one node

PostPosted: Fri Oct 19, 2012 12:53
by Sokomine
It seems to be possible to combine diffrent drawtypes with a nodebox for collision detection. Thus it is possible to have raillike roof parts that act like stairs.

PostPosted: Fri Oct 19, 2012 13:15
by tkerwel
Sokomine wrote:It seems to be possible to combine diffrent drawtypes with a nodebox for collision detection. Thus it is possible to have raillike roof parts that act like stairs.


due to the api thats not right. the minetest.registered_nodes[node.name] has two parameters. param1 and param2 are 8 bit integers. The engine uses them for certain automated functions.

param1 => value stores light with and without sun in it's upper and lower 4 bits.

param2 => is used for liquidtype or drawtype or paramtype2

so i dont see how you can acess two different drawtypes within this funciton.

Stairs are done with the nodebox function, and roof are simulated thru the drawtype raillike

PostPosted: Fri Oct 19, 2012 17:13
by Sokomine
What I wanted to say is that it seems you can use a nodebox with a diffrent drawtype than "nodebox" (i.e. raillike). The drawtype is raillike but it acts like a stair (or whatever nodebox is used). At least it works for me. The roof is not very convincing since diffrent raillike drawings do not align to each other (for glass parts this would be necessary) and there is no good way to do borders/connecting other nodes.

PostPosted: Fri Oct 19, 2012 17:49
by PilzAdam
Sokomine wrote:What I wanted to say is that it seems you can use a nodebox with a diffrent drawtype than "nodebox" (i.e. raillike). The drawtype is raillike but it acts like a stair (or whatever nodebox is used). At least it works for me. The roof is not very convincing since diffrent raillike drawings do not align to each other (for glass parts this would be necessary) and there is no good way to do borders/connecting other nodes.

That is possible. The nodebox field is always used (as collisionbox). It is only a drawtype if you set drawtype = "nodebox".
But this is not a combination of 2 drawtypes.

PostPosted: Wed Dec 05, 2012 08:15
by Aqua
I want something like a fence but can be climbed like ladders

PostPosted: Wed Dec 05, 2012 14:08
by PilzAdam
Aqua wrote:I want something like a fence but can be climbed like ladders

Use the drawtype fencelike, make it not walkable and climbable:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
drawtype = "fencelike",
walkable = false,
climbable = true,