Is it possible to have two drawtypes in lua?

User avatar
Aqua
Member
 
Posts: 641
Joined: Wed Aug 22, 2012 09:11

Is it possible to have two drawtypes in lua?

by Aqua » Fri Oct 19, 2012 06:21

Is it possible to have two drawtypes in lua?
Hi there ^.~
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Oct 19, 2012 11:09

You mean 2 drawtypes for the same node?
No, you cant. What do you want it look like?
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Fri Oct 19, 2012 12:30

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
++++ Kung walang tiyaga, walang nilaga. ++++
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Fri Oct 19, 2012 12:53

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.
A list of my mods can be found here.
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Fri Oct 19, 2012 13:15

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
++++ Kung walang tiyaga, walang nilaga. ++++
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Fri Oct 19, 2012 17:13

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.
A list of my mods can be found here.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Oct 19, 2012 17:49

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.
 

User avatar
Aqua
Member
 
Posts: 641
Joined: Wed Aug 22, 2012 09:11

by Aqua » Wed Dec 05, 2012 08:15

I want something like a fence but can be climbed like ladders
Hi there ^.~
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Dec 05, 2012 14:08

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,
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 8 guests

cron