minetest.register_node("mymod:name_is_too_long", def)
minetest.register_alias("mymod:name_is_too_long", "nameistoolong")
/giveme nameistoolong
Added mymod:name_is_too_long to the inventory.
Kilarin wrote:I've got a fork of PilzAdam's cart mod that I want to publish as cartsplus. So I renamed everything from carts to cartsplus, and it works just fine. BUT, I'd like to make it so that when you include the cartsplus mod, all carts created under the old carts mod (carts:cart) become cartsplus carts (cartsplus:cartplus)
From some advice I thought that minetest.register_alias("name", "convert_to") would do this. so I put at the top of the cartsplus init.lua:
minetest.register_alias("carts:cart", "cartsplus:cartplus")
But... it does nothing. old carts in the game or your inventory still run the old carts code and do not stack with new carts. Creative inventory shows two types of carts. new carts work fine, but the old carts still work as old carts.
So, am I misunderstanding what register_alias is supposed to do, or am I just using it incorrectly? Or does it only work with nodes, not entities?
Thanks in advance for your help.
PIlzAdam wrote:Why don't you submit a pull request to my carts mod?
Kilarin wrote:PIlzAdam wrote:Why don't you submit a pull request to my carts mod?
Would LOVE to, I PM'd you about whether you were interested in the changes and didn't get a response, so I thought you weren't interested. I'll figure out how to do a pull and execute it today.
PilzAdam wrote:sorry for not seeing them.
PilzAdam wrote:I probably have time to review your code at the next weekend.
Topywo wrote:nodenames = "forcefield:switch_on",
Not sure if this is causing it not to work, but I place brackets (or however those are called) around the nodenames:
nodenames = {"forcefield:switch_on"},
Edit: Typo
local pos_found = minetest.find_node_near(pos, 1000, "forcefield:forcefield") --trying to replace this node
minetest.set_node(pos_found, {name="forcefield:forcefield_on"}) --with this one
Ackirb wrote:minetest.register_abm({
nodenames = "forcefield:switch_on",
interval = 1,
chance = 1,
action = function(pos, nodenames)
local obj = minetest.find_node_near(pos, 1000, "forcefield:forcefield") --trying to replace this node
minetest.set_node(obj, "forcefield:forcefield_on") --with this one
end
})
Daven wrote:Can someone please post a link to the worldedit mod? It would be really helpful. Thanks.
Also, can you help me with the mod for adding a hungerbar to the world?
paramat wrote:Ackirb wrote:minetest.register_abm({
nodenames = "forcefield:switch_on",
interval = 1,
chance = 1,
action = function(pos, nodenames)
local obj = minetest.find_node_near(pos, 1000, "forcefield:forcefield") --trying to replace this node
minetest.set_node(obj, "forcefield:forcefield_on") --with this one
end
})
If it works it might be slow with a radius of 1000, 'find node near' is very slow even with a small radius.
Ackirb wrote:Hmmm - good to know. Any other suggestions?
Kilarin wrote:Is there any way to trigger a function whenever an item is MOVED within inventory? That way I could check to see if the compass is in active inventory only when you move it, and turn off the globalstep if its not, and turn it back on if it is.
"dropdown[0,1.5;8;bookmark_list;"..list..";0]"..
"button[0,2.3;5,1;find_bookmark;find selected bookmark]"
"textlist[0,1.5;5,8;bookmark_list;"..list..";1]"..
"button[0,6.3;5,1;find_bookmark;find selected bookmark]"
if fields["find_bookmark"] then
compass.find_bookmark(name, fields["bookmark_list"])
end
Kilarin wrote:I changed my code a bit, and now textlist is NOT returning nil when you click a button, but it's passing back the value of the 1st element in the list even though a different element was selected. very strange.
paramat wrote:When i place light sources by voxelmanip their light level is correct but the light does not spread, is there a good way to update the lighting? I tried updating lighting using an ABM to remove then re'place' (not 'add') a light source, but that causes the node to drop down 1 node. I'm thinking of requesting 'update_lighting()' be added to the voxelmanip.
GaryLaw64 wrote:Linux does not want to let me see the files graphically likie windows.
GaryLaw64 wrote:Help!
Installing mods on ubuntu.
Linux issue rather than minetest I know.
wiki page is very clear for windows installation, and it all makes complete sense. Installed and activated a number of mods. Linux does not want to let me see the files graphically likie windows.
Can anyone help with the command lines in linux to move the folders I have downloaded and renamed to the right place.
Is there a linux pro out there? Cos I can find the minetest application but no other folders.
AAAAARRRRGGGGHHHHHH!
Linux noob, but getting there. Before someone asks, I refuse to run the game on my xp computer cos the graphics are waaaay better with my linux setup.
Users browsing this forum: No registered users and 10 guests