Post your modding questions here

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

Re: Post your modding questions here

by yzelast » Sat Mar 04, 2017 06:02

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
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Sat Mar 04, 2017 06:08

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
Location: Far Far Away
GitHub: yzelast
In-game: yzelast

Re: Post your modding questions here

by yzelast » Sat Mar 04, 2017 06:22

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
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Sat Mar 04, 2017 06:31

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: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Sat Mar 04, 2017 16:40

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
(176.16 KiB) Downloaded 1 time
 

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

Re: Post your modding questions here

by yzelast » Sat Mar 04, 2017 18:04

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
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE
 

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

Re: Post your modding questions here

by D00Med » Mon Mar 06, 2017 07:11

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)
 

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

Re: Post your modding questions here

by burli » Mon Mar 06, 2017 07:24

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

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

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

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

Re: Post your modding questions here

by D00Med » Mon Mar 06, 2017 07:51

Ok...I should probably learn how then...
 

User avatar
kaeza
Moderator
 
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Mon Mar 06, 2017 08:12

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: 2124
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Tue Mar 07, 2017 05:20

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: 1641
Joined: Fri Apr 10, 2015 13:18

Re: Post your modding questions here

by burli » Tue Mar 07, 2017 12:57

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: 6019
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
 

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

Re: Post your modding questions here

by DS-minetest » Tue Mar 07, 2017 13:36

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).
Note that I've recently renamed myself on github and co. to "Desour". (I'm bad at naming things.)
Feel free to call me DS.
 

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

Re: Post your modding questions here

by burli » Tue Mar 07, 2017 13:56

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 » Tue Mar 07, 2017 15:29

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: 2851
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Wed Mar 08, 2017 03:36

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",
})
Ich mag keine grünen Eier und Schinken, ich mag sie nicht Sam I Am
 

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

Re: Post your modding questions here

by sofar » Wed Mar 08, 2017 04:47

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: 2124
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Wed Mar 08, 2017 05:35

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: 816
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: Post your modding questions here

by Byakuren » Wed Mar 08, 2017 05:38

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
Location: Montevideo, Uruguay
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

Re: Post your modding questions here

by kaeza » Wed Mar 08, 2017 05:46

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: 2124
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Wed Mar 08, 2017 05:51

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: 2124
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Wed Mar 08, 2017 05:51

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.
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: Wuzzy and 4 guests