Questions

Post Reply
Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

Questions

by Gibeinumo » Post

Hello Everyone,

I am trying to create a sign with the following code, but for some reason it doesn't work. Do you know why?

Code: Select all

minetest.register_node(
   'tutorial:sign',
   {
     description='sign',
     drawtype='nodebox',
     tiles={'tutorial_sign_wall.png'},
     inventory_image='tutorial_sign.png',
     wield_image='tutorial_sign.png',
     groups={dig_immediate=2},
     paramtype2='wallmounted',
     selection_box={
       type='wallmounted',
       wall_top={-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
       wall_bottom={-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
       wall_side={-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}
     },
     walkable=false
   }
)
It looks like this:
Spoiler
Image
Last edited by Gibeinumo on Thu Nov 22, 2018 07:51, edited 2 times in total.

User avatar
AiTechEye
Member
Posts: 1000
Joined: Fri May 29, 2015 21:14
GitHub: AiTechEye
Location: Sweden

Re: I try to create a sign

by AiTechEye » Post

try to chagne selection_box to node_box

Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

Re: I try to create a sign

by Gibeinumo » Post

That was the problem, thanks :)
Spoiler
Image
Last edited by Gibeinumo on Fri Nov 23, 2018 07:37, edited 1 time in total.

Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

Re: Questions

by Gibeinumo » Post

I have another problem. This time I try to create a liquid, but I get error messages that I don't understand. The error message is: "ERROR[Server]: Map::setNode(): Not allowing to place CONTENT_IGNORE while trying to replace "air" at (-2,9,-33) (block (-1,0,-3))". Do you know how to fix it?

Code: Select all

minetest.register_node(
  'tutorial:mywater',
  {
    description='MyWater',
    drawtype='liquid',
    paramtype='light',
    inventory_image=minetest.inventorycube('tutorial_mywater.png'),
    tiles={
      {
        name='tutorial_mywater_source_animated.png',
        animation={
          type='vertical_frames',
          aspect_w=16,
          aspect_h=16,
          length=2.0
        }
      }
    },
    special_tiles={
      {
        name='tutorial_mywater_source_animated.png',
        animation={
          type='vertical_frames',
          aspect_w=16,
          aspect_h=16,
          length=2.0,
        },
        backface_culling=false
      }
    },
    walkable=false,
    pointable=false,
    diggable=false,
    buildable_to=true,
    alpha=160,
    drowning=1,
    liquidtype='source',
    liquid_alterntative_flowing='tutorial:mywater_flowing',
    liquid_alternativ_source='tutorial:mywater',
    liquid_viscosity=WATER_VISC,
    liquid_range=8,
    post_effect_color={a=64, r=100, g=100, b=200}
  }
)
minetest.register_node(
  'tutorial:mywater_flowing',
  {
    description='Flowing MyWater',
    drawtype='flowingliquid',
    tiles={'tutorial_mywater.png'},
    special_tiles={
      {
        name='tutorial_mywater_flowing_animated.png',
        backface_culling=false,
        animation={
          type='vertical_frames',
          aspect_w=16,
          aspect_h=16,
          length=0.8
        }
      },
      {
        name='tutorial_mywater_flowing_animated.png',
        backface_culling=true,
        animation={
          type='vertical_frames',
          aspect_w=16,
          aspect_h=16,
          length=0.8
        }
      }
    },
    alpha=160,
    paramtype='light',
    paramtype2='flowingliquid',
    walkable=false,
    pointable=false,
    diggable=false,
    buildable_to=true,
    is_groud_content=false,
    drop='',
    drowning=1,
    liquidtype='flowing',
    liquid_alternative_flowing='tutorial:mywater_flowing',
    liquid_alternative_source='tutorial:mywater',
    liquid_viscosity=1,
    post_effect_color={a=64, r=100, g=100, b=200},
    groups={
      water=3,
      liquid=3,
      puts_out_fire=1,
      not_in_creative_inventory=1,
      cools_lava=1
    }
  }
)
Spoiler
Image

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: Questions

by rubenwardy » Post

you wrote liquid_alternativ_source in the first def
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

Re: Questions

by Gibeinumo » Post

I also wrote alterntative. That was the problem, thanks :)
Spoiler
Image

User avatar
Hybrid Dog
Member
Posts: 2835
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: Questions

by Hybrid Dog » Post

You're not the first person who has problems understanding the misleading CONTENT_IGNORE error message.
https://github.com/minetest/minetest/pull/7011

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

Re: Questions

by Gibeinumo » Post

I encountered another problem with the following code.

Code: Select all

minetest.register_node(
  'vsb:test',
  {
    description='test',
    tiles={
      'default_dirt.png',
    },
    groups={crumbly=3},
    on_use=function(itemstack,player,pointed_thing)
      minetest.chat_send_all(itemstack:get_count())
      itemstack:take_item(1)
      minetest.chat_send_all(itemstack:get_count())
      player:set_breath(5)
      player:set_wielded_item(itemstack)
    end
  }
)
The amount of items is reduced by one and the breath is set to five, but for some reason the amount of wielded items doesn't change. In theory it should work even without calling set_wielded_item. Do you know how to fix it?

User avatar
Linuxdirk
Member
Posts: 3219
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Questions

by Linuxdirk » Post

You need to return the modified itemstack.

Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

Re: Questions

by Gibeinumo » Post

Ah, thx. I changed the itemstack and then it was changed again by the function. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests