Sires wrote:Well I searched a bit in the minetest forum, used some advanced search thingy and Ctrl+F ed some pages of modding questions, and I really don't want to check 159 pages, so my question is: How to delete an specific metadata. Something like, the metadata is:
a = false
b = true
c = "sth"
d = 1
So, lets supposed I want to delete the 'd', is there other way to delete it without doing some stuff using to_table and from_table methods ?
Gerald wrote:Sires wrote:Well I searched a bit in the minetest forum, used some advanced search thingy and Ctrl+F ed some pages of modding questions, and I really don't want to check 159 pages, so my question is: How to delete an specific metadata. Something like, the metadata is:
a = false
b = true
c = "sth"
d = 1
So, lets supposed I want to delete the 'd', is there other way to delete it without doing some stuff using to_table and from_table methods ?
I think meta:set_string("d", nil) works.
Sires wrote:Gerald wrote:I think meta:set_string("d", nil) works.
Nope, I tested it, it just sets the data to nil, but the data key still exists in the metadata
Gerald wrote:If I read the result of minetest.serialize(meta:to_table()) the key is gone.
What is the problem of a dummy value anyway?
Nyarg wrote:Gerald wrote:If I read the result of minetest.serialize(meta:to_table()) the key is gone.
What is the problem of a dummy value anyway?
I think a meta isn't properly table or isn't accessible by native Lua garbage collector.
orwell wrote:you don't need cjson, minetest already has a JSON interface built in.
minetest.json_encode() / minetest.json_decode()
You just need to change all occurences of cjson calls to the minetest ones.
The same applies for HTTP
minetest.register_on_newplayer(function(player)
player:setpos({x=2298.2, y=105, z=2185.4})
return true
end)
player:setpos({x=2298.2, y=105, z=2185.4})
player:setpos({x=229.82, y=10.5, z=218.54})
Lone_Wolf wrote:I'm making a mod that has admin armor from stu's mod. The only change is the textures which are black.
I know 0.05% lua. This is my first problem: [Censored]/Desktop\MT\minetest\bin\..\mods\adminarmor\init.lua: No such file or directory
2017-06-19 11:59:01: ERROR[Main]: Check debug.txt for details.
minetest.register_node("adminarmor:blackhelmet", {
description = "Black Admin Helmet",
tiles = {"adminarmor_black_helmet"},
local S = function(s) return s end
if minetest.global_exists("intllib") then
S = intllib.Getter()
end
Users browsing this forum: No registered users and 2 guests