Post your modding questions here

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

Re: Post your modding questions here

by Hybrid Dog » Post

How can l make a function which can change a inventory image of an item by adding the image onto the old one modifying the formspec?

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

User avatar
ArguablySane
Member
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: Post your modding questions here

by ArguablySane » Post

rubenwardy wrote:wrong name, it's minetest.hash_node_position({x=,y=,z=})

http://rubenwardy.com/minetest_modding_ ... .html#misc
That's perfect, thanks. I'll remember to use that site (or lua_api.txt) in future instead of relying on the wiki.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.

User avatar
Sane
Member
Posts: 103
Joined: Tue Jun 17, 2014 09:31
GitHub: mt-sane
In-game: Sane

minetest.find_path() algorithms

by Sane » Post

Hi there,

the minetest.find_path() function has an parameter to set the searching algorithm ("A*_noprefetch", "A*", "Dijkstra"),
I am wondeing what the differences are. Is there a documentation on them somewhere?
Trying to stay me.

User avatar
ArguablySane
Member
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: minetest.find_path() algorithms

by ArguablySane » Post

Sane wrote:Hi there,

the minetest.find_path() function has an parameter to set the searching algorithm ("A*_noprefetch", "A*", "Dijkstra"),
I am wondeing what the differences are. Is there a documentation on them somewhere?
Wikipedia has articles on both Dijkstra's Algorithm and the A* Algorithm. In simple terms, the A* algorithm is usually a lot faster and more efficient than Dijkstra's algorithm, especially in cases where there are a large number of possible paths you could take to get from A to B (eg. A and B are on opposite sides of a large field). Dijkstra's might be faster in certain designs of maze though.
I'm not sure what A*_noprefetch is though.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.

Joz
Member
Posts: 41
Joined: Fri Oct 25, 2013 21:37

Re: Post your modding questions here

by Joz » Post

With what NodeID are nodes initialised in singlenode?

User avatar
ArguablySane
Member
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: Post your modding questions here

by ArguablySane » Post

Joz wrote:With what NodeID are nodes initialised in singlenode?
By default, it's air (minetest.get_content_id("air")). I believe there's a way to customise it from within a mapgen mod though.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Post

I have a number of tables set up.

Code: Select all

local chis1 = stuff
local chis2 = stuff
local hori1 = stuff
local hori2 = stuff
local vert1 = stuff
local vert2 = stuff
etc
Then I have another table set up.

Code: Select all

local modes = {
	{"chiseled", "Chiseled", chis},
	{"horizontal", "Horizontal", hori},
	{"vertical", "Vertical", vert},
	{"cross", "Cross", cross},
	}
for i in ipairs (modes) do
local mode = modes [i][1]
local mdesc = modes [i][2]
local typ = modes [i][3]
How do I join them? I want to make it so that it puts the type then a number so it is read as vert1 or hori1.

Code: Select all

node_box = typ.."1",
node_box = typ.."2"
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

JasonGrace246
New member
Posts: 2
Joined: Tue Aug 25, 2015 05:04
GitHub: jasongrace246
In-game: JasonGrace246

Re: Post your modding questions here

by JasonGrace246 » Post

I am using the Cart Mod of PilzAdams (viewtopic.php?id=2451) and its not working.
First it gave the characters not allowed error, so I changed the folder's name to "carts".
But now it gives me this error-
error.JPG
Brief Description Of Error-
The init.lua file in the mod throws an error saying- "Attempt to concatenate a nil value"
then its says "in main chunk" "check debug.txt for details"

PLEASE HELP
How To Get This Mod Working?

User avatar
ArguablySane
Member
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: Post your modding questions here

by ArguablySane » Post

Don, am I right in thinking that you want to assign the value of chis1/hori1/etc (in this case "stuff"), to node_box?
You're going to have to iterate over a table of references to each type, but it would be helpful to know exactly what you're going to be using this code for. If I know the context I might be able to suggest a much simpler way of doing it.

JasonGrace, please post the full error message. It should say which line of init.lua the error is occurring on.


Oh, and I have a question of my own. If I'm writing a mapgen, is there a way to make sure the mapgen runs before any other mods? I know depends.txt lets me specify other mods which have to run before mine, but I'd like to make sure that my mod has a chance to actually create the terrain before other mods add things to it.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.

User avatar
swordpaint12
Member
Posts: 191
Joined: Sat Aug 22, 2015 00:50
In-game: [swordpaint12][Belching_Balladeer]
Location: Foobass, isle of Atlantis, castle of Bardvendelle

Re: Post your modding questions here

by swordpaint12 » Post

Nevermind, I was right.
Last edited by swordpaint12 on Tue Aug 25, 2015 13:11, edited 1 time in total.
God's not dead; remember that!
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.

I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Post

swordpaint12 wrote:I remember reading somewhere that a special file was required to make something a modpack. I think was modpack.txt, but I'm not sure. What is the title supposed to be?

I am trying to bundle a couple of the mods I have downloaded together so they are easier to enable. It's just for some worlds I'm working on.
Just put an empty file called modpack.txt
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Post your modding questions here

by Sokomine » Post

ArguablySane wrote: Oh, and I have a question of my own. If I'm writing a mapgen, is there a way to make sure the mapgen runs before any other mods? I know depends.txt lets me specify other mods which have to run before mine, but I'd like to make sure that my mod has a chance to actually create the terrain before other mods add things to it.
There's no such option. At least I don't know of any other than the depends.txt approach.
A list of my mods can be found here.

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

Re: Post your modding questions here

by Hybrid Dog » Post

Sokomine wrote:
ArguablySane wrote: Oh, and I have a question of my own. If I'm writing a mapgen, is there a way to make sure the mapgen runs before any other mods? I know depends.txt lets me specify other mods which have to run before mine, but I'd like to make sure that my mod has a chance to actually create the terrain before other mods add things to it.
There's no such option. At least I don't know of any other than the depends.txt approach.
you could try table.insert(minetest.registered_on_generateds, 1, function(minp,maxp,seed)
[…]
end)

l guess ores and mgv6 would still be generated before that.

Edit: l just used it myself: https://github.com/HybridDog/fractured/ ... 53e79d30c6

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

User avatar
ArguablySane
Member
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: Post your modding questions here

by ArguablySane » Post

Hybrid Dog wrote: you could try table.insert(minetest.registered_on_generateds, 1, function(minp,maxp,seed)
[…]
end)
Oohhh, that's clever. Thanks for the idea.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.

User avatar
swordpaint12
Member
Posts: 191
Joined: Sat Aug 22, 2015 00:50
In-game: [swordpaint12][Belching_Balladeer]
Location: Foobass, isle of Atlantis, castle of Bardvendelle

Re: Post your modding questions here

by swordpaint12 » Post

Is there any way to create a block that is basically a vertical slab? If so, how do I do that?
God's not dead; remember that!
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.

I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.

User avatar
ArguablySane
Member
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: Post your modding questions here

by ArguablySane » Post

swordpaint12 wrote:Is there any way to create a block that is basically a vertical slab? If so, how do I do that?
You can set the drawtype to nodebox to create blocks which don't fill the entire volume.
You'll need to set paramtype2 == "facedir" in your nodedef to be able to make it rotate to any of the 4 (or 6) possible alignments.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.

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

Re: Post your modding questions here

by Hybrid Dog » Post

swordpaint12 wrote:Is there any way to create a block that is basically a vertical slab? If so, how do I do that?
you could use the screwdriver

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

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Post your modding questions here

by TenPlus1 » Post

Slabs *can* be placed on the side of a node so that it stands UP...

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

Re: Post your modding questions here

by Hybrid Dog » Post

TenPlus1 wrote:Slabs *can* be placed on the side of a node so that it stands UP...
When l place a slab on the side of a node it doesn't stand up.
If they did, building roofs with slabs would become far more annoying.

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

User avatar
TenPlus1
Member
Posts: 3715
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Post your modding questions here

by TenPlus1 » Post

Apologies, I use a different version of Stairs mod that allows for on_rotate functions so that you can place slabs on floor or wall and have a different rotation with both (or hold shift and place on wall to place flat/normal)...

I've attached it here if you wish to use it:
Attachments
stairs(redo).zip
(1.29 KiB) Downloaded 76 times

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

Re: Post your modding questions here

by Hybrid Dog » Post

TenPlus1 wrote:Apologies, I use a different version of Stairs mod that allows for on_rotate functions so that you can place slabs on floor or wall and have a different rotation with both (or hold shift and place on wall to place flat/normal)...

I've attached it here if you wish to use it:
no, thanks, l try to build bigger, e.g. to get more details, instead of e.g. using slabs to build thin walls

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

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Post

Slabs made from the saw in moreblocks rotate on place.
viewtopic.php?id=509
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

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

Re: Post your modding questions here

by Hybrid Dog » Post

Don wrote:Slabs made from the saw in moreblocks rotate on place.
viewtopic.php?id=509
l know, that's extremely annoying in my opinion.

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

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: Post your modding questions here

by Don » Post

Hybrid Dog wrote:
Don wrote:Slabs made from the saw in moreblocks rotate on place.
viewtopic.php?id=509
l know, that's extremely annoying in my opinion.
I love it. No need for the screwdriver.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
swordpaint12
Member
Posts: 191
Joined: Sat Aug 22, 2015 00:50
In-game: [swordpaint12][Belching_Balladeer]
Location: Foobass, isle of Atlantis, castle of Bardvendelle

Re: Post your modding questions here

by swordpaint12 » Post

Hybrid Dog wrote: If they did, building roofs with slabs would become far more annoying.
Actually, that's WHY I asked. I'm trying to make a tall roof using 'walls.'
God's not dead; remember that!
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.

I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.

Locked

Who is online

Users browsing this forum: No registered users and 4 guests