Thank you sofar, I'll give it a try again.sofar wrote:it's entirely possible - this is how the fence gate works. But yes, the top door part is an issue, you'll have to make a top door half to create the proper collision box.TumeniNodes wrote: ehem... speaking of doors. Would anyone be able to give the nodebox/selection box coords to set doors to the center of blocks, and when open they come a bit into the next node space?
I realize not many like the idea but I would like it for personal use and I do not know how to use the / positions I'm to used to 0.5 type positions.
I already tried it a few times and cannot get it to work, I think mainly due to the hidden part for the hinges.
I also realize some may feel this will break things but I will take full blame on myself if it does :P
Post your modding questions here
- 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
A Wonderful World
- D00Med
- Member
- Posts: 949
- Joined: Sat Feb 07, 2015 22:49
- GitHub: D00Med
- Location: Australia...somewhere
Re: Post your modding questions here
Nope, it's there.sofar wrote:Did you forget to add `doors` to `depends.txt` ?
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242
My subgame: viewtopic.php?f=15&t=14051#p207242
- 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
maybe you should name the table not doors, like this:D00Med wrote:Why does this keep crashing the game? I get this error: "attempt to call field 'get' (a nil value)"Code: Select all
local minp = {x=pos.x-5, y=pos.y, z=pos.z-5} local maxp = {x=pos.x+5, y=pos.y, z=pos.z+5} local doors = minetest.find_nodes_in_area(minp, maxp, "group:door") for i = 1, #doors do local dpos = {x=doors[i].x, y=doors[i].y, z=doors[i].z} local door = doors.get(dpos) door:toggle(player) end
It doesn't happen when there is no door in the area. I did get it to work after using only one position.
Code: Select all
local minp = {x=pos.x-5, y=pos.y, z=pos.z-5}
local maxp = {x=pos.x+5, y=pos.y, z=pos.z+5}
local doorss = minetest.find_nodes_in_area(minp, maxp, "group:door")
for i = 1, #doorss do
local dpos = {x=doorss[i].x, y=doorss[i].y, z=doorss[i].z}
local door = doors.get(dpos)
door:toggle(player)
end
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- Hybrid Dog
- Member
- Posts: 2835
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
-
- Member
- Posts: 10
- Joined: Tue Dec 27, 2016 14:41
Re: Post your modding questions here
Topic: How to add texture
Reason: I have an error
More Info(optional): hello everyone . I followed the tutorial but I don't understand. I call the image tutorial_decowood end the code is that :
and the error is :
Can anyone help me?
Reason: I have an error
More Info(optional): hello everyone . I followed the tutorial but I don't understand. I call the image tutorial_decowood end the code is that :
Code: Select all
minetest.register_node("tutorial:decowood", {
tile_images = {"tutorial_decowood.png"},
groups={level=1},
})
Code: Select all
ERROR[main]: generateImage(): could not load image "tutorial_decowood.png" while building texture
ERROR[main]: generateImage(): Creating a dummy image for "tutorial_decowood.png"
Re: Post your modding questions here
ahh yeah, I didn't spot that error. You just overwrote the `doors` global this way.DS-minetest wrote: maybe you should name the table not doors
This kind of programming stuff can be found by luacheck. I strongly recommend you start learning how to use it - it really helps you find bugs early.
- D00Med
- Member
- Posts: 949
- Joined: Sat Feb 07, 2015 22:49
- GitHub: D00Med
- Location: Australia...somewhere
Re: Post your modding questions here
Oh ok, thankyou
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242
My subgame: viewtopic.php?f=15&t=14051#p207242
- 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
@JackWilliam:
as you can see in lua_api.txt line 3713:
=> its called "tiles", not "tile_images"
as you can see in lua_api.txt line 3713:
Code: Select all
tiles = {tile definition 1, def2, def3, def4, def5, def6}, --[[
^ Textures of node; +Y, -Y, +X, -X, +Z, -Z (old field name: tile_images)
^ List can be shortened to needed length ]]
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
-
- Member
- Posts: 10
- Joined: Tue Dec 27, 2016 14:41
Re: Post your modding questions here
thanks DS-minetest, I have modified the code, but the error is still there.
the node in game is like this: and the color change when I restart minetest or when I try to mine the node.
the node in game is like this: and the color change when I restart minetest or when I try to mine the node.
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Post your modding questions here
This error happens when the texture could not be found.JackWilliam wrote:and the color change when I restart minetest or when I try to mine the node.
Check or create a texture at the location mods/tutorial/textures/tutorial_decowood.png. Make sure it's exactly that path, otherwise Minetest will not be able to find the texture.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Tmanyo
- Member
- Posts: 196
- Joined: Mon Sep 29, 2014 01:20
- GitHub: Tmanyo
- IRC: Tmanyo
- In-game: tmanyo
- Location: United States
- Contact:
Re: Post your modding questions here
Is there a way to tie detached inventories into meta data?
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player
-
- Member
- Posts: 10
- Joined: Tue Dec 27, 2016 14:41
Re: Post your modding questions here
Yes I know but the path is correct. Can be the editor?? I use Geany.Krock wrote: This error happens when the texture could not be found.
Check or create a texture at the location mods/tutorial/textures/tutorial_decowood.png. Make sure it's exactly that path, otherwise Minetest will not be able to find the texture.
- Napiophelios
- Member
- Posts: 1035
- Joined: Mon Jul 07, 2014 01:14
- GitHub: Napiophelios
- IRC: Nappi
- In-game: Nappi
Re: Post your modding questions here
try making a folder in the texture pack directory and place the image there too.
then select your new "texture pack" when you start the game.
Almost every time I get this error it's because I mispelt something somewhere.
then select your new "texture pack" when you start the game.
Almost every time I get this error it's because I mispelt something somewhere.
Re: Post your modding questions here
It's looks like metadata ~= staticdata ?DS-minetest wrote:as much as i know you cant save metadata in entities but you could save something in staticdata
Thank you all now it works )orwell wrote: ... ObjectRef
... get it's luaentity (the lua table that is "self" ...)
... write stuff into it.
But little question still yet. What exactly data of entity will be saved in world file when server shutdown ?
Is wiki have somewhere the explanation what data structures will be save ?
Some mods and get_staticdata() seems like only scripter need carry about save and init each entity with unique data.
I am a noob. still yet. Not so noob ) [vml] WIP and a little proof for fun PlantedTorch )))
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
MT Strike 78a36b468554d101e0be3b0d1f587a555f396452 Great! Somebody have found it )
"My english isn't well" I know. I'm sorry )
- 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
to save data from the entity for the next load you use the get_staticdata function
return <what you need (only strings, to make tables to strings use minetest.de-/serialize, note: this doesnt work with userdata)>
then write into the on_activate(self, staticdata, dtime_s)
and use staticdata as the returned string
return <what you need (only strings, to make tables to strings use minetest.de-/serialize, note: this doesnt work with userdata)>
then write into the on_activate(self, staticdata, dtime_s)
and use staticdata as the returned string
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)
- ManElevation
- Member
- Posts: 896
- Joined: Tue Aug 02, 2016 22:04
- GitHub: ManElevation
- IRC: ManElevation
- In-game: ManElevation
- Location: Madrid,Spain
Re: Post your modding questions here
can some one write a block lua script. just a plain block
with a {"front.png"} a {"side.png"} and a {"top.png"} {"back.png"}
a full one pleas
with a {"front.png"} a {"side.png"} and a {"top.png"} {"back.png"}
a full one pleas
My Public Mods! Discord: Rottweiler Games#3368
- Napiophelios
- Member
- Posts: 1035
- Joined: Mon Jul 07, 2014 01:14
- GitHub: Napiophelios
- IRC: Nappi
- In-game: Nappi
Re: Post your modding questions here
ManElevation wrote:can some one write a block lua script. just a plain block
with a {"front.png"} a {"side.png"} and a {"top.png"} {"back.png"}
a full one pleas
- GreenXenith
- Member
- Posts: 1356
- Joined: Wed Oct 28, 2015 01:26
- GitHub: GreenXenith
- Location: UTC-8:00
- Contact:
Re: Post your modding questions here
For my Sandplus Mod, I would like to add an ability to have a recipe canceled and replaced with a grinder recipe if the technic mod is enabled. I know I would have to use something along the lines of "if minetest.get_modpath("technic") then...", and somewhere in there the technic grinding recipe (table.insert(recipes, {"modname:node1", "modname:node2"})), but I don't know how to do this. Help?
EDIT: I think I got it :P
EDIT: I think I got it :P
YouTube | Mods | Patreon | Minetest Discord @greenxenith
You should not be able to read this message.
You should not be able to read this message.
- BrunoMine
- Member
- Posts: 1082
- Joined: Thu Apr 25, 2013 17:29
- GitHub: BrunoMine
- Location: SP-Brasil
- Contact:
Re: Post your modding questions here
Is there a way to track the status of a player?
For example, if the player is in a car, bed, boat, helicoter and others.
Is there a unified way of checking this sort of thing?
I'd like to know how to control these things to prevent a player from being able to make and control multiple cars simultaneously, or even crash the server.
For example, if the player is in a car, bed, boat, helicoter and others.
Is there a unified way of checking this sort of thing?
I'd like to know how to control these things to prevent a player from being able to make and control multiple cars simultaneously, or even crash the server.
-
- Member
- Posts: 10
- Joined: Tue Dec 27, 2016 14:41
Re: Post your modding questions here
Thanks a lot, now it works fine. I have another question, how can I put a node on the map such as the diamond block, coal, gold, etc.?Napiophelios wrote:try making a folder in the texture pack directory and place the image there too.
then select your new "texture pack" when you start the game.
Almost every time I get this error it's because I mispelt something somewhere.
- 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
hi guys,i have a few questions about node timers.
If a timer end in an unloaded mapblock what will happen with the code inside the on_timer function?
And how i do to make a node timer stop decreasing on night, and return to decrease on day?
If i could pause the timers at night my trees mod will benefits a lot,making the growing more precise.
If a timer end in an unloaded mapblock what will happen with the code inside the on_timer function?
And how i do to make a node timer stop decreasing on night, and return to decrease on day?
If i could pause the timers at night my trees mod will benefits a lot,making the growing more precise.
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE
Re: Post your modding questions here
You can't dynamically put code in `on_timer()`, it has to be known at init time, so the code is always known no matter what.yzelast wrote:hi guys,i have a few questions about node timers.
If a timer end in an unloaded mapblock what will happen with the code inside the on_timer function?
And how i do to make a node timer stop decreasing on night, and return to decrease on day?
If i could pause the timers at night my trees mod will benefits a lot,making the growing more precise.
The default trees in the game use node timers and if the timer elapses during the night, the growth is attempted again and again every 2 minutes or so until light levels are in order.
Postponing a node timer is possible, but not on unloaded blocks, so you need to do this in the `on_timer()` function.
If a node timer expires while the block is unloaded, the node timer code for that node is run as soon as the block is loaded. Unlike ABM's, nodetimers are never skipped.
Making a node timer stop decreasing at night is pretty much not possible, not reliably anyway. You're better off finding an algorithm that works for you that doesn't require that type of mechanism.
- 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
Thanks,i think that my mod will not care if a tree grow at night,taking the right time is enough for me.sofar wrote:You can't dynamically put code in `on_timer()`, it has to be known at init time, so the code is always known no matter what.yzelast wrote:hi guys,i have a few questions about node timers.
If a timer end in an unloaded mapblock what will happen with the code inside the on_timer function?
And how i do to make a node timer stop decreasing on night, and return to decrease on day?
If i could pause the timers at night my trees mod will benefits a lot,making the growing more precise.
The default trees in the game use node timers and if the timer elapses during the night, the growth is attempted again and again every 2 minutes or so until light levels are in order.
Postponing a node timer is possible, but not on unloaded blocks, so you need to do this in the `on_timer()` function.
If a node timer expires while the block is unloaded, the node timer code for that node is run as soon as the block is loaded. Unlike ABM's, nodetimers are never skipped.
Making a node timer stop decreasing at night is pretty much not possible, not reliably anyway. You're better off finding an algorithm that works for you that doesn't require that type of mechanism.
I asked about the timers because i don't want to face unexpected behavior with it, because my entire mod is basically timers and abm's
G84mU6AQ9dKaNhxn6dq8P5C0y5r8NssE
Re: Post your modding questions here
Topic: Where to put code for stairs.
Reason: I've made a mod for indestructible obsidian and my stairs keep blowing up.
In all my other nodes I can put code in the code block marked minetest.register_node.
However in stairs that codeblock is listed in an if else and no matter where I put my code in the code blocks my stairs keep blowing up. The rest of my nodes (block, door, glass) work great.
Reason: I've made a mod for indestructible obsidian and my stairs keep blowing up.
In all my other nodes I can put code in the code block marked minetest.register_node.
However in stairs that codeblock is listed in an if else and no matter where I put my code in the code blocks my stairs keep blowing up. The rest of my nodes (block, door, glass) work great.
- 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
do stairs register instead. stairs is a separate mod from defaultpetra2201 wrote:Topic: Where to put code for stairs.
Reason: I've made a mod for indestructible obsidian and my stairs keep blowing up.
In all my other nodes I can put code in the code block marked minetest.register_node.
However in stairs that codeblock is listed in an if else and no matter where I put my code in the code blocks my stairs keep blowing up. The rest of my nodes (block, door, glass) work great.
A Wonderful World
Who is online
Users browsing this forum: No registered users and 25 guests