Post your modding questions here

Locked
User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

bdjnk wrote:Is there any way to alter the node definition values on the fly? For example, if I wanted to smoothly transition a node's alpha using a node timer. Is such a thing possible?
Not currently, other than defining a bunch of nodes with different alpha values, and switch them on the fly.
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

dannydanger
Member
Posts: 40
Joined: Mon May 06, 2013 23:55

by dannydanger » Post

how do i make lava torches?
like
nnn
nln
nsn

n - nothing
l - lava
s - stick

or how do i do it?

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

by PilzAdam » Post

dannydanger wrote:how do i make lava torches?
like
nnn
nln
nsn

n - nothing
l - lava
s - stick

or how do i do it?
Ehm..... I dont think this question belongs in this topic.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

I know this isn't related to modding, but what is the limit to the amount of days/votes that there can be in a poll on the minetest forums? I keep getting an error about it when I try to post.
Back from the dead!

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Also, how would I go about detecting a dropped item on top of a node, and if detected, delete it?
Back from the dead!

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

Are dropped items counted as entities? If they are, might that help?
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Dan Duncombe wrote:Are dropped items counted as entities? If they are, might that help?
Yes they are entities. I already knew that. :P
Back from the dead!

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

by bdjnk » Post

I've got some code I'd like to execute whenever a certain type of node is added to the world, including when starting / playing / connecting to the game. Node definitions have lua functions for when hooking to events, for instance on_construct which seemed to most likely candidate, but that doesn't work. Is there some way to do this?

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

bdjnk wrote:I've got some code I'd like to execute whenever a certain type of node is added to the world, including when starting / playing / connecting to the game. Node definitions have lua functions for when hooking to events, for instance on_construct which seemed to most likely candidate, but that doesn't work. Is there some way to do this?
on_construct is only called when the node is placed. Unfortunately, what you require is not so easy (if even practical) to implement.

Edit: I assume you mean the code is run *only* once after connecting. Am I mistaken?
Last edited by kaeza on Thu Jun 20, 2013 04:48, edited 1 time in total.
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

User avatar
bdjnk
Member
Posts: 104
Joined: Wed Mar 20, 2013 21:03
GitHub: bdjnk
Location: New York
Contact:

by bdjnk » Post

kaeza wrote:
bdjnk wrote:
I've got some code I'd like to execute whenever a certain type of node is added to the world, including when starting / playing / connecting to the game. Node definitions have lua functions for when hooking to events, for instance on_construct which seemed to most likely candidate, but that doesn't work. Is there some way to do this?
on_construct is only called when the node is placed. Unfortunately, what you require is not so easy (if even practical) to implement.

Edit: I assume you mean the code is run *only* once after connecting. Am I mistaken?
I wasn't very clear, sorry. Yeah, I want it to run once, but probably just when the game / server starts. I don't think I need it for all connecting / joining. I would've thought there'd be some kind of mapping / node creation process that occurred which I'd be able to link into...

Still, I gonna try and use register_on_joinplayer or register_on_newplayer and a find_nodes_in_area. I don't think it's the "right" answer, but it might work.

Oh, on that note, what is the difference between register_on_joinplayer and register_on_newplayer? The wiki isn't very clear about it.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

bdjnk wrote:
kaeza wrote:
bdjnk wrote:
I've got some code I'd like to execute whenever a certain type of node is added to the world, including when starting / playing / connecting to the game. Node definitions have lua functions for when hooking to events, for instance on_construct which seemed to most likely candidate, but that doesn't work. Is there some way to do this?
on_construct is only called when the node is placed. Unfortunately, what you require is not so easy (if even practical) to implement.

Edit: I assume you mean the code is run *only* once after connecting. Am I mistaken?
I wasn't very clear, sorry. Yeah, I want it to run once, but probably just when the game / server starts. I don't think I need it for all connecting / joining. I would've thought there'd be some kind of mapping / node creation process that occurred which I'd be able to link into...

Still, I gonna try and use register_on_joinplayer or register_on_newplayer and a find_nodes_in_area. I don't think it's the "right" answer, but it might work.

Oh, on that note, what is the difference between register_on_joinplayer and register_on_newplayer? The wiki isn't very clear about it.
on_join gets called every time a player joins. on_new is only called every time a *new* player joins your server (i.e. a player that never joined your server before).
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

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

How do I make a node that plays a certain sound for a certain range upon receiving mesecon signal? Also, how do I change the range? The sound needs to loop as long as a current is being received.
EDIT: Also, with custom nodebox shapes, are the first 3 numbers the box shape, the second 3 the location of the box relative to the node centre?
Last edited by Dan Duncombe on Sun Jun 23, 2013 22:42, edited 1 time in total.
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

1244
Member
Posts: 45
Joined: Fri Jul 13, 2012 16:40
Location: Poland

by 1244 » Post

It is possible to write mod in c++?
My mods:
Barrels, Chemistry

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

1244 wrote:It is possible to write mod in c++?
A .dll or .so that can directly interface with the engine, nope.
Only way to "mod" in C/C++ is by writing patches for the engine.
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

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Dan Duncombe wrote:How do I make a node that plays a certain sound for a certain range upon receiving mesecon signal? Also, how do I change the range? The sound needs to loop as long as a current is being received.
EDIT: Also, with custom nodebox shapes, are the first 3 numbers the box shape, the second 3 the location of the box relative to the node centre?
the first three ones are one corner of the box, and the other three are the other corner.

All positions are relative to the *center* of the node, so -0.5 and 0.5 means the edge. Of course, you can use boxes bigger than a node, but the collision is buggy.
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

User avatar
Mossmanikin
Member
Posts: 599
Joined: Sun May 19, 2013 16:26
Location: where we don't speak english.

by Mossmanikin » Post

Dan Duncombe wrote:EDIT: Also, with custom nodebox shapes, are the first 3 numbers the box shape, the second 3 the location of the box relative to the node centre?
The dimensions of a standard node:

Code: Select all

--              { left  , bottom , front  ,  right ,  top   ,  back  }

local cube =    {-0.5   , -0.5   , -0.5   ,  0.5   ,  0.5   ,  0.5   }

Noob 4 life!
My stuff

User avatar
Dan Duncombe
Member
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Post

So...The first 3 are one half of the block, the other three are the other half of the block?
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.

User avatar
Mossmanikin
Member
Posts: 599
Joined: Sun May 19, 2013 16:26
Location: where we don't speak english.

by Mossmanikin » Post

Dan Duncombe wrote:So...The first 3 are one half of the block, the other three are the other half of the block?
Sort of, yes. But you still need 6 coordinates to draw a "half block". ;)

EDIT: Have you seen this post? VanessaE explains quite well how a nodebox works there.
Last edited by Mossmanikin on Mon Jun 24, 2013 07:41, edited 1 time in total.

Noob 4 life!
My stuff

yohanes828
Member
Posts: 67
Joined: Sat Jun 01, 2013 01:05

by yohanes828 » Post

i have edit blocks

zoropig
Member
Posts: 50
Joined: Fri May 03, 2013 13:18

by zoropig » Post

ok so im making a squid mod but everytime i try to start a minetest game i says that it faild. help plz
i'm new too all this still but i will try to make mods and textures check out my map too!

zoropig
Member
Posts: 50
Joined: Fri May 03, 2013 13:18

by zoropig » Post

how do i make it so that then there will be a boss health at the top of the screen?
i'm new too all this still but i will try to make mods and textures check out my map too!

Thermal_Shock
Member
Posts: 85
Joined: Mon Jun 24, 2013 09:10

by Thermal_Shock » Post

I have a couple of issues at the moment that are hampering me. Most likely entirely because of my limited experience with coding.

The first is that my modded blocks don't seem to work properly when adding them to the stairs mod from the Minetest game. The new node blocks were defined within the default folder in the nodes.lua file just like the Minetest game. These are my block definitions in the stairs mod.

Code: Select all

--
--This one works fine. The Limestone block uses the default stone ID.
--
stairs.register_stair_and_slab("Limestone", "default:stone",
        {cracky=3},
        {"hg_gls.png"},
        "Limestone Stair",
        "Limestone Slab",
        default.node_sound_stone_defaults())

--
--This one and any other new blocks won't work.
--

stairs.register_stair_and_slab("Red Sandstone", "default:red_sandstone",
        {cracky=3},
        {"hg_rss.png"},
        "Red Sandstone Stair",
        "Red Sandstone Slab",
        default.node_sound_stone_defaults())
My second question is, how do I go about adding a new furnace block that only accepts certain blocks for fuel?

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

by PilzAdam » Post

Thermal_Shock wrote:I have a couple of issues at the moment that are hampering me. Most likely entirely because of my limited experience with coding.

The first is that my modded blocks don't seem to work properly when adding them to the stairs mod from the Minetest game. The new node blocks were defined within the default folder in the nodes.lua file just like the Minetest game. These are my block definitions in the stairs mod.

Code: Select all

--
--This one works fine. The Limestone block uses the default stone ID.
--
stairs.register_stair_and_slab("Limestone", "default:stone",
        {cracky=3},
        {"hg_gls.png"},
        "Limestone Stair",
        "Limestone Slab",
        default.node_sound_stone_defaults())

--
--This one and any other new blocks won't work.
--

stairs.register_stair_and_slab("Red Sandstone", "default:red_sandstone",
        {cracky=3},
        {"hg_rss.png"},
        "Red Sandstone Stair",
        "Red Sandstone Slab",
        default.node_sound_stone_defaults())
There is no node called "default:red_sandstoe" in the default mod, so the recipes wont work.

Thermal_Shock
Member
Posts: 85
Joined: Mon Jun 24, 2013 09:10

by Thermal_Shock » Post

PilzAdam wrote:There is no node called "default:red_sandstoe" in the default mod, so the recipes wont work.
Oh. You misunderstand. My new node's are added to the node.lua file.

Edit:

Well this is interesting. It seems removing the space in "Red Sandstone" to "RedSandstone" fixed the issue and now it works as intended.

Code: Select all

stairs.register_stair_and_slab("RedSandstone", "default:red_sandstone",
        {cracky=3},
        {"hg_rss.png"},
        "Red Sandstone Stair",
        "Red Sandstone Slab",
        default.node_sound_stone_defaults())
What exactly is that first part for then?
Last edited by Thermal_Shock on Wed Jun 26, 2013 21:18, edited 1 time in total.

ch98
Member
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Post

My concrete 2.2 mod seems to shut server down when you dig the concrete.
Code causing the problem most likely is...

Code: Select all

minetest.register_node("concrete:concrete", {
    description = "Concrete",
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete4")
    end,
})

minetest.register_node("concrete:concrete1", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete2")
    end,
})

minetest.register_node("concrete:concrete2", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete3")
    end,
})

minetest.register_node("concrete:concrete3", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete")
    end,
})

minetest.register_node("concrete:concrete4", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete5")
    end,
})

minetest.register_node("concrete:concrete5", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete6")
    end,
})

minetest.register_node("concrete:concrete6", {
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
})

minetest.register_node("concrete:reinforced_concrete", {
    description = "Reinforced Concerte",
    tiles = {"concrete_concrete.png"},
    is_ground_content = true,
    groups = {cracky=1},
    drop = "concrete:gravel_mound",
    after_destruct = function(pos)
        minetest.env:set_node(pos, "concrete:concrete1")
    end,
})
can you find the problem?
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

Locked

Who is online

Users browsing this forum: No registered users and 1 guest