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 » Fri Apr 11, 2014 21:06

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(...)
  local idx = player:get_wield_index() + 1

  if idx < 8 then
    local inv = player:get_inventory()
    local stack = inv:get_stack("main", idx)
    -- do something with stack
  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
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

by Kilarin » Fri Apr 11, 2014 21:44

Thank you kaeza, that is very helpful!
 

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

by Casimir » Sun Apr 13, 2014 08:11

Don't know if this is a bug in the engine or if I'm doing something wrong.
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, clicker)
        local inv = clicker:get_inventory()
        inv:add_item("main", "pots:pot")
    end,

This should place the item in the players inventory. It works unless the first free slot in the inventory is the players bare hand, then nothing gets added.
 

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

by Evergreen » Sun Apr 13, 2014 11:51

Casimir wrote:Don't know if this is a bug in the engine or if I'm doing something wrong.
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, clicker)
        local inv = clicker:get_inventory()
        inv:add_item("main", "pots:pot")
    end,

This should place the item in the players inventory. It works unless the first free slot in the inventory is the players bare hand, then nothing gets added.
I think it is a bug with the engine. The default hand is actually a tool that is named ":"
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

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

by Krock » Sun Apr 13, 2014 12:09

Casimir wrote:This should place the item in the players inventory. It works unless the first free slot in the inventory is the players bare hand, then nothing gets added.

Hmm somehow I can't reproduce this problem. It gives me unknown item (cuz not known node), tried with wieldhand, cobble and a wooden pick...

EDIT: only works if meta string "formspec" is not set.
Last edited by Krock on Sun Apr 13, 2014 12:10, 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>
 

fjlv9000
Member
 
Posts: 17
Joined: Sat Apr 12, 2014 18:00

by fjlv9000 » Sun Apr 13, 2014 17:56

how to unzip mods on linux 13.10
 

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

by Krock » Sun Apr 13, 2014 17:57

fjlv9000 wrote:how to unzip mods on linux 13.10

http://www.ehow.com/how_8395672_use-7zip-linux.html
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>
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

by Kilarin » Mon Apr 14, 2014 03:39

I'm trying to make certain I really understand how Pointed_Thing works.

Am I correct that pointed_thing.above doesn't actually mean the node UP from where you are pointed, and pointed_thing.under doesn't actually mean the node DOWN from where you are pointed.
Pointed_Thing.above is the node where an object would be placed, and Pointed_Thing.under is the node that would be dug.
So if I'm pointing at the top face of a node, then .above would actually be the node up and .under would actually be the node under. But if I was pointing at a side face of the cube, then pointed_thing.above would be the node OUT from the face I am pointing at while pointed_thing.under would be the node behind the face I am pointed at.

Or, to put it more simply, pointed_thing.above is always the node in FRONT of the face that the pointer is on, relative to the pointer. And pointed_thing.under is always the face BEHIND the face that the pointer i son, relative to the pointer.

Right, wrong? Somewhere in-between? :)
 

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

by Casimir » Mon Apr 14, 2014 07:38

Right. (As far as I know.)
 

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

by Krock » Mon Apr 14, 2014 08:58

@Kilarin: let's use dirt as example node/block.
pointed_thing.under is when you're pointing on a dirt node.
pointed_thing.above is the where the new dirt would get placed normally
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>
 

Kilarin
Member
 
Posts: 649
Joined: Mon Mar 10, 2014 00:36

by Kilarin » Mon Apr 14, 2014 12:07

Thank you Casimir and Krock. That helps. At first I found Pointed_Thing.above and below VERY confusing because I was interpreting "above" as actually UP and I couldn't figure out how the code knew which face you were pointing at from that information. This makes much more sense.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

by stu » Mon Apr 14, 2014 19:37

Kilarin wrote:Thank you Casimir and Krock. That helps. At first I found Pointed_Thing.above and below VERY confusing because I was interpreting "above" as actually UP and I couldn't figure out how the code knew which face you were pointing at from that information. This makes much more sense.


You should use minetest.get_pointed_thing_position to find the position of a pointed_thing
To determine exactly which face you are pointing at see micronode:get_node_normal(pointed_thing) in my micronodes mod.
 

Daven
Member
 
Posts: 26
Joined: Mon Jan 20, 2014 21:51

by Daven » Sat Apr 19, 2014 01:06

Does anyone know the mod where you break the bottom of the tree block and the whole thing falls. Do you know where that is and if you do can you put a link down?
 

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

by Krock » Sat Apr 19, 2014 07:58

Daven wrote:Does anyone know the mod where you break the bottom of the tree block and the whole thing falls. Do you know where that is and if you do can you put a link down?

It's called timber mod

Need a link? Here is it
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
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40

by JPRuehmann » Sat Apr 19, 2014 07:59

I know of three such mods,
nt (new Timber)
timber
tree_capitator (which I use so far).
look for them in the Forum.
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

Re: Post your modding questions here

by DeepGaze » Mon Apr 21, 2014 12:24

things I want to learn:
how to control the movement of an entity
how to teleport a player after touching a node(to a controlled location)
how to be lord and ruler of all creation
some of this is a priority!
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

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

Re: Post your modding questions here

by kaeza » Mon Apr 21, 2014 17:19

DeepGaze wrote:how to control the movement of an entity

Try looking at Simple Mobs and/or MOBF. Simple mobs have (obviously) simpler movement patterns (simple "set direction and speed"). MOBF on the other hand, has this in addition to using pathfinder.
DeepGaze wrote:how to teleport a player after touching a node(to a controlled location)

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("foo:bar", {
  -- ...
  on_punch = function(pos, node, puncher, pointed_thing)
    puncher:setpos({x = 0, y = 0, z = 0})
  end,
  -- ...
})

DeepGaze wrote:how to be lord and ruler of all creation

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
su root
 

CWz
Member
 
Posts: 185
Joined: Tue Dec 24, 2013 17:01

Re: Post your modding questions here

by CWz » Tue Apr 22, 2014 19:58

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 admin = minetest.setting_get("name")
local locked = minetest.setting_get("lockdown")

minetest.register_on_prejoinplayer(function(name, ip)
   if name ~= admin or locked == true then
      return "This server is in maintenance mode"   
   end

end)


whether lockdown = true or false seems to make no difference
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

Re: Post your modding questions here

by DeepGaze » Tue Apr 22, 2014 20:50

thank you Kaeza! I am now a god!
I do have some more questions:
how to substitute the ({x = 0, y = 0, z = 0}) with a chat command
replace the punch with a standing on top
place a "return to (chat command location)" node at the destination
and a priv to use this all
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Wed Apr 23, 2014 13:04

Hi everyone!
While creating a new mod following problem occurred:

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
ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "traps:acid" at (0,2,-6) (block (0,0,-1))


AFAIK this message appears if a node is not defined or not correctly, but I've no idea what I've done wrong, so please help me! [^_^]
Here is the part of node definition where I think the code is wrong:

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("traps:quicksand", {
   description = "Quicksand",
   tiles = {"default_desert_sand.png"},
   walkable = false,
   disable_jump = true,
   drowning = 1,
   liquidtype = "source",
   liquid_viscosity = 10,
   liquid_range = 0,
   liquid_renewable = false,
   groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
   sounds = default.node_sound_sand_defaults(),
})

minetest.register_node("traps:acid", {
   description = "Acid",
   tiles = {
      {name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},
   walkable = false,
   disable_jump = true,
   drowning = 1,
   liquidtype = "source",
   liquid_viscosity = 3,
   liquid_range = 0,
   liquid_renewable = false,
   groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
   damage_per_second = 6,
})
 

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

Re: Post your modding questions here

by Topywo » Wed Apr 23, 2014 13:25

tiles = {
{name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},

A } too much?
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

Re: Post your modding questions here

by DeepGaze » Wed Apr 23, 2014 13:38

Topywo wrote:tiles = {
{name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},

A } too much?

no see this for an example, its from my aniwool mod and works fine so you should be ok. though i would space them out a bit(new line)

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("aniwool:ani1", {
tile_images = {
       {
            image="ani1.png",
            backface_culling=false,
            animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}
        },
        {
            image="ani1.png",
            backface_culling=true,
            animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}
        },
    },
   groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=h1},
description = "animated wool type one",
   groups={snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1},
})

+ my questions from lastpost
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

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

Re: Post your modding questions here

by PilzAdam » Wed Apr 23, 2014 13:44

RHR wrote:Hi everyone!
While creating a new mod following problem occurred:

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
ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "traps:acid" at (0,2,-6) (block (0,0,-1))



AFAIK this message appears if a node is not defined or not correctly, but I've no idea what I've done wrong, so please help me! [^_^]
Here is the part of node definition where I think the code is wrong:

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("traps:quicksand", {
   description = "Quicksand",
   tiles = {"default_desert_sand.png"},
   walkable = false,
   disable_jump = true,
   drowning = 1,
   liquidtype = "source",
   liquid_viscosity = 10,
   liquid_range = 0,
   liquid_renewable = false,
   groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
   sounds = default.node_sound_sand_defaults(),
})

minetest.register_node("traps:acid", {
   description = "Acid",
   tiles = {
      {name="acid.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}},
   walkable = false,
   disable_jump = true,
   drowning = 1,
   liquidtype = "source",
   liquid_viscosity = 3,
   liquid_range = 0,
   liquid_renewable = false,
   groups = {liquid=2, crumbly=1,oddly_breakable_by_hand=2},
   damage_per_second = 6,
})

Please post all the set_node and add_node calls in your mod (with context).
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Wed Apr 23, 2014 14:03

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
15:49:57: ACTION[main]:         .__               __                   __
15:49:57: ACTION[main]:   _____ |__| ____   _____/  |_  ____   _______/  |_
15:49:57: ACTION[main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
15:49:57: ACTION[main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |
15:49:57: ACTION[main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|
15:49:57: ACTION[main]:       \/        \/     \/          \/     \/
15:49:57: ACTION[main]: World at [D:\minetest-0.4.9-dev\bin\..\worlds\8]
15:49:57: ACTION[main]: Server for gameid="minetest" listening on 0.0.0.0:49845.

PNG warning: Interlace handling should be turned on when using png_read_image
PNG warning: Interlace handling should be turned on when using png_read_image
15:50:00: ACTION[ServerThread]: singleplayer joins game.
Font size: 15:50:01: ACTION[ServerThread]: singleplayer joins game. List of play
ers:
8 17
Could not open file of texture: character.png
Loaded mesh: character.x
Loaded mesh: character.x
15:50:08: ACTION[ServerThread]: singleplayer takes "traps:acid" from creative in
ventory
15:50:09: ACTION[ServerThread]: singleplayer takes "traps:quicksand" from creati
ve inventory
15:50:12: ACTION[ServerThread]: singleplayer places node traps:acid at (-17,8,-1
8)
15:50:15: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "traps:acid" at (-17,8,-18) (block (-2,0,-2))
15:50:15: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-17,8,-17) (block (-2,0,-2))
15:50:15: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-16,8,-18) (block (-1,0,-2))
15:50:19: ACTION[ServerThread]: singleplayer places node traps:quicksand at (-17
,8,-17)
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "traps:quicksand" at (-17,8,-17) (block (-2,0,-2))
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-17,8,-16) (block (-2,0,-1))
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-16,8,-17) (block (-1,0,-2))
15:50:27: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "traps:acid" at (-17,8,-18) (block (-2,0,-2))
15:50:33: ERROR[ServerThread]: Map::setNode(): Not allowing to place CONTENT_IGN
ORE while trying to replace "air" at (-16,8,-18) (block (-1,0,-2))
 

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

Re: Post your modding questions here

by Krock » Wed Apr 23, 2014 14:18

@RHR,
PilzAdam meant the set_node calls in the codes
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
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Wed Apr 23, 2014 15:15

Krock wrote:@RHR,
PilzAdam meant the set_node calls in the codes

I havn't used any set_node calls in the codes. You can find the source code here:
https://github.com/RHRhino/Traps
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Wed Apr 23, 2014 15:48

By the way, the namespace 'traps' is used.

viewtopic.php?f=11&t=2838
 

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

Re: Post your modding questions here

by PilzAdam » Wed Apr 23, 2014 16:08

RHR wrote:
Krock wrote:@RHR,
PilzAdam meant the set_node calls in the codes

I havn't used any set_node calls in the codes. You can find the source code here:
https://github.com/RHRhino/Traps

You define liquids without liquid_source and liquid_flowing fields.
 

User avatar
RHR
Member
 
Posts: 214
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Wed Apr 23, 2014 16:29

PilzAdam wrote:You define liquids without liquid_source and liquid_flowing fields.

OK, thank you very much!

rubenwardy wrote:By the way, the namespace 'traps' is used.
viewtopic.php?f=11&t=2838

I'll try to find a new+better name for my mod ;)
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

Re: Post your modding questions here

by DeepGaze » Wed Apr 23, 2014 19:40

is it posible to put a texture for each side like this: (say, for a stone node)
Image and for the other side (blue=north, red=west, yellow=top, ECT) and if so *Can I have some code**pretty please!*
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron