Page 146 of 169

Re: Post your modding questions here

PostPosted: Sat Mar 04, 2017 06:02
by yzelast
Byakuren wrote:What do you mean? Is there an error when you try to concatenate?


(that alone bracket on swap node function didn't matter)

The following error appear on chat:
Code: Select all
2017-03-04 02:00:42: ERROR[Server]: Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "default:leaves" at (99,28,103) (block (6,1,6))

Re: Post your modding questions here

PostPosted: Sat Mar 04, 2017 06:08
by kaeza
It means the node you are trying to place doesn't exist.

Re: Post your modding questions here

PostPosted: Sat Mar 04, 2017 06:22
by yzelast
Thinking about it, i forgot the default modname at the beginning...it's sad...well, sorry for the time wasted here, i will think more next time.

Re: Post your modding questions here

PostPosted: Sat Mar 04, 2017 06:31
by kaeza
No, that should be part of the name already.

Code: Select all
local node = minetest.get_node(value) --> node.name == "default:leaves"
node.name = node.name .. "_dry" --> "default:leaves_dry"

I don't think that node exists.

Re: Post your modding questions here

PostPosted: Sat Mar 04, 2017 16:40
by burli
Is it possible to make such a leaf shape? It is a normal leaf node with an oversized plantlike inside

Image

Re: Post your modding questions here

PostPosted: Sat Mar 04, 2017 18:04
by yzelast
burli wrote:Is it possible to make such a leaf shape? It is a normal leaf node with an oversized plantlike inside

Image


The nodebox trees have similar leaves, you could take a look on it.
https://forum.minetest.net/viewtopic.php?f=9&t=16292

Re: Post your modding questions here

PostPosted: Mon Mar 06, 2017 07:11
by D00Med
Would it be possible to make a copy of the mapgen at a different height without an expensive function?
(I already tried just copying dirt with grass using register_on_generated but it was really slow)

Re: Post your modding questions here

PostPosted: Mon Mar 06, 2017 07:24
by burli
You mean a copy of the generated map? How far you will copy? Inside a chunk

Re: Post your modding questions here

PostPosted: Mon Mar 06, 2017 07:25
by D00Med
Yeah. Everything

Re: Post your modding questions here

PostPosted: Mon Mar 06, 2017 07:32
by burli
Should be fast if you use VoxelManip

Re: Post your modding questions here

PostPosted: Mon Mar 06, 2017 07:51
by D00Med
Ok...I should probably learn how then...

Re: Post your modding questions here

PostPosted: Mon Mar 06, 2017 08:12
by kaeza
D00Med wrote:I already tried just copying dirt with grass using register_on_generated but it was really slow

D00Med wrote:Ok...I should probably learn how then...

Maybe you should post the actual code to see if somebody can suggest improvements?

Re: Post your modding questions here

PostPosted: Tue Mar 07, 2017 05:20
by sofar
Hybrid Dog wrote:Does node metadata become compressed?


I'm fairly sure everything on the map is compressed, including entity data as well.

Re: Post your modding questions here

PostPosted: Tue Mar 07, 2017 12:57
by burli
I know that nodes have a on_rightclick callback, but I can't find something similar for tools. Is it possible to call a callback function if I make a rightclick with a tool? For example if I want to make different actions with the same tool?

Re: Post your modding questions here

PostPosted: Tue Mar 07, 2017 13:19
by rubenwardy
It's on place

Re: Post your modding questions here

PostPosted: Tue Mar 07, 2017 13:36
by DS-minetest
It's
on_place = function(itemstack, placer, pointed_thing)
and
on_secondary_use = function(itemstack, user, pointed_thing).
on_place is called when you make rightclick on a node with the item,
on_secondary_use is called when you make rightclick with the item without pointing on any node.
These are not only for tools, I think, they are for every item (craftitem, node, tool).

Re: Post your modding questions here

PostPosted: Tue Mar 07, 2017 13:56
by burli
A, ok, it's a little bit confusing that a rightclick callback is sometimes called on_rightclick and sometimes on_place. Doc could be more clear at this point

Aliasing Nodes

PostPosted: Tue Mar 07, 2017 15:29
by EdShouldBeInBed
Question/ Issue: If I use minetest.register_alias to replace one mods version of a node with another, will the first mod recognize the replacement node for crafting? Where should I put such alias statements?

Reason: In my personal minetest game, I have both Dark Ages and Technic installed. I want to use DA's version of Marble and a few other nodes over technic's in the worldgen, but only if Technic will recognize DA's version for crafting. This applies to other nodes/ ores like rubies (I currently have two versions).

More Info(optional): I'm also wondering where I should put this, in a /mygametweaks folder under the game's mod folder? If I do, do I have to fully define it as a mod with a depends.txt and all?

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 03:36
by TumeniNodes
This is the code for a drawbridge I was working on a while back...
Never did figure out why I can't walk it?

I can walk along the center for about 2 nodes then... woosh, fall through.

What am I doing wrong? (I should be able to figure this out by now but.... : / )
I just tried again today, but only for about 5 minutes and said "screw it", maybe someone else will see what I did wrong, right off the bat... :P

I also have an obj model but, it works this way... well, visually anyway

Any help will be greatly appreciated... ten-Q

Code: Select all
minetest.register_node("castle_features:drawbridge_raised", {
   description = "Drawbridge Raised",
   drawtype = "nodebox",
   tiles = {"bridge_timber.png"},
   paramtype = "light",
   paramtype2 = "facedir",
   node_box = {
      type = "fixed",
      fixed = {
         {-2.5, 0.25, 0.25, 2.5, 5.3125, 0.5},
      },
   },
   sounds = default.node_sound_wood_defaults(),
   groups = {choppy=2, wood=1,oddly_breakable_by_hand=3,flammable=3},
   on_rightclick = function(pos, node, puncher)
      minetest.swap_node(pos, {name = "castle_features:drawbridge_lowered", param2 = node.param2})
   end,   
})

minetest.register_node("castle_features:drawbridge_lowered", {
   description = "Drawbridge Lowered",
   drawtype = "nodebox",
   tiles = {"bridge_timber.png"},
   paramtype = "light",
   paramtype2 = "facedir",
   walkable = true,
   node_box = {
      type = "fixed",
      fixed = {
         {-2.5, 0.25, -4.5, 2.5, 0.5, 0.5},
      },
   },
   collision_box = {
      type = "fixed",
      fixed = {
         {-2.5, 0.25, -4.5, 2.5, 0.5, 0.5},
      },
   },
   groups = {choppy=2,wood=1,oddly_breakable_by_hand=3,flammable=3},
   sounds = default.node_sound_wood_defaults(),
   
   on_rightclick = function(pos, node, puncher)
      minetest.swap_node(pos, {name = "castle_features:drawbridge_raised", param2 = node.param2})
   end,
   drop = "castle_features:drawbridge_raised",
})

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 04:47
by sofar
TumeniNodes wrote:This is the code for a drawbridge I was working on a while back...
Never did figure out why I can't walk it?


Add a collision box.

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 05:35
by sofar
burli wrote:Is it possible to make such a leaf shape? It is a normal leaf node with an oversized plantlike inside


make a mesh node (and yes, this is entirely reasonable geometry)

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 05:38
by Byakuren
sofar wrote:
TumeniNodes wrote:This is the code for a drawbridge I was working on a while back...
Never did figure out why I can't walk it?


Add a collision box.

There is a collision box (though only on the lowered bridge), I think Minetest just doesn't detect collisions that far.

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 05:46
by kaeza
Byakuren wrote:There is a collision box (though only on the lowered bridge), I think Minetest just doesn't detect collisions that far.

Indeed, Minetest has serious bugs with collision boxes >1 node in size.

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 05:51
by sofar
kaeza wrote:
Byakuren wrote:There is a collision box (though only on the lowered bridge), I think Minetest just doesn't detect collisions that far.

Indeed, Minetest has serious bugs with collision boxes >1 node in size.


Actually, you can go 1 beyond the node itself. This node goes 2.0 beyond it, so the last 1.0 will be buggy.

Re: Post your modding questions here

PostPosted: Wed Mar 08, 2017 05:51
by sofar
Byakuren wrote:
sofar wrote:
TumeniNodes wrote:This is the code for a drawbridge I was working on a while back...
Never did figure out why I can't walk it?


Add a collision box.

There is a collision box (though only on the lowered bridge), I think Minetest just doesn't detect collisions that far.


A more reliable method would be voxelmanip and do multiple nodes.