playzooki wrote:how do i add custom sounds?
derpswa99 wrote:Simple code to spawn a tree anyone?
playzooki wrote:Thanks!
EDIT: I still cant get it to work :s
playzooki wrote:i dunno, just plays normal sounds, not what was intended
super_tnt wrote:Ok I'm pretty new to the whole modding scene and so far it looks amazing. I want to create a mod like technic (I know it's a big thing for a newbie but I've always learnt like that) and I'm looking at inventory management. I've looked at the chest lua file and I can understand that formspec is like the GUI library, correct? But I can't get my head around this little bit for the location: list[current_name;main;0,0;8,4;]
What is "current_name", I've seen it used in the furnace also but I just don't know what it is so I can't play with it.
CraigyDavi wrote:If there a mod which can stop people from placing buckets?I still want to be able to pick up water and lava but not place it.
And then if people on the server want to place water or lava they can ask me and i will type /giveme water_source and place it where they want it.
If there a mod to disable placing of buckets, or a simple way to remove bits of code?
kaeza wrote:playzooki wrote:i dunno, just plays normal sounds, not what was intended
can you paste the relevant section of code?
function default.node_sound_rick_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="rickroll", gain=1.0}
table.dug = table.dug or
{name="rickroll", gain=1.0}
default.node_sound_defaults(table)
return table
end
minetest.register_node("rickroll:rickroll", {
description = "You just got Rickrolled!",
tiles = {"rickroll.png"},
is_ground_content = true,
groups = {hot=3, cracky=2},
drop = 'rickroll:rickroll',
legacy_mineral = true,
sounds = default.node_sound_rick_defaults(),
damage_per_second = 8*2,
})
It is pretty easy to make the formspec, but making it functional is another thing entirely. You would need to make an api for making potion recipes, and the potions themselves, as well as making the brewing actually work.Gambit wrote:I was wondering if anyone can give an understandable guide on creating a Brewing Screen. I had a plan to make a Cauldron mod with a brewing system that requires 4 items, 1 item is a bottle of water and the other 3 are various items as recipes.
This is the kind of screen I was hoping to build.
http://ubuntuone.com/28mwR0cKIFUlTX87iOOSN2
Also, I barely understand the lingo the lua guide tells me.
Evergreen wrote:It is pretty easy to make the formspec, but making it functional is another thing entirely. You would need to make an api for making potion recipes, and the potions themselves, as well as making the brewing actually work.Gambit wrote:I was wondering if anyone can give an understandable guide on creating a Brewing Screen. I had a plan to make a Cauldron mod with a brewing system that requires 4 items, 1 item is a bottle of water and the other 3 are various items as recipes.
This is the kind of screen I was hoping to build.
http://ubuntuone.com/28mwR0cKIFUlTX87iOOSN2
Also, I barely understand the lingo the lua guide tells me.
A good place to look for code is the code for the furnace. Brewing works in a very similar fashion, so it might be helpful.Gambit wrote:Evergreen wrote:It is pretty easy to make the formspec, but making it functional is another thing entirely. You would need to make an api for making potion recipes, and the potions themselves, as well as making the brewing actually work.Gambit wrote:I was wondering if anyone can give an understandable guide on creating a Brewing Screen. I had a plan to make a Cauldron mod with a brewing system that requires 4 items, 1 item is a bottle of water and the other 3 are various items as recipes.
This is the kind of screen I was hoping to build.
http://ubuntuone.com/28mwR0cKIFUlTX87iOOSN2
Also, I barely understand the lingo the lua guide tells me.
That's what I was worried about. Thanks for feedback though. Perhaps in a future build of Minetest when development needs a new challenge we might see something like this come along.
Evergreen wrote:A good place to look for code is the code for the furnace. Brewing works in a very similar fashion, so it might be helpful.Gambit wrote:Evergreen wrote:It is pretty easy to make the formspec, but making it functional is another thing entirely. You would need to make an api for making potion recipes, and the potions themselves, as well as making the brewing actually work.
That's what I was worried about. Thanks for feedback though. Perhaps in a future build of Minetest when development needs a new challenge we might see something like this come along.
Gambit wrote:Evergreen wrote:A good place to look for code is the code for the furnace. Brewing works in a very similar fashion, so it might be helpful.Gambit wrote:
That's what I was worried about. Thanks for feedback though. Perhaps in a future build of Minetest when development needs a new challenge we might see something like this come along.
Thanks, I'll try to breaking it down from there. I may not be able to make the brewing cauldron that I really want, but I have to start somewhere.
derpswa99 wrote:Easy way to animate tool textures while youre holding them in your hand and inventory? Perhaps a really short code of some kind? Will be highly appreciated.
PilzAdam wrote:derpswa99 wrote:Easy way to animate tool textures while youre holding them in your hand and inventory? Perhaps a really short code of some kind? Will be highly appreciated.
Not possible.
function minetest.get_connected_players()
-- This could be optimized a bit, but leave that for later
local list = {}
for _, obj in pairs(minetest.get_objects_inside_radius({x=0,y=0,z=0}, 1000000)) do
if obj:is_player() then
table.insert(list, obj)
end
end
return list
end
local player_list = {}
mintest.register_on_joinplayer( function( player_ref )
table.insert( player_list, player_ref )
end
minetest.register_on_leaveplayer( function( player_ref )
for index, value in pairs( player_list ) do
if player_ref:get_player_name() == value:get_player_name() then
table.remove( player_list, index )
end
end
end
function minetest.get_connected_players()
return player_list
end
local player_list = {}
minetest.register_on_joinplayer( function( player_ref )
table.insert( player_list, player_ref )
end)
minetest.register_on_leaveplayer( function( player_ref )
for index, value in pairs( player_list ) do
if player_ref:get_player_name() == value:get_player_name() then
table.remove( player_list, index )
end
end
end)
function minetest.get_connected_players()
return player_list
end
Casimir wrote:You had some typos but it works for me.
And when you consider a server with thousands of saplings on the ground the old method is ridiculous.
Users browsing this forum: No registered users and 5 guests