Post your modding questions here

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Sat Jan 18, 2014 17:36

PilzAdam wrote:What do you mean by "them" in the last sentence? The oregen types?


I mean all of the code snippets.
Is there another useful ore_type than scatter?
Last edited by Krock on Sat Jan 18, 2014 17:36, edited 1 time in total.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Sat Jan 18, 2014 17:54

Krock wrote:Is there another useful ore_type than scatter?


API's:
ore_type = "scatter", -- See "Ore types"

All default ores are of the uniformly-distributed scatter type.

- scatter
Randomly chooses a location and generates a cluster of ore.
If noise_params is specified, the ore will be placed if the 3d perlin noise at
that point is greater than the noise_threshhold, giving the ability to create a non-equal
distribution of ore.
- sheet
Creates a sheet of ore in a blob shape according to the 2d perlin noise described by noise_params.
The relative height of the sheet can be controlled by the same perlin noise as well, by specifying
a non-zero 'scale' parameter in noise_params. IMPORTANT: The noise is not transformed by offset or
scale when comparing against the noise threshhold, but scale is used to determine relative height.
The height of the blob is randomly scattered, with a maximum height of clust_size.
clust_scarcity and clust_num_ores are ignored.
This is essentially an improved version of the so-called "stratus" ore seen in some unofficial mods.
- claylike - NOT YET IMPLEMENTED
Places ore if there are no more than clust_scarcity number of specified nodes within a Von Neumann
neighborhood of clust_size radius.
sorry for bad english
Linux debian 7 wheezy 64
kde
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Sat Jan 18, 2014 18:00

Oh thanks pandaro,
Somehow I totally forgot the documentation... I only searched on the forum :3
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Sat Jan 18, 2014 20:08

Topic: Callbacks

So I want to make a nice disco/audio player mod, and yes I know there are others out there, but I want the experience.

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_place_node = function (pos,placer)
             mysound = minetest.sound_play("Sound_Black",
             {pos = pos, gain = 1.0, max_hear_distance = 40,})
     end,

    on_punch = function(pos, node, player, itemstack)
        if mysound then
        minetest.sound_stop(mysound)
        if !mysound then
        mysound = minetest.sound_play("Sound_Black",
        {pos = pos, gain = 1.0, max_hear_distance = 40,})
        end
    end
end


When I place the node, The sound starts, and I want it so the sound is toggled on and off by punching the node.

How do I say if not sound then play sound. I have tried if not mysound, and !mysound but none have worked. help? :\
"The Foot is down!"
 

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

by PilzAdam » Sat Jan 18, 2014 20:57

philipbenr wrote:Topic: Callbacks

So I want to make a nice disco/audio player mod, and yes I know there are others out there, but I want the experience.

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_place_node = function (pos,placer)
             mysound = minetest.sound_play("Sound_Black",
             {pos = pos, gain = 1.0, max_hear_distance = 40,})
     end,

    on_punch = function(pos, node, player, itemstack)
        if mysound then
        minetest.sound_stop(mysound)
        if !mysound then
        mysound = minetest.sound_play("Sound_Black",
        {pos = pos, gain = 1.0, max_hear_distance = 40,})
        end
    end
end


When I place the node, The sound starts, and I want it so the sound is toggled on and off by punching the node.

How do I say if not sound then play sound. I have tried if not mysound, and !mysound but none have worked. help? :\

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_punch = function(pos, node, player, itemstack)
        if mysound then
            minetest.sound_stop(mysound)
            mysound = nil
        else
            mysound = minetest.sound_play("Sound_Black",
                {pos = pos, gain = 1.0, max_hear_distance = 40,})
        end
    end
Last edited by PilzAdam on Sat Jan 18, 2014 20:58, edited 1 time in total.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Mon Jan 20, 2014 22:28

Topic: Itemstack.

I also have a feeling I should have posted this a while ago, but where do I post the itemstack. I need it to be one item, and that completes the function.

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_rightclick = function(pos, node, player, itemstack <-- Here?, pointed_thing)
--Or Somewhere down here?
Last edited by philipbenr on Mon Jan 20, 2014 22:28, edited 1 time in total.
"The Foot is down!"
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Tue Jan 21, 2014 16:55

I'm not sure but
on_rightclick itemstack should be the stack, which the player used to click right onto the node.
What exactly do you want to do?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Tue Jan 21, 2014 19:06

So the question is:
I want to test a terrain generator , for example mapgenv7
I want to first of all that the world created is always the same, to do this, it is enough, when I create a world, give it a name, and select a fixed seed, such as the 1 seed.
Now the problem, I want, from file minetest. conf, the generator reads some parameters such as:
# mgv7_np_terrain = 10, 12, (350, 350, 350), 82 341, 5, 0.6
# mgv7_np_bgroup = 0.5, 0.3125, (350, 350, 350), 5923, 2, 0.6
# mgv7_np_heat = 25, 50, (500, 500, 500), 35293, 1, 0
# mgv7_np_humidity = 50, 31.25, (750, 750, 750), 12094, 2, 0.6

to do this then I compile my minetest.conf that I show it as it is:
main_menu_tab = server
name = pandaro
server_dedicated = false
fixed_map_seed = 1
main_menu_last_game_idx = 4
mainmenu_last_selected_world = 2
selected_world_path = /home/p/minetest/0.49.1/bin/../worlds/sdcs
enable_shaders = false
enable_damage = false
port = 30000
server_announce = true
address = 192.168.0.2
remote_port = 30000
creative_mode = true
num_emerge_threads = 2
mg_name = v7
mgv7_np_terrain = 0, 1, (1, 1 1), 1, 1, 1
mgv7_np_bgroup = 0, 1, (1, 1, 1), 1, 1, 1
mgv7_np_heat = 0, 1, (1, 1, 1), 1, 1, 1
mgv7_np_humidity = 0, 1, (1, 1, 1), 1, 1, 1


but I realize that in spite of the parameter fixed_map_seed = 1 the map is different each time.

it seems to me that having or not having completed minetest.conf the generator of the terrain refers only on what I write in the main menu.

How do I create a map by passing minetest.conf?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Tue Jan 21, 2014 19:18

I think you type the actual seed in the fixed_map_seed parameter.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Tue Jan 21, 2014 19:30

qwrwed wrote:I think you type the actual seed in the fixed_map_seed parameter.


I did not understand.
Could you post a copy of my minetest.conf correct?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by PilzAdam » Tue Jan 21, 2014 19:39

pandaro wrote:So the question is:
I want to test a terrain generator , for example mapgenv7
I want to first of all that the world created is always the same, to do this, it is enough, when I create a world, give it a name, and select a fixed seed, such as the 1 seed.
Now the problem, I want, from file minetest. conf, the generator reads some parameters such as:
# mgv7_np_terrain = 10, 12, (350, 350, 350), 82 341, 5, 0.6
# mgv7_np_bgroup = 0.5, 0.3125, (350, 350, 350), 5923, 2, 0.6
# mgv7_np_heat = 25, 50, (500, 500, 500), 35293, 1, 0
# mgv7_np_humidity = 50, 31.25, (750, 750, 750), 12094, 2, 0.6

to do this then I compile my minetest.conf that I show it as it is:
main_menu_tab = server
name = pandaro
server_dedicated = false
fixed_map_seed = 1
main_menu_last_game_idx = 4
mainmenu_last_selected_world = 2
selected_world_path = /home/p/minetest/0.49.1/bin/../worlds/sdcs
enable_shaders = false
enable_damage = false
port = 30000
server_announce = true
address = 192.168.0.2
remote_port = 30000
creative_mode = true
num_emerge_threads = 2
mg_name = v7
mgv7_np_terrain = 0, 1, (1, 1 1), 1, 1, 1
mgv7_np_bgroup = 0, 1, (1, 1, 1), 1, 1, 1
mgv7_np_heat = 0, 1, (1, 1, 1), 1, 1, 1
mgv7_np_humidity = 0, 1, (1, 1, 1), 1, 1, 1


but I realize that in spite of the parameter fixed_map_seed = 1 the map is different each time.

it seems to me that having or not having completed minetest.conf the generator of the terrain refers only on what I write in the main menu.

How do I create a map by passing minetest.conf?

Create a map without the gui (via command line options, see --help).
 

User avatar
qwrwed
Member
 
Posts: 323
Joined: Sun Jul 22, 2012 20:56
In-game: qwrwed or Nitro

by qwrwed » Tue Jan 21, 2014 19:54

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
fixed_map_seed = 66768767867868789

Every world created after putting this in minetest.conf and saving should have the seed 66768767867868789. I created two worlds after adding that line, and they were both the same.
 

Tails19935
New member
 
Posts: 1
Joined: Tue Jan 21, 2014 21:42

by Tails19935 » Tue Jan 21, 2014 21:45

If you make a skin mode, will it affect all the players on a sever or will it just show for you and will other players be able to see my skin?
I'm makeing a skin mod.
 

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

by ch98 » Fri Jan 24, 2014 21:37

this code here

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 function read_image(f, bmp, infoheader, hmin, hmax, wmin, wmax)

        local i, line, height, dir

        height = infoheader.biHeight
        line = (height < 0) and 1 or height
        dir = (height < 0) and 1 or -1
        height = math.abs(height)

        print(("[bmpmap.bmp] size=%dx%d bpp=%d"):format(
                infoheader.biWidth,
                infoheader.biHeight,
                infoheader.biBitCount
        ))

        bmp.pixels = { }

        for i = 1, height do
                local row = { }
                if hmin <= i <= hmax then
                   bmp.pixels[line] = row
                end
                if infoheader.biBitCount == 24 then
                        read_24bit_line(infoheader.biWidth, f, row, wmin, wmax)
                elseif infoheader.biBitCount == 32 then
                        read_32bit_line(infoheader.biWidth, f, row, wmin, wmax)
                else
                        return false
                end
                line = line + dir
        end

        return true

end


causes error saying
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
13:34:58: ERROR[main]: ServerError: /root/.minetest/mods/bmpmap/loader_bmp.lua:153: attempt to compare boolean with number
13:34:58: ERROR[main]: stack traceback:
13:34:58: ERROR[main]:     /root/.minetest/mods/bmpmap/loader_bmp.lua:153: in function 'read_image'
13:34:58: ERROR[main]:     /root/.minetest/mods/bmpmap/loader_bmp.lua:228: in function 'load'
13:34:58: ERROR[main]:     /root/.minetest/mods/bmpmap/imageloader.lua:49: in function 'load'
13:34:58: ERROR[main]:     /root/.minetest/mods/bmpmap/mapgen.lua:37: in function '?'

full code at github
help please? I can't find the problem in the code while i stared at it for 30 minutes.
Edit: found the error. hmin <= i <= hmax was supposed to be hmin <= i and i <= hmax
Last edited by ch98 on Fri Jan 24, 2014 23:04, edited 1 time in total.
Mudslide mod Click Here
 

Landrover110
Member
 
Posts: 19
Joined: Mon Jan 13, 2014 09:38
In-game: Landrover

by Landrover110 » Mon Jan 27, 2014 10:58

How can i get my game to run faster with lots of mods
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Mon Jan 27, 2014 16:14

Landrover110 wrote:How can i get my game to run faster with lots of mods


Get a faster computer?

Or you could turn off shaders and the complex plant drawtypes. Maybe use the default textures as larger textures will slow the system. Change the view distance to be shorter. Decrease the amount of chunks kept in memory. Stuff like that can be found by looking at FAQs and threads in the forum and by doing some good searches. Hope this helps some.
 

User avatar
GunshipPenguin
Member
 
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin

by GunshipPenguin » Tue Jan 28, 2014 01:25

I'm having a problem with a mod that I'm making to protect the area around the spawnpoint from being damaged. The code to stop people from digging nodes is as follows.
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_on_dignode(function(pos, oldnode, digger)
        if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been dug within spawn as defined with limit
                if not minetest.get_player_privs(digger:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
                        minetest.chat_send_player(digger:get_player_name(), "You are attempting to dig inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot dig inside spawn
                        minetest.set_node(pos, oldnode)
                        digger:get_inventory():remove_item("main", oldnode)
                end
        end
end)


It works fine, but the code to stop players from placing nodes does not. I remove the node, inform the player that he cannot build near spawn and then try to add the node back to his/her inventory. For some reason though, the item isn't being added into the inventory.

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_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
        if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been placed within spawn as defined with limit
                if not minetest.get_player_privs(placer:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
                        minetest.chat_send_player(placer:get_player_name(), "You are attempting to build inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot build inside spawn
                        minetest.set_node(pos, oldnode)
                        placer:get_inventory():add_item("main", newnode.name)
                end
        end
end)


Thanks in advance for any help. I'm new to Lua and Minetest modding so I apologize if this question is a bit noobish.
 

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

by PilzAdam » Tue Jan 28, 2014 17:44

GunshipPenguin wrote:I'm having a problem with a mod that I'm making to protect the area around the spawnpoint from being damaged. The code to stop people from digging nodes is as follows.
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_on_dignode(function(pos, oldnode, digger)
        if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been dug within spawn as defined with limit
                if not minetest.get_player_privs(digger:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
                        minetest.chat_send_player(digger:get_player_name(), "You are attempting to dig inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot dig inside spawn
                        minetest.set_node(pos, oldnode)
                        digger:get_inventory():remove_item("main", oldnode)
                end
        end
end)


It works fine, but the code to stop players from placing nodes does not. I remove the node, inform the player that he cannot build near spawn and then try to add the node back to his/her inventory. For some reason though, the item isn't being added into the inventory.

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_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
        if pos["x"] < safeZoneCenter["x"]+limit and pos["x"] > safeZoneCenter["x"]-limit and pos["z"] < safeZoneCenter["z"]+limit and pos["z"] > safeZoneCenter["z"]-limit then -- If a node has been placed within spawn as defined with limit
                if not minetest.get_player_privs(placer:get_player_name())["safezonebuild"] then -- If the player does not have the spawnbuild privilege
                        minetest.chat_send_player(placer:get_player_name(), "You are attempting to build inside the safe zone, please move out of the safe zone") -- Inform player that he/she cannot build inside spawn
                        minetest.set_node(pos, oldnode)
                        placer:get_inventory():add_item("main", newnode.name)
                end
        end
end)


Thanks in advance for any help. I'm new to Lua and Minetest modding so I apologize if this question is a bit noobish.

You should look into minetest.is_protected() (see doc/lua_api.txt)
 

User avatar
GunshipPenguin
Member
 
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin

by GunshipPenguin » Thu Jan 30, 2014 03:33

Hybrid Dog wrote:setting the oldnode after adding the newnode into the inventory or "return itemstack" might help


Yay! using return itemstack makes it work. Thanks a lot, I really appreciate it.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Fri Jan 31, 2014 21:04

about sneak and sneak_glitch
What changed exactly sneak and sneak_glitch in player:set_physics_override ()

I realized that if I sneak == true then the player does not come down from the block if I hold down shift.
if you sneak == false then the player goes down from the block even if I keep holding shift.
I do not understand what happens if sneak_glitch is changed from true to false.
It seems to me always the same
sorry for bad english
Linux debian 7 wheezy 64
kde
 

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

by PilzAdam » Fri Jan 31, 2014 22:06

pandaro wrote:about sneak and sneak_glitch
What changed exactly sneak and sneak_glitch in player:set_physics_override ()

I realized that if I sneak == true then the player does not come down from the block if I hold down shift.
if you sneak == false then the player goes down from the block even if I keep holding shift.
I do not understand what happens if sneak_glitch is changed from true to false.
It seems to me always the same

Try searching for "sneak elevator". sneak_glitch = false basically prevents that.
 

User avatar
pandaro
Member
 
Posts: 266
Joined: Sun Jan 08, 2012 21:34
GitHub: pandaro

by pandaro » Fri Jan 31, 2014 22:18

PilzAdam wrote:Try searching for "sneak elevator". sneak_glitch = false basically prevents that.


Where should I look? I tried google but only find discussions in irc (unclear).
And I can not find anything on http://dev.minetest.net


In any case I may have figured out what you want to explain:

it is the ability to climb on a step by holding down shift?
sorry for bad english
Linux debian 7 wheezy 64
kde
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Sat Feb 01, 2014 20:22

Krock wrote:I'm not sure but
on_rightclick itemstack should be the stack, which the player used to click right onto the node.
What exactly do you want to do?

When I click something with a certain itemstack, I wish it to perform a specific function. Like if you are wearing specific gloves, you can turn on something, or remove something, but only with that specific item wielded.

[spoiler=More Specific]
Basically, I want to have a certain pair of gloves, that if you are wielding them, you can rightclick a certain node and remove it, and if you leftclick the node, it plays a sound. It is for the audio/dj mod I am working toward.
[/spoiler]
"The Foot is down!"
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Sat Feb 01, 2014 20:59

@philipbenr, post abrove:

How about defining the gloves, instead of the diffrent nodes?

like: on_use, on_place (not sure, but you can loop up the documentation)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Mon Feb 03, 2014 01:54

Krock wrote:@philipbenr, post abrove:

How about defining the gloves, instead of the diffrent nodes?

like: on_use, on_place (not sure, but you can loop up the documentation)


Found the answer to my problem. I have to use on_place/on_use in the craftitem callbacks and define the pointed thing as an "audio:______" and have the callback function. I'm guessing this is correct.

Also, how can I define the pointed thing as one specific node? As in the example below:

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_use = function(itemstack, placer, pointed_thing   <-- Here?  )
--Or Somewhere down here?


[spoiler=code examples]
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_use = function(itemstack, placer, audio:player_black  )


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_use = function(itemstack, placer, pointed_thing)
pointed_thing="audio:player_black"


Somewhere else? Some other way?
[/spoiler]
Last edited by philipbenr on Mon Feb 03, 2014 01:56, edited 1 time in total.
"The Foot is down!"
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Mon Feb 03, 2014 14:47

philipbenr wrote:Also, how can I define the pointed thing as one specific node?

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_use = function(itemstack, placer, pointed_thing   <-- Here?  )
--Or Somewhere down here?


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_tool("audio:gloves", {
        description = "xyz",
        inventory_image = "xyz.png",
        on_use = function(itemstack, user, pointed_thing)
                if pointed_thing.type ~="node" then
                        return
                end
                local node = minetest.get_node(pointed_thing.under)
                --node equals the node you pointed to when using the "gloves"
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

by philipbenr » Tue Feb 04, 2014 01:05

That is another way of doing it i suppose. Ok, thanks so much. I'll see if I can make something of all this.
"The Foot is down!"
 

User avatar
Gambit
Member
 
Posts: 452
Joined: Sat Oct 29, 2011 19:31

by Gambit » Tue Feb 04, 2014 08:28

How would I make a block that hurts the player once he/she touches it either on the sides on standing on top of it?
Current Projects: MineToon | PixelBOX
Gambit's Checkmate Server - 43.65.296.232 - port: 30001
 

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

by Evergreen » Tue Feb 04, 2014 13:57

Gambit wrote:How would I make a block that hurts the player once he/she touches it either on the sides on standing on top of it?
Just stick this in the node definition:
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
damage_per_second = amount_of_damage,
"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 Feb 04, 2014 16:21

That only works when standing in the node. I haven't found any workaround.
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 40 guests

cron