Nubm wrote:However, its pretty confusing since the bridge parts look very similar. I could add a number to the inventory image, but i rather have a single block (or tool maybe) that will place one of the nodes at random, and returns the block back to one node if digged. Is it even possible? Its fairly simple with images (for example grass uses this) but can i do it somehow with nodebox blocks?
Nubm wrote:Wow, that was easy. Thank you so very very much!
Works perfect. :)
Nubm wrote:Well, there is one question to finalize my plank bridge: Can i rotate the placed tile at random (coin flip) on the z axis? This would double the variations. Not that i really need those since the planks look pretty similar, but i have some more ideas how to put that to use. :)
However, im not sure if it is possible to rotate tiles like that on place.
Nubm wrote:Also, just as an idea, could i create a block that randomly selects one of five nodes (like the bridge parts) and selects a random texture out of five as well? That should result in 25 unique blocks out of 5 registered nodes and 5 textures, does it? That could be great for objects like stones or maybe bushes or other plants.
srifqi wrote:To do coin flip you must register another node with flipped nodeboxes (as you mention before). Because if you only do coin flip, the bridge will be floating above the block below.
srifqi wrote:Nice idea! You may register more node ("b:ridge_1_1","b:ridge_1_2").
Nubm wrote:Well, there is one question to finalize my plank bridge: Can i rotate the placed tile at random (coin flip) on the z axis? This would double the variations. Not that i really need those since the planks look pretty similar, but i have some more ideas how to put that to use. :)
However, im not sure if it is possible to rotate tiles like that on place.
LionsDen wrote:Unless there have been engine changes, when you register a node you have to tell it what texture(s) are being used. There is currently no way to change those textures afterwards. You are unfortunately limited to whatever node you register. So if you want 25 different textured nodes, you have to register 25 nodes. The only possible difference I have heard of is the colorization ability which can change the colors (I think). I haven't played with that but I think there are a few mods out there that do and you could possibly find and learn about from them.
LionsDen wrote:Unless there have been engine changes, when you register a node you have to tell it what texture(s) are being used. There is currently no way to change those textures afterwards. You are unfortunately limited to whatever node you register. So if you want 25 different textured nodes, you have to register 25 nodes. The only possible difference I have heard of is the colorization ability which can change the colors (I think). I haven't played with that but I think there are a few mods out there that do and you could possibly find and learn about from them.
Sokomine wrote:Nubm wrote:Well, there is one question to finalize my plank bridge: Can i rotate the placed tile at random (coin flip) on the z axis? This would double the variations. Not that i really need those since the planks look pretty similar, but i have some more ideas how to put that to use. :)
However, im not sure if it is possible to rotate tiles like that on place.
The way your bridge looks, you could rotate some parts randomly by 180 degrees if that's what you've got in mind. That would require a diffrent param2. Other than that, if you want a diffrent texture, you need to register a new node.
Maybe you'll also be intrested in my bridges and handrail mod. It has a self-building bridge.
I'm looking forward to see your mod released.
prestidigitator wrote:Different colors can use a texture specification to share the same base texture image (e.g. file name), but they are still different textures and must be applied to different registered nodes. It's commonly done in a loop with a template pattern for the name (e.g. "mymod:thing_red", "mymod:thing_blue", etc.).
Nubm wrote:- How do fences work?
- I made some nodes that have values greater than .5 in the nodeboxes. For example, a stair that is 2 nodes long and a wall that has a little support plank to fit on the stillages. It works (boxes greater than 3 nodes away won't have collision it seems), but it is recommended? Also, is it possible to check for the node i place them on, so it can only be placed on objects from - for example - a specific mod?
if pointed_thing.type == 'node' then
minetest.set_node(pointed_thing.above, (name = 'more_fire:marking'})
Nathan.S wrote:I have a tool that places a node, a marker and an arrow, however I want the arrow to point in the direction that the user is pointing when they use the tool. I have the node set so if you place it directly all works as it should, but when using it as a tool it doesn't. Is this possible, am I just missing something really obvious?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
if pointed_thing.type == 'node' then
minetest.set_node(pointed_thing.above, (name = 'more_fire:marking'})
Don wrote:Nathan.S wrote:I have a tool that places a node, a marker and an arrow, however I want the arrow to point in the direction that the user is pointing when they use the tool. I have the node set so if you place it directly all works as it should, but when using it as a tool it doesn't. Is this possible, am I just missing something really obvious?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
if pointed_thing.type == 'node' then
minetest.set_node(pointed_thing.above, (name = 'more_fire:marking'})
Funny you ask that. I was trying to figure out how to convert look dir to a param2.
Can someone give an explanation of what get look dir returns?
if pointed_thing.type == 'node' then
minetest.set_node(pointed_thing.above, {name = 'more_fire:marking', param2=minetest.dir_to_facedir(player:get_look_dir())})
Rui wrote:What minutes one day in the game?
local time_speed = tonumber(minetest.setting_get("time_speed")) or 72;
local minutes_per_day = 24 * 60 / time_speed;
maikerumine wrote:Quick question about changing nodes with a mod...
What is the best way to change nodes on event?
Currently I am using register abm and light value to change nodes, it works and all but I think u am asking for way too much CPU power and lag.
Is there an efficient way to change nodes?
ABJ wrote:How do I attach a node to an entity?
And I would like to know how to make an entity explode when an event occurs.
DanteLives wrote:topic: How do I have the nodes checked above and below the node that the player places and then change those nodes depending on their identities? In other words, the mod consists of one block. If that block is placed either above or below a previously placed block of that type then the mod will change that node and the neighboring node into another type.
minetest.register_node(...
{
...
after_place_node = function(pos, placer, itemStack, pointedThing)
local topPos = { x = pos.x, y = pos.y + 1, z = pos.z };
local bottomPos = { x = pos.x, y = pos.y + 1, z = pos.z };
if minetest.get_node(topPos).name == ... then
...
minetest.set_node(topPos, { name = ... });
...
end
if minetest.get_node(bottomPos).name == ... then
...
minetest.set_node(bottomPos, { name = ... });
...
end
end,
...
};
function effect(pos, amount, texture, max_size)
minetest.add_particlespawner({
amount = amount, -- how many particles do you want
time = 0.25, -- spawner stops after this time (use 0 for infinite)
minpos = {x=pos.x-2, y=pos.y-2, z=pos.z-2}, -- minimum offset
maxpos = {x=pos.x+2, y=pos.y+2, z=pos.z+2}, -- maximum offset
minvel = {x=-2, y=-2, z=-2}, -- minimum velocity
maxvel = {x=2, y=2, z=2}, -- maximum velocity
minacc = {x=-4, y=-4, z=-4}, -- minimum acceleration
maxacc = {x=4, y=4, z=4}, -- maximim acceleration
minexptime = 0.1, -- minimum expiration time
maxexptime = 1, -- maximum expiration time
minsize = 0.5, -- minimum size (0.5 = half size)
maxsize = (max_size or 1), -- maximum size (1=full resolution)
collisiondetection = false, -- do particles stop when they hit solid node
texture = texture, -- image to use (e.g. "bubble.png" )
vertical = false, -- upright/vertical image for rain
playername = "singleplayer", -- particles only appear for this player
})
end
minetest.delete_particlespawner(id, player)Nathan.S wrote:Question related to particles, I'm adding them to my more_fire mod, and they are working great, however when I want to remove a particle spawner I end up deleting them all. according to the wiki I need to useYour phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.and in the description it says 'Deletes ParticleSpawner with id (return value from add_particlespawner)' How do I know what the id is though, I don't see anything in the particle spawner that says what the id will be. Currently I'm using an id of 1, which just deletes all spawners.
- Code: Select all
minetest.delete_particlespawner(id, player)
Users browsing this forum: No registered users and 8 guests