Post your modding questions here

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Sat Jun 01, 2013 01:14

Mossmanikin wrote:How do I overwrite a node like trees:tree_conifer from Tiny Trees?

I want to do this in my mod Alternative Trunks.

Here's an example of something I tried:

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
local cube =    {-0.5   ,  -0.5   ,  -0.5   ,  0.5   ,  0.5   ,  0.5   }

local cylinder = {
                {-0.1875,  -0.5   ,  -0.5   ,  0.1875,  0.5   ,  0.5   },
                {-0.5   ,  -0.5   ,  -0.1875,  0.5   ,  0.5   ,  0.1875},   
                {-0.3125,  -0.5   ,  -0.4375,  0.3125,  0.5   ,  0.4375},
                {-0.4375,  -0.5   ,  -0.3125,  0.4375,  0.5   ,  0.3125},   
                {-0.375 ,  -0.5   ,  -0.375 ,  0.375 ,  0.5   ,  0.375 },
}

if minetest.get_modpath("trees") ~= nil then
minetest.register_node(":trees:tree_conifer", {
    description = "Conifer trunk",
    paramtype = "light",
    tiles = {
        "trees_tree_top_conifer.png",
        "trees_tree_top_conifer.png",
        "trees_tree_conifer.png"},
    drawtype = "nodebox",
    selection_box = {
        type = "fixed",
        fixed = cube,
    },
    node_box = {
        type = "fixed",
        fixed = cylinder,
    },
    groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
    sounds = default.node_sound_wood_defaults(),
})
end


This doesn't work.
What did I do wrong?

Your code has nothing wrong. What I assume here is that the 'trees' mod is loaded after 'alttrunks', thus overwriting your definition.

You could fix that by putting 'trees' in optdepends.txt, or 'trees?' in depends.txt (requires git version of server though).

Edit: typo
Last edited by kaeza on Sat Jun 01, 2013 01:16, 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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Sat Jun 01, 2013 10:48

12Me21 wrote:How do you make textures work on nodes that have nodeboxes bigger than a node? The only example I could find is the hydro turbine in mesecons, and I don't see anything special in the code.


Think of the nodebox-node as the central node with 6 borders; at a distance of 0.5 ({-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}).

Imagine that your (central)nodebox-node is surrounded by nodes/cubes with the same proportions ({-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}).

For a bigger texture you'll need to cross a border of your central nodebox.

Jeija wanted to build 'higher/on top' of the central nodebox. So with the vertical coordinates he 'crossed' the top (+ 0.5) border of his cental nodebox:

Hydroturbine:

type = "fixed",
fixed = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.15, 0.5, -0.15, 0.15, 1.45, 0.15},
{-0.45, 1.15, -0.1, 0.45, 1.45, 0.1},
{-0.1, 1.15, -0.45, 0.1, 1.45, 0.45}},
},

To be precise, he crossed also the second border of 1.0 and draws also a texture in the second 'box' on top of the central nodebox.
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Sat Jun 01, 2013 12:06

kaeza wrote:
Mossmanikin wrote:How do I overwrite a node like trees:tree_conifer from Tiny Trees?

I want to do this in my mod Alternative Trunks.

Here's an example of something I tried:

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
local cube =    {-0.5   ,  -0.5   ,  -0.5   ,  0.5   ,  0.5   ,  0.5   }

local cylinder = {
                {-0.1875,  -0.5   ,  -0.5   ,  0.1875,  0.5   ,  0.5   },
                {-0.5   ,  -0.5   ,  -0.1875,  0.5   ,  0.5   ,  0.1875},   
                {-0.3125,  -0.5   ,  -0.4375,  0.3125,  0.5   ,  0.4375},
                {-0.4375,  -0.5   ,  -0.3125,  0.4375,  0.5   ,  0.3125},   
                {-0.375 ,  -0.5   ,  -0.375 ,  0.375 ,  0.5   ,  0.375 },
}

if minetest.get_modpath("trees") ~= nil then
minetest.register_node(":trees:tree_conifer", {
    description = "Conifer trunk",
    paramtype = "light",
    tiles = {
        "trees_tree_top_conifer.png",
        "trees_tree_top_conifer.png",
        "trees_tree_conifer.png"},
    drawtype = "nodebox",
    selection_box = {
        type = "fixed",
        fixed = cube,
    },
    node_box = {
        type = "fixed",
        fixed = cylinder,
    },
    groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
    sounds = default.node_sound_wood_defaults(),
})
end


This doesn't work.
What did I do wrong?

Your code has nothing wrong. What I assume here is that the 'trees' mod is loaded after 'alttrunks', thus overwriting your definition.

You could fix that by putting 'trees' in optdepends.txt, or 'trees?' in depends.txt (requires git version of server though).

Edit: typo


Thank you sooo much!
Now it works. :)

Noob 4 life!
My stuff
 

SilverFlame
New member
 
Posts: 6
Joined: Sat May 25, 2013 05:42

by SilverFlame » Mon Jun 03, 2013 01:19

i changed my version of minetest and still cannot install mods...i have 0.4.6 now and am having a lot of difficulty getting them to work. i keep getting an error message. i have microsoft windows 7 ultimate edition service pack one <build 7601> from what the black minetest window says. i am lost. is there a very detailed guide somewhere?
 

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

by PilzAdam » Mon Jun 03, 2013 11:22

SilverFlame wrote:i changed my version of minetest and still cannot install mods...i have 0.4.6 now and am having a lot of difficulty getting them to work. i keep getting an error message. i have microsoft windows 7 ultimate edition service pack one <build 7601> from what the black minetest window says. i am lost. is there a very detailed guide somewhere?

http://c55.me/minetest2/wiki/doku.php?id=installing_mods
Have you looked at this?
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Mon Jun 03, 2013 13:52

I have been making a trash can mod, and I have gotten the formspecs to look the way I want them to. My question is, how do I get the items to be deleted when the button "Clear Trash" is clicked. Code:
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
minetest.register_node("trash_can:trash_can_empty",{
    groups = {choppy=2},
    tiles = {"default_wood.png"},
    drawtype="nodebox",
    paramtype = "light",
    node_box = {
        type = "fixed",
        fixed = {
            {-0.375000,-0.500000,0.312500,0.375000,0.500000,0.375000},
            {0.312500,-0.500000,-0.375000,0.375000,0.500000,0.375000},
            {-0.375000,-0.500000,-0.375000,0.375000,0.500000,-0.312500},
            {-0.375000,-0.500000,-0.375000,-0.312500,0.500000,0.375000},
            {-0.312500,-0.500000,-0.312500,0.312500,-0.437500,0.312500},
        }
    },
    on_construct = function(pos)
        local meta = minetest.env:get_meta(pos)
        meta:set_string("formspec",
                "size[8,9]"..
                "button[0,0;2,1;name;Empty Trash]"..
                "list[current_name;main;3,1;2,3;]"..
                "list[current_player;main;0,5;8,4;]")
        meta:set_string("infotext", "Trash Can")
        local inv = meta:get_inventory()
        inv:set_size("main", 8*4)
    end,
    can_dig = function(pos,player)
        local meta = minetest.env:get_meta(pos);
        local inv = meta:get_inventory()
        return inv:is_empty("main")
    end,
    on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
        minetest.log("action", player:get_player_name()..
                " moves stuff in trash can at "..minetest.pos_to_string(pos))
    end,
    on_metadata_inventory_put = function(pos, listname, index, stack, player)
        minetest.log("action", player:get_player_name()..
                " moves stuff to trash can at "..minetest.pos_to_string(pos))
    end,
    on_metadata_inventory_take = function(pos, listname, index, stack, player)
        minetest.log("action", player:get_player_name()..
                " takes stuff from trash can at "..minetest.pos_to_string(pos))
    end,
})
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Mon Jun 03, 2013 14:03

Evergreen wrote:I have been making a trash can mod, and I have gotten the formspecs to look the way I want them to. My question is, how do I get the items to be deleted when the button "Clear Trash" is clicked. Code:
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
-snip-

You need to use on_receive_fields.

Give a meaningful name to the 'empty trash' button:
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
(...)
"button[0,0;2,1;empty;Empty Trash]"..
(...)


then check it in on_receive_fields:
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
on_receive_fields = function(pos, formname, fields, sender)
  if fields.empty then
    -- code to clear inv here
  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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Mon Jun 03, 2013 14:07

kaeza wrote:
Evergreen wrote:I have been making a trash can mod, and I have gotten the formspecs to look the way I want them to. My question is, how do I get the items to be deleted when the button "Clear Trash" is clicked. Code:
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
-snip-

You need to use on_receive_fields.

Give a meaningful name to the 'empty trash' button:
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
(...)
"button[0,0;2,1;empty;Empty Trash]"..
(...)


then check it in on_receive_fields:
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
on_receive_fields = function(pos, formname, fields, sender)
  if fields.empty then
    -- code to clear inv here
  end
end,

I'm guessing one way of clearing the items is deleting the metadeta. However, I don't know how to do that.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Tue Jun 04, 2013 13:16

Also something else that I want to do is make the trash can switch to a nodebox that makes the trash can look full. I tried this but it didn't work. (I'm pretty sure this isn't very good syntax, but I don't know that much about using the lua api) Code: (this is just the part I need help with)
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 is_empty = function("trash") == "true" then
        node_box = {
        type = "fixed",
        fixed = {
            {-0.375000,-0.500000,0.312500,0.375000,0.500000,0.375000},
            {0.312500,-0.500000,-0.375000,0.375000,0.500000,0.375000},
            {-0.375000,-0.500000,-0.375000,0.375000,0.500000,-0.312500},
            {-0.375000,-0.500000,-0.375000,-0.312500,0.500000,0.375000},
            {-0.312500,-0.500000,-0.312500,0.312500,-0.437500,0.312500},
        }
    },
elseif is_empty = function ("trash") == "" then
        node_box = {
        type = "fixed",
        fixed = {
            {-0.375000,-0.500000,0.312500,0.375000,0.500000,0.375000}, --NodeBox 1
            {0.312500,-0.500000,-0.375000,0.375000,0.500000,0.375000}, --NodeBox 2
            {-0.375000,-0.500000,-0.375000,0.375000,0.500000,-0.312500}, --NodeBox 3
            {-0.375000,-0.500000,-0.375000,-0.312500,0.500000,0.375000}, --NodeBox 4
            {-0.312500,-0.500000,-0.312500,0.312500,0.375000,0.312500}, --NodeBox 5
        }
    }
end,

(also, trash is the name of the formspec/list I want to check for being full or not)
Last edited by Evergreen on Tue Jun 04, 2013 13:17, edited 1 time in total.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Tue Jun 04, 2013 13:27

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 is_empty = function("trash") == "true" then

What are you trying to do here? With "a = b" you define that a is b, with "b == c" you ask if b is c.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Tue Jun 04, 2013 13:35

Casimir wrote:
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 is_empty = function("trash") == "true" then

What are you trying to do here? With "a = b" you define that a is b, with "b == c" you ask if b is c.

What I'm trying to do is check whether or not the "trash" list is empty or not. I know the syntax is terrible, but I don't know where/how to include stuff like that.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by PilzAdam » Tue Jun 04, 2013 14:20

lol, you just invent your own syntax :D

You cant change the nodebox of a node at runtime.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Tue Jun 04, 2013 14:54

PilzAdam wrote:lol, you just invent your own syntax :D

You cant change the nodebox of a node at runtime.

Huh boy, I was hoping that I could do it that way. How else can I do it? How do I make it change nodeboxes and still keep the same metadeta and formspec?
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
Pavel_S
Member
 
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Wed Jun 05, 2013 05:16

Can I attach nodes to entity, and rotate and move as I want?
Can collision box be multy-blocky?
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Jun 05, 2013 05:28

Pavel_S wrote:Can I attach nodes to entity, and rotate and move as I want?
Can collision box be multy-blocky?

For first question: you can't. Nodes are static. But you can simulate it in the same way as falling nodes are implemented.

For second: I don't think so.

:/
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 | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
Pavel_S
Member
 
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Wed Jun 05, 2013 05:34

kaeza wrote:For second: I don't think so.

:/

Yeah I test it. Don`t work=(

How to attach one entity to another entity?

EDIT:
Hey! I can create animated chest.
Last edited by Pavel_S on Wed Jun 05, 2013 05:53, edited 1 time in total.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Wed Jun 05, 2013 19:49

Image
Trying to make a skyblock like game, but with water.
The problem is, trees and grass are not growing. Is that because they check for mapgen nodes and I set mapgen_dirt = water ?
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Thu Jun 06, 2013 09:09

Casimir wrote:Trying to make a skyblock like game, but with water.
The problem is, trees and grass are not growing. Is that because they check for mapgen nodes and I set mapgen_dirt = water ?


Maybe this helps you:

A bit older versions of default use for dirt with grass (init.lua)
groups = {crumbly=3},

A later version I have (default, but now in nodes.lua) uses
groups = {crumbly=3,soil=1},

As far as I understood saplings are made into trees in c++ (content_abm.cpp) which checks the presence of [soil].
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Thu Jun 06, 2013 17:29

I updated and now it works. Thank you.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat Jun 08, 2013 16:58

Question: Do skins from minecraft work in minetest? I need a template for my skin, and was wondering if one from minecraft would work in minetest.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Sat Jun 08, 2013 17:33

Evergreen wrote:Question: Do skins from minecraft work in minetest? I need a template for my skin, and was wondering if one from minecraft would work in minetest.

Yes, the Minecraft 3D skins are 100% compatible to the player model in Minetest
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat Jun 08, 2013 18:00

webdesigner97 wrote:
Evergreen wrote:Question: Do skins from minecraft work in minetest? I need a template for my skin, and was wondering if one from minecraft would work in minetest.

Yes, the Minecraft 3D skins are 100% compatible to the player model in Minetest

Okay, thanks. :D
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

User avatar
AndrOn
Member
 
Posts: 38
Joined: Fri May 31, 2013 22:32

by AndrOn » Sun Jun 09, 2013 10:17

How do you use a global function?
i've tried to do my own sprint mod but first I have to change the speed of the player. So I tried this:

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
minetest.register_chatcommand("run", {
    params = "",
    description = "run",
    func = function(name, param)
       
        set_physics_override(3, 1.2, 1);
       
       
            minetest.chat_send_player(name, "You are now running");
       
           end,
})



But when I type the command /run it crashes, displaying:
error: attempt to call global 'set_physics_override' (a nil value)
Last edited by AndrOn on Sun Jun 09, 2013 10:18, edited 1 time in total.
sorry for bad english
 

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

by PilzAdam » Sun Jun 09, 2013 11:09

AndrOn wrote:How do you use a global function?
i've tried to do my own sprint mod but first I have to change the speed of the player. So I tried this:

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
minetest.register_chatcommand("run", {
    params = "",
    description = "run",
    func = function(name, param)
       
        set_physics_override(3, 1.2, 1);
       
       
            minetest.chat_send_player(name, "You are now running");
       
           end,
})



But when I type the command /run it crashes, displaying:
error: attempt to call global 'set_physics_override' (a nil value)

Oh man, fix your indentation.

The set_physics_override function is a part of a player object. You can get a reference to it by using something like minetest.get_player_by_name(name), so your code should look like this:
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
minetest.register_chatcommand("run", {
    params = "",
    description = "run",
    func = function(name, param)
        minetest.get_player_by_name(name):set_physics_override(3, 1.2, 1)
        minetest.chat_send_player(name, "You are now running")
    end,
})

 

User avatar
AndrOn
Member
 
Posts: 38
Joined: Fri May 31, 2013 22:32

by AndrOn » Sun Jun 09, 2013 12:39

Thanks PilzAdam I am new to lua (sorry for the indentation). I didn't knew the object handling in lua. However I have another error with my new code which is:

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
minetest.register_chatcommand("run", {
    params = "",
    description = "run",
    func = function()
    for _, p in ipairs(minetest.get_connected_players()) do
            p:set_physics_override(3, 1.2, 1)
            end
    end,
})


(yes for the moment it affects all the players but I couldn't load your code and I want to use it in singleplayer for the moment)

the error when I type /run:

error: 15 : attempt to call method 'set_physics_override' (a nil value)


(better for the indent btw? ;)
sorry for bad english
 

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

by PilzAdam » Sun Jun 09, 2013 14:45

AndrOn wrote:Thanks PilzAdam I am new to lua (sorry for the indentation). I didn't knew the object handling in lua. However I have another error with my new code which is:

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
minetest.register_chatcommand("run", {
    params = "",
    description = "run",
    func = function()
    for _, p in ipairs(minetest.get_connected_players()) do
            p:set_physics_override(3, 1.2, 1)
            end
    end,
})


(yes for the moment it affects all the players but I couldn't load your code and I want to use it in singleplayer for the moment)

the error when I type /run:

error: 15 : attempt to call method 'set_physics_override' (a nil value)


(better for the indent btw? ;)

I guess you use a too old version of Minetest (you need 0.4.7 IIRC).

Also, indentation is still not completly correct :-p
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
minetest.register_chatcommand("run", {
    params = "",
    description = "run",
    func = function()
            for _, p in ipairs(minetest.get_connected_players()) do
                    p:set_physics_override(3, 1.2, 1)
            end
    end,
})
 

User avatar
AndrOn
Member
 
Posts: 38
Joined: Fri May 31, 2013 22:32

by AndrOn » Sun Jun 09, 2013 16:25

I guess you use a too old version of Minetest (you need 0.4.7 IIRC).

Also, indentation is still not completly correct :-p


Thanks it works! Time to add some particles like in minecraft (and make a less nasty code + improve indentation... I usually code on codeblocks rightclick->format this file)

Also, someone should update the wiki about the new mods directory because I found it tricky
sorry for bad english
 

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

by bdjnk » Sun Jun 09, 2013 16:32

When one does a register_on_dignode, is there some way to get the oldnode's metadata? You know, because get_meta(pos) will get the new metadata, which is null...
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Jun 09, 2013 16:51

bdjnk wrote:When one does a register_on_dignode, is there some way to get the oldnode's metadata? You know, because get_meta(pos) will get the new metadata, which is null...


Use
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
after_dig_node = function(pos, oldnode, oldmetadata, digger)


in node definition instead
 

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

by bdjnk » Sun Jun 09, 2013 18:23

BlockMen wrote:
bdjnk wrote:When one does a register_on_dignode, is there some way to get the oldnode's metadata? You know, because get_meta(pos) will get the new metadata, which is null...


Use
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
after_dig_node = function(pos, oldnode, oldmetadata, digger)


in node definition instead


Hm, yes, well that would be fine if I was just doing it for one type of node, but I was thinking for any type of diggable node.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron