Post your modding questions here
How do I use add_node or set_node to create other nodes? i am making a plasma screen TV mod which has 6 nodes, arranged like this:
1 2 3
4 5 6
5 is the node that is placed, and when the player places it the other 5 nodes should generate. However, I don't know how to do this, and looking in the code for the stargate mod, doors mod and beds mod did not help - the first two were more complicated, and I don't even know where I'm going wrong using code from beds, so I would like to start from scratch.
1 2 3
4 5 6
5 is the node that is placed, and when the player places it the other 5 nodes should generate. However, I don't know how to do this, and looking in the code for the stargate mod, doors mod and beds mod did not help - the first two were more complicated, and I don't even know where I'm going wrong using code from beds, so I would like to start from scratch.
- webdesigner97
- Member
- Posts: 1327
- Joined: Mon Jul 30, 2012 19:16
- GitHub: webD97
- IRC: webdesigner97
- In-game: webdesigner97
- Location: Cologne, Germany
- Contact:
webdesigner97 wrote:If you need your manually placed node to facedir, make sure to add param2 to the node:
And for changing pictures: Why not use a texture animation?Code: Select all
after_place_node = function(pos,placer,itemstack) --Don't forget to modify the <pos> table minetest.set_node(pos,{name="bla", param2=minetest.dir_to_facedir(placer:get_look_dir())}) end
Visit me: webD97.de | @GitHub | @DeviantArt
Mods: StreetsMod | Vehicles
Featured from my blog: Dockerize the Minetest server
On my own behalf: Chameleon - A PHP image manipulation library built around GD
Mods: StreetsMod | Vehicles
Featured from my blog: Dockerize the Minetest server
On my own behalf: Chameleon - A PHP image manipulation library built around GD
- dannydanger
- Member
- Posts: 40
- Joined: Mon May 06, 2013 23:55
You mean the one from VanessaE's homedecor? -->dannydanger wrote:how do you make terracotta roof tile
http://minetest-home-decor.wikia.com/wi ... Decor_Wiki
- Casimir
- Member
- Posts: 1189
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Code: Select all
on_rightclick = function(pos, node, clicker)
local inv = clicker:get_inventory()
if inv:room_for_item("main", {name="flowers:pot", count=1, wear=0, metadata=""}) then
node.name = "flowers:dandelion_white"
minetest.env:set_node(pos, node)
minetest.sound_play("default_dug_node", {pos,gain = 1.0})
inv:add_item("main", "flowers:pot")
end
end,
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
have you tried removing 'wear=0' from the room_for_item() call? It sounds silly, but 'wear' should only be set on tools (note that '0' is neither nil, nor a "false" boolean value).Casimir wrote:Everything works, except adding the item. It is added when there is already a stack of flowers:pot in the inventory, but not when there is non.Code: Select all
on_rightclick = function(pos, node, clicker) local inv = clicker:get_inventory() if inv:room_for_item("main", {name="flowers:pot", count=1, wear=0, metadata=""}) then node.name = "flowers:dandelion_white" minetest.env:set_node(pos, node) minetest.sound_play("default_dug_node", {pos,gain = 1.0}) inv:add_item("main", "flowers:pot") end end,
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!
Check out my stuff! | Donations greatly appreciated! PayPal
Check out my stuff! | Donations greatly appreciated! PayPal
- Casimir
- Member
- Posts: 1189
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Setting the node and playing sound is working, so that's not the problem.
At the moment I have a much bigger one: I moved a mod into another folder, because I wanted to publish it. Using strg-x and strg-v and then is just disappeared
Is is Mint, is it Thunar or is it me who has done something wrong? (Yes, I should have made backups.)
It might be to late at night - I'm very confused - in the game everything still works but the mod-folder is nowhere.
At the moment I have a much bigger one: I moved a mod into another folder, because I wanted to publish it. Using strg-x and strg-v and then is just disappeared

Is is Mint, is it Thunar or is it me who has done something wrong? (Yes, I should have made backups.)
It might be to late at night - I'm very confused - in the game everything still works but the mod-folder is nowhere.
Last edited by Casimir on Mon Jul 29, 2013 02:42, edited 1 time in total.
- fairiestoy
- Member
- Posts: 191
- Joined: Sun Jun 09, 2013 19:25
- Location: Germany
Hello guys,
is it possible to access the tiles that were used on minetest.register_node( <parameters> ) ? I found param1 & param2 as well as the name, but no way to find the registered image files used for that specific tile. Is that somehow possible?
(If i missed something really obvious, sorry for that :-/ )
Greetings
is it possible to access the tiles that were used on minetest.register_node( <parameters> ) ? I found param1 & param2 as well as the name, but no way to find the registered image files used for that specific tile. Is that somehow possible?
(If i missed something really obvious, sorry for that :-/ )
Greetings
Interesting about new things is, to figure out how it works ...
- Casimir
- Member
- Posts: 1189
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
I don't understand what you mean but this might help: https://github.com/minetest/minetest/bl ... .txt#L1956
Do you want to change the texture of a node (like stone and desertstone) or the way it is displayed (like papyrus/stone/torch/sign/rail...)?
Do you want to change the texture of a node (like stone and desertstone) or the way it is displayed (like papyrus/stone/torch/sign/rail...)?
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
fairiestoy wrote:Hello guys,
is it possible to access the tiles that were used on minetest.register_node( <parameters> ) ? I found param1 & param2 as well as the name, but no way to find the registered image files used for that specific tile. Is that somehow possible?
(If i missed something really obvious, sorry for that :-/ )
Greetings
Code: Select all
local first_tile = minetest.registered_nodes["default:wood"].tiles[1]
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!
Check out my stuff! | Donations greatly appreciated! PayPal
Check out my stuff! | Donations greatly appreciated! PayPal
- fairiestoy
- Member
- Posts: 191
- Joined: Sun Jun 09, 2013 19:25
- Location: Germany
Thanks kaeza. Thats exactly what im looking for :3kaeza wrote:Code: Select all
local first_tile = minetest.registered_nodes["default:wood"].tiles[1]
I dont want to change it. I need the references to see, if i can create a way of changing the appearance of a node ( with use of a dummy node ) especially its mesh in a way that is not dependent on hard coded links to other mods. As example:Casimir wrote:I don't understand what you mean but this might help: https://github.com/minetest/minetest/bl ... .txt#L1956
Do you want to change the texture of a node (like stone and desertstone) or the way it is displayed (like papyrus/stone/torch/sign/rail...)?
The stairpick mod uses references to the stairsplus stairs. So it looks up the fitting stairs out of this mod in order to replace the node you are pointing to and replace it with the stair.
BUT if you are capable of accessing the tiles of a registered node, you could create a stairpick (as example) that uses no references to other mods. Instead it uses a dummy model of a mesh (also an example) and assigns the texture of the node you were pointing to in the first place.
I hope this will work ( up to now its only a idea)
Interesting about new things is, to figure out how it works ...
- Dan Duncombe
- Member
- Posts: 904
- Joined: Thu May 09, 2013 21:11
- Location: In the unknown depths of Earth
To make a node have facedir:Exilyth wrote:How do you use the facedir param (param2) of nodes? E.g. how do you make the facedir of a node depend on where the player looked when it is placed?
Code: Select all
paramtype2 = "facedir",
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
My Games: Nostalgia Realtest Revamped
Servers: See above games.
D'oh.Dan Duncombe wrote:To make a node have facedir:Exilyth wrote:How do you use the facedir param (param2) of nodes? E.g. how do you make the facedir of a node depend on where the player looked when it is placed?Code: Select all
paramtype2 = "facedir",
I looked up the paramtype2 line of my node definition in my code again and saw this...
Code: Select all
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 == "facedir",
on_construct = function(pos)
....

I fixed that line, now it works like a charm.
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
I have a node with paramtype2 = "facedir" and an abm which gets called on that node.
Why doesgive me an error saying the method facedir_to_dir is a nil value?
Why doesgive me an error saying the field facedir_to_dir is a nil value?
How are you supposed to call facedir_to_dir then?
(I'm using 0.4.7 stable btw)
Why does
Code: Select all
local direction = minetest:facedir_to_dir(minetest.env:get_node(pos).param2)
Why does
Code: Select all
local direction = minetest.facedir_to_dir(minetest.env:get_node(pos).param2)
How are you supposed to call facedir_to_dir then?
(I'm using 0.4.7 stable btw)
I'm running 0.4.13 stable with [technic][carts][farming_plus][biome_lib][unified_inventory] and a few other mods.
Here's a question, is there a command or way to change the textures on a node that has been placed into the world? For instance I have a node and I place it in the world. I then punch the node and have some lua code run but I would like to change the texture on the node. I already replace the original node with a new one but I have 8 textures to run through and I would rather not create a new node for each texture and replace each one with the new one every time. A simple command to change the texture is what I would really like. I have done searches but haven't found anything.
Who is online
Users browsing this forum: Bing [Bot] and 2 guests