Post your modding questions here
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
16³Evergreen wrote:I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?
for the second question, it's just easy math:
Code: Select all
local pos = player:getpos()
local relpos = { x=pos.x % 16, y=pos.y % 16, z=pos.z % 16 }
if relpos.x <= 1 or relpos.x >= 15 or relpos.y <= 1 or relpos.y >= 15 or relpos.z <= 1 or relpos.z >= 15 then
-- I am at the edge
else
-- I am not
end
Last edited by kaeza on Wed May 22, 2013 22:47, edited 1 time in total.
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
Check out my stuff! | Donations greatly appreciated! PayPal
- PilzAdam
- Member
- Posts: 4026
- Joined: Fri Jul 20, 2012 16:19
- GitHub: PilzAdam
- IRC: PilzAdam
- Location: Germany
As jojoa said, a mapblock is 16x16x16 nodes. However, the map generator always generates 5x5x5 mapblocks at once.Evergreen wrote:I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?
To see if you are at the edge of the mapblock just look at the animation of lava. It is by default not synced (there is a setting for that in minetest.conf), so you can see the mapblock borders.
EDIT: 2500 POSTS!!!!
Last edited by PilzAdam on Wed May 22, 2013 22:49, edited 1 time in total.
-
- Member
- Posts: 141
- Joined: Sat Apr 20, 2013 21:05
- Location: Austin, TX
- Contact:
LOLPilzAdam wrote: EDIT: 2500 POSTS!!!!
Somehow you didn't strike me as someone who would get excited about your post totals.
Good jorb, Adam. Good jorb.
In order to change yourself, you must believe the change is possible and that there are rewards for making the change.
- Inspired by Hebrews 11:6
- Inspired by Hebrews 11:6
why do mapblocks generate 5*5*5 and not 16*16*16PilzAdam wrote:As jojoa said, a mapblock is 16x16x16 nodes. However, the map generator always generates 5x5x5 mapblocks at once.Evergreen wrote:I know this doesn't have to do with mods, but how large is a chunk(otherwise known as block)? And how can I tell that I am on the edge of a chunk?
To see if you are at the edge of the mapblock just look at the animation of lava. It is by default not synced (there is a setting for that in minetest.conf), so you can see the mapblock borders.
EDIT: 2500 POSTS!!!!
Coding;
1X coding
3X debugging
12X tweaking to be just right
1X coding
3X debugging
12X tweaking to be just right
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
DERPjojoa1997 wrote:why do mapblocks generate 5*5*5 and not 16*16*16
Last edited by kaeza on Thu May 23, 2013 10:02, edited 1 time in total.
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
Check out my stuff! | Donations greatly appreciated! PayPal
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Here is something I was working on. What I want is a cauldron that fills with water when right clicked with a bucket of water. I tried this but it doesn't work. Here is the code:
Code: Select all
minetest.register_node("thaumtest:cauldron_full",{
drawtype="nodebox",
paramtype = "light",
tiles = {"default_wood.png"},
groups = {choppy=2},
node_box = {
type = "fixed",
fixed = {
{-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
{0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
{-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
{-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.312500,-0.500000,0.500000,0.312500,0.500000},
{-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
{0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
}
}
})
minetest.register_node("thaumtest:cauldron_empty",{
drawtype="nodebox",
description= "Cauldron",
paramtype = "light",
tiles = {"default_wood.png"},
groups = {choppy=2},
node_box = {
type = "fixed",
fixed = {
{-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
{0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
{-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
{-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
{0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
{-0.500000,-0.375000,-0.500000,0.500000,-0.312500,0.500000},
}
}
on_rightclick = function(pos, node, clicker, itemstack)
if itemstack:get_name() == "bucket:bucket_water" then
minetest.env:set_node(pos, "thaumtest:cauldron_full")
end
end
}
})
Back from the dead!
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
I thougt it would be nice if you could change stack_max using a setting. So game-modes could use minetest.config instead of overwriting.
This is my first try, but it is not working at all:
in builtin/item.lua line 376
@Evergreen
You need to add a , at the end of the on_rightclick and the nodebox.
This is my first try, but it is not working at all:
in builtin/item.lua line 376
Code: Select all
--
-- Item definition defaults
--
local stack_max = 99
if tonumber(minetest.setting_get(stack_max)) then
stack_max = tonumber(minetest.setting_get(stack_max))
print("[builtin] stack_max = ".. tonumber(minetest.setting_get(stack_max)) .."")
end
minetest.nodedef_default = {
-- Item properties
type="node",
-- name intentionally not defined here
description = "",
groups = {},
inventory_image = "",
wield_image = "",
wield_scale = {x=1,y=1,z=1},
stack_max = stack_max,
-- . . .
You need to add a , at the end of the on_rightclick and the nodebox.
Last edited by Casimir on Sat May 25, 2013 15:04, edited 1 time in total.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Tried it and it still doesn't work. Code:
Code: Select all
minetest.register_node("thaumtest:cauldron_full",{
drawtype="nodebox",
paramtype = "light",
tiles = {"default_wood.png"},
groups = {choppy=2},
node_box = {
type = "fixed",
fixed = {
{-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
{0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
{-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
{-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.312500,-0.500000,0.500000,0.312500,0.500000},
{-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
{0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
}
}
})
minetest.register_node("thaumtest:cauldron_empty",{
drawtype="nodebox",
description= "Cauldron",
paramtype = "light",
tiles = {"default_wood.png"},
groups = {choppy=2},
node_box = {
type = "fixed",
fixed = {
{-0.500000,-0.375000,-0.500000,-0.375000,0.500000,0.500000},
{0.375000,-0.375000,-0.500000,0.500000,0.500000,0.500000},
{-0.500000,-0.375000,-0.500000,0.500000,0.500000,-0.375000},
{-0.500000,-0.375000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.500000,-0.500000,-0.375000,0.500000,-0.375000},
{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000},
{0.375000,-0.500000,0.375000,0.500000,0.500000,0.500000},
{-0.500000,-0.500000,0.375000,-0.375000,0.500000,0.500000},
{-0.500000,-0.375000,-0.500000,0.500000,-0.312500,0.500000},
}
},
on_rightclick = function(pos, node, clicker, itemstack)
if itemstack:get_name() == "bucket:bucket_water" then
minetest.env:set_node(pos, "thaumtest:cauldron_full")
end
end,
}
})
Back from the dead!
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
Code: Select all
(...)
on_rightclick = function(pos, node, clicker, itemstack)
if itemstack:get_name() == "bucket:bucket_water" then
minetest.env:set_node(pos, "thaumtest:cauldron_full")
end
end,
} <-- REMOVE THIS
})
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
Check out my stuff! | Donations greatly appreciated! PayPal
It is caused by the bucket mod. -> https://github.com/minetest/minetest_ga ... it.lua#L42Evergreen wrote:Tried it and it still doesn't work. Code:Code: Select all
-code-
When it is changed to on_use() [in bucket mod] it works fine.
^
Edit: Casimirs solution is better (to use on_punch()).
And it has to be
Code: Select all
minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
Last edited by BlockMen on Sat May 25, 2013 15:59, edited 1 time in total.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Now working:
Please interpret this as a pullrequest
@Evergreen
You will encounter an additional problem. The bucket is not calling the on_rightclick function of nodes, it will just place the water. You could use on_punch.
Edit: BlockMen was faster
Code: Select all
local stack_max = 99
if minetest.setting_get("stack_max") then
stack_max = minetest.setting_get("stack_max")
end
@Evergreen
You will encounter an additional problem. The bucket is not calling the on_rightclick function of nodes, it will just place the water. You could use on_punch.
Edit: BlockMen was faster
Last edited by Casimir on Sat May 25, 2013 15:53, edited 1 time in total.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
I looked in the debug, and that is supposed to be there. EDIT: nvmkaeza wrote:Code: Select all
(...) on_rightclick = function(pos, node, clicker, itemstack) if itemstack:get_name() == "bucket:bucket_water" then minetest.env:set_node(pos, "thaumtest:cauldron_full") end end, } <-- REMOVE THIS })
Last edited by Evergreen on Sat May 25, 2013 16:12, edited 1 time in total.
Back from the dead!
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Soon it will not be minetest.env:set_node it will be minetest.set_node. Just something to think about.BlockMen wrote:It is caused by the bucket mod. -> https://github.com/minetest/minetest_ga ... it.lua#L42Evergreen wrote:Tried it and it still doesn't work. Code:Code: Select all
-code-
When it is changed to on_use() [in bucket mod] it works fine.
^
Edit: Casimirs solution is better (to use on_punch()).
And it has to beCode: Select all
minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
Back from the dead!
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Getting closer, but now I get an error when punching the cauldron with the bucket.
Code: Select all
12:13:01: ERROR[main]: ServerError: LuaError: error: ...rett/Desktop/Minetest/bin/../mods/thaumtest/init.lua:43: attempt to index local 'itemstack' (a nil value)
12:13:01: ERROR[main]: stack traceback:
Back from the dead!
Of cause you get this error, because on_punch gives no itemstack -> https://github.com/minetest/minetest/bl ... .txt#L1737Evergreen wrote:Getting closer, but now I get an error when punching the cauldron with the bucket.Code: Select all
12:13:01: ERROR[main]: ServerError: LuaError: error: ...rett/Desktop/Minetest/bin/../mods/thaumtest/init.lua:43: attempt to index local 'itemstack' (a nil value) 12:13:01: ERROR[main]: stack traceback:
you have to change it to this
Code: Select all
on_punch = function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then
minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
end
end,
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
Thanks, it works now. The next problem is to empty the bucket when the cauldron is punched. (don't answer this until I have a problem)
Last edited by Evergreen on Sat May 25, 2013 17:00, edited 1 time in total.
Back from the dead!
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
I have a problem. I tried to do this:
Code: Select all
on_punch = function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then
minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
minetest.env:replace({item="bucket:bucket_empty"})
end
end,
Last edited by Evergreen on Sat May 25, 2013 17:05, edited 1 time in total.
Back from the dead!
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
he was using on_rightclick, not on_punch.BlockMen wrote:Of cause you get this error, because on_punch gives no itemstack -> https://github.com/minetest/minetest/bl ... .txt#L1737Evergreen wrote:Getting closer, but now I get an error when punching the cauldron with the bucket.Code: Select all
12:13:01: ERROR[main]: ServerError: LuaError: error: ...rett/Desktop/Minetest/bin/../mods/thaumtest/init.lua:43: attempt to index local 'itemstack' (a nil value) 12:13:01: ERROR[main]: stack traceback:
you have to change it to thisCode: Select all
on_punch = function(pos, node, puncher) if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then minetest.env:set_node(pos, {name="thaumtest:cauldron_full"}) end end,
watEvergreen wrote:minetest.env:replace({item="bucket:bucket_empty"})
Edit:
just do:
Code: Select all
local inv = puncher:get_inventory()
inv:remove_item("main", itemstack)
itemstack = ItemStack("bucket:bucket_empty")
inv:add_item("main", itemstack)
player:set_wielded_item(itemstack)
Scratch that, I missed the earlier post about the bucket mod not calling on_rightclick.
Last edited by kaeza on Sat May 25, 2013 17:19, edited 1 time in total.
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
Check out my stuff! | Donations greatly appreciated! PayPal
Just set the wieleded item :Evergreen wrote:I have a problem. I tried to do this:Code: Select all
on_punch = function(pos, node, puncher) if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then minetest.env:set_node(pos, {name="thaumtest:cauldron_full"}) minetest.env:replace({item="bucket:bucket_empty"}) end end,
Code: Select all
on_punch = function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "bucket:bucket_water" then
minetest.env:set_node(pos, {name="thaumtest:cauldron_full"})
puncher:set_wielded_item({name="bucket:bucket_empty"})
end
end,
Edit:
Nope. he changed after the suggestion of Casimirkaeza wrote: he was using on_rightclick, not on_punch.
Last edited by BlockMen on Sat May 25, 2013 17:31, edited 1 time in total.
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
- Evergreen
- Member
- Posts: 2135
- Joined: Sun Jan 06, 2013 01:22
- GitHub: 4Evergreen4
- IRC: EvergreenTree
- In-game: Evergreen
- Location: A forest in the midwest
- Contact:
I am running in to a problem. I want to do the same thing as I did before, except it empties the cauldron into the bucket this time. My problem is that you can't punch anything with an empty bucket. The reason you can't punch anything, is that the only thing you can punch with an empty bucket is water. Since I am using "on_punch" to detect when to take the water out of the cauldron, it doesn't work. Can anyone suggest a workaround for this?
Back from the dead!
-
- New member
- Posts: 6
- Joined: Sat May 25, 2013 05:42
Do you use stable 0.4.6? --> http://forum.minetest.net/viewtopic.php ... 510#p88510SilverFlame wrote:I need help installing mods..i tried several times and it didnt work. is there a specific way of doing it instead of just downloading and temoving it from the file?
If you use the latest github version(s) --> http://forum.minetest.net/viewtopic.php ... 221#p91221
--> don't forget to 'activate' them with configure
Some other "Usual suspects" for mods (still) not working:
- A folder needs to be renamed to the (low-case) name, used in the init.lua.
Example: VanessaE-homedecor-e5c99a3 --> rename --> homedecor
- Trying to use an older mod version or a not up to date mod version
- Use of an older version of minetest than the latest, unofficial
- Missing dependencies (look in the 1st post of a mod or check the depends.txt file in the mod folder you installed)
- Bugs in a mod
Who is online
Users browsing this forum: No registered users and 10 guests