oil_VISC = 1
minetest.register_node("dystopia:rohoel_source", {
tiles = {"rohoel_source.png"},
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = "source",
groups = {water=3, liquid=3, flammable=3},
})
minetest.register_node("dystopia:rohoel_flowing", {
tiles = {"rohoel_source.png"},
paramtype = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = "flowing",
groups = {water=3, liquid=3, flammable=10},
})
Merlin wrote:Can someone tell me how to make the stuff spread/flow?
drawtype = "flowingliquid",
liquid_alternative_flowing = "dystopia:rohoel_flowing",
liquid_alternative_source = "dystopia:rohoel_source",
minetest.register_node("mystreets:oil_flowing", {
description = "Flowing Oil",
inventory_image = minetest.inventorycube("mystreets_oil.png"),
drawtype = "flowingliquid",
tiles = {"mystreets_oil.png"},
special_tiles = {
{
image="mystreets_oil_flowing_animated.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
},
{
image="mystreets_oil_flowing_animated.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0}
},
},
alpha = 250,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "mystreets:oil_flowing",
liquid_alternative_source = "mystreets:oil_source",
liquid_viscosity = 3,
liquid_renewable = false,
liquid_range = 3,
post_effect_color = {a=250, r=0, g=0, b=0},
groups = {liquid=3, not_in_creative_inventory=1},
})
minetest.register_node("mystreets:oil_source", {
description = "Oil Source",
inventory_image = minetest.inventorycube("mystreets_oil.png"),
drawtype = "liquid",
light_source = 14,
tiles = {
{name="mystreets_oil_source_animated.png"}
},
special_tiles = {
{
name="mystreets_oil_source_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=4.0},
backface_culling = false,
}
},
alpha = 250,
paramtype = "light",
walkable = false,
pointable = true,
diggable = true,
buildable_to = true,
drop = "mystreets:oil",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "mystreets:oil_flowing",
liquid_alternative_source = "mystreets:oil_source",
liquid_viscosity = 3,
liquid_renewable = false,
liquid_range = 2,
damage_per_second = 1,
post_effect_color = {a=250, r=0, g=0, b=0},
groups = {liquid=3, crumbly=2, not_in_creative_inventory=1},
})
pandaro wrote:Hi all,
I want to change the size of the inventory of the player.
Is there a limit to the size of the inventory?
I can exceed 32 slot?
for example:
'list [current_player; main; 0.5; 10.5;]'
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
inv:set_size("main", 50)
end)
kaeza wrote:pandaro wrote:Hi all,
I want to change the size of the inventory of the player.
Is there a limit to the size of the inventory?
I can exceed 32 slot?
for example:
'list [current_player; main; 0.5; 10.5;]'
Yes, you need to set the size of the "main" list in the player's inventory. For example, from an `on_joinplayer` callback:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
inv:set_size("main", 50)
end)
minetest.register_chat_command("jump", {
params="Enter a value to increase jump height",
description="Speed: Modify the speed of the player",
func = function(name,param)
local player=minetest.get_player_by_name(name)
if not player then
return false, "Player not found"
end
player:set_physics_override(jump=param)
)
leeminer wrote:I can't believe I have to ask, *bangs head on desk* but here goes.
minetest.register_chat_command
Not working.
Code below, but one thing I struggle with is the parameter after the command. For example I want to enter the command like this "/jump 5". I want that command to set the set_physics_overide to jump value 5. However I don't see a variable in the register_chat_command for variables.Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_chat_command("jump", {
params="Enter a value to increase jump height",
description="Speed: Modify the speed of the player",
func = function(name,param)
local player=minetest.get_player_by_name(name)
if not player then
return false, "Player not found"
end
player:set_physics_override(jump=param)
)
/time is a good example where it takes a variable. I looked at the wiki and there doesn't seem to be an example for this scenario. When I get an answer can I add the example to the wiki or does someone else have to ?
leeminer wrote:Well, debug.txt has a new error.
Bad news is, its useless to me.
"06:58:34: ERROR[main]: ======= END OF ERROR FROM LUA ========
06:58:34: ERROR[main]: Server: Failed to load and run C:\Users\Elissa\Desktop\Lee\minetest-0.4.10\bin\..\mods\leemod\init.lua
06:58:34: ERROR[main]: ModError: ModError: Failed to load and run C:\Users\Elissa\Desktop\Lee\minetest-0.4.10\bin\..\mods\leemod\init.lua"
leeminer wrote:Well, debug.txt has a new error.
Bad news is, its useless to me.
"06:58:34: ERROR[main]: ======= END OF ERROR FROM LUA ========
06:58:34: ERROR[main]: Server: Failed to load and run C:\Users\Elissa\Desktop\Lee\minetest-0.4.10\bin\..\mods\leemod\init.lua
06:58:34: ERROR[main]: ModError: ModError: Failed to load and run C:\Users\Elissa\Desktop\Lee\minetest-0.4.10\bin\..\mods\leemod\init.lua"
xyz = "<X>,<Y>,<Z>"
minetest.register_alias("device", "quiet:console")
minetest.register_chatcommand("xyz", {
params = "<X>,<Y>,<Z>",
description = "set destination for console",
func = function(name, param)
xyz = params
minetest.chat_send_all(name.." sets the value to "..param)
end,
})
minetest.register_node("quiet:console", {
texture = "png.png"
on_punch = function(name, xyz)
local function find_free_position_near(xyz)
local tries = {
{x=1,y=0,z=0},
{x=-1,y=0,z=0},
{x=0,y=0,z=1},
{x=0,y=0,z=-1},
}
for _, d in ipairs(tries) do
local p = {x = pos.x+d.x, y = pos.y+d.y, z = pos.z+d.z}
local n = core.get_node_or_nil(p)
if n and n.name then
local def = core.registered_nodes[n.name]
if def and not def.walkable then
return p, true
end
end
end
return pos, false
end
end
})
DeepGaze wrote:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
xyz = "<X>,<Y>,<Z>"
...
func = function(name, param)
-> xyz = params
minetest.chat_send_all(name.." sets the value to "..param)
Krock wrote:DeepGaze wrote:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
xyz = "<X>,<Y>,<Z>"
...
func = function(name, param)
-> xyz = params
minetest.chat_send_all(name.." sets the value to "..param)
You set it to a nil value.
local PLAYER_COOLDOWN = 1
minetest.register_alias("device", "quiet:key")
minetest.register_chatcommand("xyz", {
params = "<X>,<Y>,<Z>",
description = "set xyzination for console",
func = function(name, param)
xyz = param
minetest.chat_send_all(name.." sets the value to "..param)
end,
})
minetest.register_tool("quiet:key", {
texture = "png.png",
tool_capabilities = {},
on_use = function(itemstack, user, pos, xyz)
local xyz = {param}
user:setpos(xyz)
end
})
minetest.register_chatcommand("sos", {
description = "save you from falling into nil",
func = function(pos, name)
name:setpos({x = 0, y = 0, z = 0})
end
})
local PLAYER_COOLDOWN = 1
minetest.register_alias("device", "quiet:key")
minetest.register_chatcommand("xyz", {
params = "<X>,<Y>,<Z>",
description = "set xyzination for console",
func = function(name, param)
xyz = param
minetest.chat_send_all(name.." sets the value to "..param)
end,
})
minetest.register_tool("quiet:key", {
texture = "png.png",
tool_capabilities = {},
on_use = function(itemstack, user, pos, xyz)
local xyz = {param}
user:setpos(xyz)
end
})
minetest.register_chatcommand("sos", {
description = "save you from falling into nil",
func = function(pos, name)
name:setpos({x = 0, y = 0, z = 0})
end
})
AMMOnym wrote:Hello there,
Each generating is made in "y line" which means height, so I have question. Is possible to make genereating in "x/z line" ?
1- Spawn point / 0
2- x=posx+200, z=posz+200
3- x=posx+400, z=posz+400
4- x=posx+600, z=posz+600
So someone can generate ores in distance 200 - 400 from spawn etc.
Hybrid Dog wrote:AMMOnym wrote:Hello there,
Each generating is made in "y line" which means height, so I have question. Is possible to make genereating in "x/z line" ?
1- Spawn point / 0
2- x=posx+200, z=posz+200
3- x=posx+400, z=posz+400
4- x=posx+600, z=posz+600
So someone can generate ores in distance 200 - 400 from spawn etc.
Of course, yes, you could also e.g. generate sea everywhere at math.hypot(x,z) > 1000.
AMMOnym wrote:Hybrid Dog wrote:AMMOnym wrote:Hello there,
Each generating is made in "y line" which means height, so I have question. Is possible to make genereating in "x/z line" ?
1- Spawn point / 0
2- x=posx+200, z=posz+200
3- x=posx+400, z=posz+400
4- x=posx+600, z=posz+600
So someone can generate ores in distance 200 - 400 from spawn etc.
Of course, yes, you could also e.g. generate sea everywhere at math.hypot(x,z) > 1000.
Thanks a lot, can you show me any mod, which use that ? It will help me a lot
minetest.register_chatcommand("/unmark", {
params = "",
description = "Hide markers if currently shown",
privs = {worldedit=true},
func = function(name, param)
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
worldedit.pos1[name] = nil
worldedit.pos2[name] = nil
worldedit.mark_pos1(name)
worldedit.mark_pos2(name)
worldedit.pos1[name] = pos1
worldedit.pos2[name] = pos2
worldedit.player_notify(name, "region unmarked")
end,
})
minetest.register_chatcommand("/pos1", {
params = "",
description = "Set WorldEdit region position 1 to the player's location",
privs = {worldedit=true},
func = function(name, param)
minetest.register_chatcommand("mvol", {
params = "<mvol>",
description = "set volume of music, default 1 normal volume.",
privs = {server=true},
func = function(name, param)
leeminer wrote:Still trying to understand register_chatcommand
Here are two examples from worldedit mod.minetest.register_chatcommand("/unmark", {
params = "",
description = "Hide markers if currently shown",
privs = {worldedit=true},
func = function(name, param)
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
worldedit.pos1[name] = nil
worldedit.pos2[name] = nil
worldedit.mark_pos1(name)
worldedit.mark_pos2(name)
worldedit.pos1[name] = pos1
worldedit.pos2[name] = pos2
worldedit.player_notify(name, "region unmarked")
end,
})
minetest.register_chatcommand("/pos1", {
params = "",
description = "Set WorldEdit region position 1 to the player's location",
privs = {worldedit=true},
func = function(name, param)
What I don't understand so far is why the functioins don't do anything. Seems like a half baked function definition...
Here is an example from the ambiance modYour phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_chatcommand("mvol", {
params = "<mvol>",
description = "set volume of music, default 1 normal volume.",
privs = {server=true},
func = function(name, param)
How does the command, actually change the volume? This is bugging me ;)
Users browsing this forum: No registered users and 16 guests