Post your modding questions here

User avatar
yzelast
Member
Posts: 54
Joined: Sun Oct 02, 2016 01:18
GitHub: yzelast
In-game: yzelast
Location: Far Far Away

Re: Post your modding questions here

by yzelast » Post

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))
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE

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:

Re: Post your modding questions here

by kaeza » Post

It means the node you are trying to place doesn't exist.
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
yzelast
Member
Posts: 54
Joined: Sun Oct 02, 2016 01:18
GitHub: yzelast
In-game: yzelast
Location: Far Far Away

Re: Post your modding questions here

by yzelast » Post

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.
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE

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:

Re: Post your modding questions here

by kaeza » Post

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.
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
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Post

Is it possible to make such a leaf shape? It is a normal leaf node with an oversized plantlike inside

Image
Attachments
Bildschirmfoto vom 2017-03-04 17-37-26.jpg
Bildschirmfoto vom 2017-03-04 17-37-26.jpg (176.16 KiB) Viewed 784 times

User avatar
yzelast
Member
Posts: 54
Joined: Sun Oct 02, 2016 01:18
GitHub: yzelast
In-game: yzelast
Location: Far Far Away

Re: Post your modding questions here

by yzelast » Post

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.
viewtopic.php?f=9&t=16292
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: Post your modding questions here

by D00Med » Post

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)
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Post

You mean a copy of the generated map? How far you will copy? Inside a chunk

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: Post your modding questions here

by D00Med » Post

Yeah. Everything
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Post

Should be fast if you use VoxelManip

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: Post your modding questions here

by D00Med » Post

Ok...I should probably learn how then...
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

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:

Re: Post your modding questions here

by kaeza » Post

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?
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

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Post

Hybrid Dog wrote:Does node metadata become compressed?
I'm fairly sure everything on the map is compressed, including entity data as well.

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Post

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?

User avatar
rubenwardy
Moderator
Posts: 6978
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Post your modding questions here

by rubenwardy » Post

It's on place
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Desour
Member
Posts: 1473
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Post your modding questions here

by Desour » Post

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).
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
burli
Member
Posts: 1643
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Post

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

EdShouldBeInBed
Member
Posts: 48
Joined: Sun Feb 22, 2015 16:03
In-game: EdShdBInBed

Aliasing Nodes

by EdShouldBeInBed » Post

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?
I'm a writer who tinkers with code on occasion. I play minetest when insomnia makes the writing hard.

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Post your modding questions here

by TumeniNodes » Post

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",
})
A Wonderful World

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Post

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.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Post

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)

Byakuren
Member
Posts: 818
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: Post your modding questions here

by Byakuren » Post

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.
Every time a mod API is left undocumented, a koala dies.

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:

Re: Post your modding questions here

by kaeza » Post

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.
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

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Post

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.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Post

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.

Locked

Who is online

Users browsing this forum: No registered users and 10 guests