iangp wrote:@Hybrid Dog
it would be cool if this function uses "velocity" as a parameter ...
because this way there's no real reason for use that function... I can't see one...
When a player walks, you don't want them to suddenly disappear then reappear in a new place, you want the to slide across.
It's for interpolation, to minimise the appearence of lag.
if wieldname == (
"default:gold_lump" or
"currency:minegeld" or
"currency:minegeld_5" or
"currency:minegeld_10" or
"bitchange:minecoin" or
"bitchange:mineninth" or
"homedecor:coin" )
then
wielditem:take_item()
wieldname == (a or b or c)
if wieldname == "foo" or wieldname == "bar" or wieldname == "baz" or ...
local valid = {
["default:foo"] = true,
["default:bar"] = true,
-- ...
}
-- Then in your check
if valid[wieldname] then
print("I am doing something.")
end
Byakuren wrote:I want to write a spell that will dig a 3x3x3 area of nodes when used, and I want this to check protection and add entries to the rollback log, so it can be rolled-back if necessary. I could write a function that does everything other than the rollback, but I don't know if there is a way to add things to the rollback log this way. Is there? Or maybe there is a better way to do this.
Dragonop wrote:How you do get the number of items in a stack that is inside an inventory slot in a formspec to display in the infotext of a node?
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
meta:set_string("infotext", tostring(inv:get_stack("listname", index):get_count()))
OmniStudent wrote:Ah, I suppose I should have written "node" instead of object.
The purpose of the locked door is to prevent players from exiting or entering (new players) a dungeon until they've completed some sort of objective.
bark wrote:Would it be possible to create an NPC as a node, and not as an object?
The reason I would like to do this: I want to place talking NPC's that add a backstory to the world. You know, with interactive dialogue. I don't want to replace them everytime I run /clearobjects.
bark wrote:Would it be possible to create an NPC as a node, and not as an object?
The reason I would like to do this: I want to place talking NPC's that add a backstory to the world. You know, with interactive dialogue. I don't want to replace them everytime I run /clearobjects.
Hybrid Dog wrote:OmniStudent wrote:Ah, I suppose I should have written "node" instead of object.
The purpose of the locked door is to prevent players from exiting or entering (new players) a dungeon until they've completed some sort of objective.
You could set a locked steel door and then set its owner to some string which can't be a playername, e.g. "§singleplayer", and if you completed the objective, the steel door's owner is changed to your name.
The owner is stored in meta: https://github.com/HybridDog/minetest_g ... it.lua#L87
minetest.register_node("mud:mud", {
description = "Mud",
tiles = {"mud_v.1.png"},
groups = {crumbly=1,soil=3,oddly_breakable_by_hand=10},
})
swordpaint12 wrote:Hi guys,
I am learning to make mods and recently I created a simple mud mod. I was unable to create a crafting recipe which I wanted to be a water bucket and block of dirt shapeless. I don't remember what I wrote but I was following the outline found on rubenwardy's tutorial. Could someone show me what the proper recipe would look like?
minetest.register_node("mud:mud", {
description = "Mud",
tiles = {"mud_v.1.png"},
groups = {crumbly = 1, soil = 3, oddly_breakable_by_hand = 10}
})
minetest.register_craft({
type = "shapeless",
output = "mud:mud",
recipe = {"bucket:bucket_water", "default:dirt"},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
}
})
Dragonop wrote:Also, feel free to make suggestions about the mod.
isaiah658 wrote:I have a question about using minetest.after to call a function. Is it possible to use a variable time for minetest.after or does it have to be a static time? I wanted to try and use minetest.after vs a global step timer but I'm getting errors when using variables for the time. I wasn't sure if there was some way to make it see the variable as a number rather than a variable so it would work.
There's no reason you can't use a variable for the time argument. Mind posting your error (including stack trace) and the relevant mod code? (In a spoiler, or a paste site like lpaste.net)
groups = { favorite_color = "red" }
Users browsing this forum: No registered users and 41 guests