Time Nick Message 00:02 MTDiscord Is there another option for making nodeboxes easily? I find nodeboxeditor extremely wersome :P 00:05 erlehmann MisterE, maybe you want to try the voxelmodel mod instead? 00:06 MTDiscord looking... 00:06 erlehmann MisterE https://www.google.com/url?q=https://content.minetest.net/packages/Noodlemire/voxelmodel/&sa=U&ved=2ahUKEwjv99W8hZT0AhVJyaQKHcALA_gQFnoECAUQAg&usg=AOvVaw072V3PRzqWq0TZghxuQJbk 00:06 erlehmann oh 00:06 erlehmann https://content.minetest.net/packages/Noodlemire/voxelmodel/ 00:06 MTDiscord Oh notthat 00:06 erlehmann i think it is supercool 00:06 erlehmann oh ok 00:06 MTDiscord I want nodeboxes 00:06 MTDiscord It is supercool 00:07 erlehmann arguably it fulfils the same purpose as nodeboxes, i.e. look at the bookshelf? 00:07 MTDiscord But I need nodeboxes for nodes that are for mapgen 00:07 MTDiscord So they don't lag clients 00:07 erlehmann oh yeah obv 00:07 erlehmann sorry then 00:09 MTDiscord I wish someone would use that and dynamic media to make it so players can make their own 'nodes' in-game without a server restart, tho it would actually be an airlike node with an entntiy 00:22 MTDiscord I saw a post from 2014 where rubenwardy said that nodeboxes are converted into meshnodes at loadtime. Is this still true? 00:22 erlehmann MisterE oh wow that is possible maybe? 00:22 MTDiscord Such that they don't offer an advantage 07:56 definitelya I have never heard of a dev suggesting not using the verbose debug option. So much to learn, heh. 10:47 independent56 If i have a lua pipe, does the item stay inside until "return;" is called, or does it go randomly if the "return;" call takes too long to come? 11:09 independent56 https://developer.roblox.com/en-us/api-reference/lua-docs/table Does this function exist in luaconrollers? 11:35 MTDiscord no and for very limited environment like lua controller that most probably wont be very useful 11:36 MTDiscord well, of course you can add it but other than that no 11:37 MTDiscord oh well, actually sorry. misread a bit. tables exists and some of functions do too but not all listed on roblox docs. 11:39 MTDiscord and for lua tubes if you do not return it will timeout and becomes like normal tube for that item, same if you wont return valid value. 11:40 MTDiscord item will pass no matter what 11:51 independent56 Ahh, makes sense 11:52 independent56 I was asking if "if (table.find(items.[event.channel], event.message) != false) then" speicifically would work for my shopping district. Otherwisei willhave to implementit myself, like some scheme programmer. 11:52 MTDiscord Regarding making models in Minetest: I'm working on an in-game texture painter. It's fully functional already. 11:53 MTDiscord independent56: (1) please don't put parens around the if-clause (unless you intend to omit the spaces) and (2) we only have table.indexof which returns -1 if the element was not found 11:54 independent56 So if i did "table.indexof" instead of "table.find", would this work? 11:54 MTDiscord (3) if you're using modlib, you could do if modlib.table.find(...) then ... end 11:55 MTDiscord No it would not work. You'd have to compare differently. 11:55 independent56 Ahh, thanks 11:55 MTDiscord ~= -1 11:57 independent56 i have "table.indexof(items, event.itemstring) != nil". Will "not (table.find(items, event.itemstring) ~= nil)" work? 11:57 independent56 * ~= -1, sorry 12:01 MTDiscord what 12:01 MTDiscord not (x ~= y) is the same as x == y 12:01 MTDiscord where did table.find come from BTW? 12:03 independent56 "find string in table lua" in ddg 12:03 independent56 https://developer.roblox.com/en-us/api-reference/lua-docs/table 12:03 independent56 Specifically Roblox docs 12:04 independent56 And i'm confused by "not (x ~= y) is the same as x == y". Do you mean ~= and == are the same? 12:04 independent56 or ... , it is the same as .... 12:05 calcul0n__ it means "not different" is the same as "equal to" 12:06 MTDiscord https://www.lua.org/manual/5.1/manual.html#5.5 and minetest adds function table.indexof(list, val) function table.copy(t, seen) function table.insert_all(t, other) function table.key_value_swap(t) function table.shuffle(t, from, to, random) 12:08 MTDiscord But Lua controller has restricted environment and filters out everything but: table.concat, table.insert, table.maxn, table.remove, table.sort 12:09 MTDiscord See https://github.com/minetest-mods/mesecons/blob/master/mesecons_luacontroller/init.lua#L477-L543 12:09 independent56 Do i have to use a for loop? can someone pastebin a working example? 12:13 MTDiscord Maybe these can help, implementation for mintetest table extensions: https://github.com/minetest/minetest/blob/master/builtin/common/misc_helpers.lua#L196 12:14 MTDiscord (others mentioned are there too, just search that source file) 12:15 independent56 Thanks 12:15 MTDiscord But yes, with lua controllers and lua tubes you have to implement most stuff yourself as those work in very limited environment 12:16 independent56 Feels like scheme 12:16 independent56 I remember SCIP talking about implementin square roots 12:17 independent56 It was as if scheme was pseudocode specifically designed for SCIP 12:18 independent56 So about the if statmenet... will " if table.indexof(items.[event.channel], event.message) != false then" step into the statment if the item is found? 12:18 independent56 * != -1 12:19 independent56 Actually, let me strip it down: "if table.indexof(items, "default:wood") != false then" return true if wood is found? 12:21 MTDiscord Like Luatic stated for Lua != should be ~=. And indexOf returns number unless you changed implementation. 12:25 MTDiscord Basically not equals true ~= false and equals true == true and for indexOf indexOf(t, "somthing") ~= -1 means that "something" is there because indexOf return value does not equal to -1 12:25 independent56 Ah, so != == ~=, and ~= != ==. 12:26 MTDiscord Yes, there's no != operator in Lua at all. Well there is but syntax for Lua is ~= 12:27 independent56 Makes sense, just like lua begins indexing arrays from 1 or whatever 12:29 independent56 Can i search subtables using table.indexof(table.["woodShop"], "default:wood")? I'll show you my table: https://pastebin.com/9LFxNFTf 12:30 MTDiscord If you make indexOf recursive but not directly with minetest implementation as it is not recursive 12:30 independent56 i'm confused. How do i find items in subtables? 12:32 calcul0n__ a subtable is just a table so what you wrote seemscorrect 12:32 MTDiscord function search(value) for key, value in pairs(roottable) do if table.indexof(value) ~= -1 then return key end end end will return table name where your item is 12:33 MTDiscord local tablenameforitem = search("default:wood") 12:35 MTDiscord or you can implement recursive search for generic use if needed, thing I wrote there works for your pastebin data but is not generic 12:35 MTDiscord also only after you correct typos :p 12:51 independent56 Who's typos 12:52 independent56 Mine or yours :p? 12:57 independent56 Here is the code http://56i.duckdns.org/dokuwiki/doku.php/human_areas/ssd#code 12:57 independent56 Up on the wiki 13:23 independent56 I'll take that as a "no, no errors" 14:03 independent56 Should i really trust a lua tutorial when the do comments like "--[ --]"? 14:04 independent56 Heck, it even highlights the syntax when it uses -- to begin a comment 14:04 independent56 https://www.tutorialspoint.com/lua/if_else_statement_in_lua.htm 14:27 MTDiscord You shouldn't trust this Lua tutorial, independent56 14:28 MTDiscord I consider --[[ --]] to be horrible style 14:28 MTDiscord but that's not why you shouldn't trust it 14:28 MTDiscord "which executes when the Boolean expression is false" 14:28 MTDiscord Sounds like someone blindly copypasted from a statically typed programming language tutorial 14:29 MTDiscord It should read "which executes when the condition evaluates to something falsey (nil or false)" 14:30 MTDiscord also parentheses, ugh 14:31 MTDiscord --[ --] for single line comments? WTH? to they even know the syntax!? 14:31 MTDiscord do* 14:34 MTDiscord --[[ --]] is usually recommended for outcommenting code, as it allows you to quickly change the multiline comment to two single line ones by deleting the [[; but outcommenting code is considered bad practice too 14:37 appguru independent56: I've had a look and the Tutorialspoint Lua tutorial seems to be rather low quality overall. I'd advise against using it. 15:18 MTDiscord tutorialspoint's is almost always low qualit y no matter what subject it teaches 15:36 independent56 How does minetest singleplayer work? does it do "minetest --server" secretly, and when you connect, it's actually 127.0.0.1? 15:38 independent56 tutorialspoint has poor grammar, bad practice, and is generally cheap and shabby. 15:40 independent56 I always use the offical docs... except in JS where i think MDN is offical but it may just be third party. And then i use Zeal to read them. 15:42 independent56 Imagine being taugh Lua from someone who dosen't even know how to comment XD 15:43 independent56 I mean, tutorialspoint is great for learning.... a crazed, nonsense version of the language in question 15:44 independent56 I've had to debug their code when using it 15:49 MTDiscord "a crazed, nonsense version of the language in question" - precisely, they seem to only partially understand the syntax or good practice 15:55 independent56 With minimal editing, my code works! 15:55 independent56 But the slave tube has broken 15:56 independent56 Is there a debugger so i can see real value in luacontroller and luapipes? 15:58 MTDiscord starts laughing frantically 15:59 MTDiscord a debugger.. in Minetest!? muahaha 15:59 MTDiscord stuff is debugged using print statements here 16:00 independent56 Dammit, thank you so much google AppScript for setting such a hig standard (i use it for JS code at school because it isn't blocked) 16:01 independent56 https://imgur.com/a/uCIffWK Here is what my files look like 16:04 calcul0n__ in singleplayer the print function will output text in the log 16:04 calcul0n__ or you can use a digiline screen to print stuff in game 16:08 erlehmann haha, the fire bug that cora found in mineclonia is in minetest game and prob everything that copies fire from it 16:08 erlehmann i.e. we finally know why fire == lag 16:09 independent56 Yay! 16:10 specing erlehmann: is this about fire spread or fire itself? 16:10 erlehmann specing, fire sound https://github.com/minetest/minetest_game/blob/5875820542c739ff223a8a6ef8a3e698685b6405/mods/fire/init.lua#L170 16:11 erlehmann i retract my state ment 16:11 erlehmann we know why fire == crashy crashy at the boundaries 16:12 erlehmann i once again want to remind everyone that the ideal situation is that minetest.find_nodes_in_area() stops working at exactly S16_MIN+1 and S16_MAX-1 16:32 independent56 Does mientest order mapblocks in term of use? i have had slow waiting times at desolate locations, but other places load in a flash. Do the moreused mablock stay closer to Minetest's hands? 16:33 MTDiscord Who knows... there's Minetest's mapblock cache, which is simply time-based AFAIK. Your database will maintain it's own cache, so does the OS, and also some hardware... you are most likely profiting off some kind of caching, but it's hard to tell which cache it is ;) 16:40 independent56 Hmm, intresting 16:40 independent56 Maybe i'm moving at 100 n/s in desolate places, but at 7 n/s in popualted places 16:44 MTDiscord well, mapgen is expensive 16:49 independent56 ahaha 16:50 independent56 Oh wait, i thought you meant economically, but you meant serverly 16:50 erlehmann luatic do you think my argument here is understandable? https://github.com/minetest/minetest/pull/11770#discussion_r748741740 16:50 independent56 *not severely, server-ly 16:50 erlehmann i have the feeling no one get this part: “choosing 31000 seems logical, but will likely lead to further bugs in exactly the space between ±31000 and the boundaries of s16. I want to eliminate that whole category of bugs by making that space as small as possible and putting it as far as possible from legit mapgen activity.” 16:53 erlehmann sfan5 btw, fearing that well intentioned devs would think “ah, i'll just MAX_MAP_GENERATION_LIMIT” is the reason why i did not report a bunch of non-crashy boundary condition bugs before. 16:54 erlehmann and i now think i was right and i should probably not have made that bug report but just let minetest fall on its face and fixed it in lua. 17:25 independent56 Is through-slab lighting a bug or feature? i hope it is a feature otherwise my hueg service layer will be so dark 17:33 definitelya think I found it #3554 17:33 ShadowBot https://github.com/minetest/minetest/issues/3554 -- Mesh and nodebox nodes can not block light. 17:41 erlehmann independent56 it is a feature, not-full-blocks do not block light 17:41 erlehmann right? 17:41 independent56 oh yeah! if it was aligned to the light, not blocking it, it shouldnt block light 17:41 independent56 https://imgur.com/a/6EdwXVg floor lighting 17:54 MTDiscord independent56: you asked for debugger, disclaimer: I've written said mod. There's metatool which has lua tool item. That can copy/paste lua controller, lua tube, digistuff memory chips code and memory. It allows dumping memory contents, some used it for debugging by writing log to like table.insert(mem.log, "hello world") 17:54 independent56 hmm 17:55 MTDiscord https://github.com/S-S-X/metatool I think ContentDB version does not have memory dumping yet... 17:59 MTDiscord Build factory programming lua controllers using node breaker and lua tool :p 18:20 MTDiscord Looking at your inventory I see pipeworks stuff... some said that Tube tool (in metatool modpack) has been useful, it basically clones tube configurations like sorting tubes, teleport tubes etc. and can also list and give waypoints to teleport tubes on selected channel. But maybe I should stop advertising even while it was somewhat related... 18:21 independent56 hmm 18:21 independent56 I was just building an interconnected network 18:21 independent56 Using digiline pipes instead of wires 18:22 independent56 Still supplies the controllers the same 18:36 independent56 Give me an itemstring from metatool 18:36 independent56 anything will do 18:39 independent56 Yay it works; reject my last request 21:04 independent56 Oh my god i don't get whats wrong with my code 21:05 independent56 Probably the digilines mingling is breaking things. I'll try in a pure reproduction 21:06 independent56 Am i allowed to swear here? 21:09 independent56 Oh god! i forgot to quote the return values in the pipes! 21:10 independent56 i was doign "return green" instead of "return "green"" 21:10 independent56 Thanks, minimal testing environment! 21:11 independent56 Wait... when i reconnect digilines, it dosen't do the digiline message thing? what the hell? 21:12 independent56 https://pastebin.com/24i1fbXx Are there any real errors in my code,except indentation? 21:13 independent56 It goes down Black instead of red, even with the luacontroller 21:13 Hawk777 Sure, “if event.type == "digiline" then” will never fire because it’s inside “if event.type == "item"”, and event.type can’t be both "item" and "digiline" simultaneously. 21:14 calcul0n__ yep, ends seem misplaced 21:14 independent56 Oh, thanks 21:14 calcul0n__ plus indentation errors *are* real errors :) 21:15 independent56 Errors to a human parser or computer parser :p 21:15 calcul0n__ well this error would be obvious with correct indentation 21:15 independent56 I mean, i wanted to check for digiline after the item has been detected 21:16 independent56 https://pastebin.com/JgwjKRMT fine now? 21:16 independent56 It still won't send even when digiline is ok. 21:17 Hawk777 If you’re trying to do a before/after thing, that won’t work. The code runs from top to bottom for each event. It doesn’t stop in the middle. 21:17 Hawk777 You’d need to remember somewhere (probably in the mem table) what happened before and check that on subsequent events. 21:18 Hawk777 AFAICT this code *should* send an “item” message every time an item passes through, and send all items in the black direction (because it returns black on an item event because an item event is not a digiline event, and it returns red on a digiline event but a digiline event isn’t an item event so the return value is ignored). 21:18 independent56 I'm getting a metophorical headache 21:19 independent56 How do i send a message down digiline, then when the device at the end sends a message through to the pipe, send the item down red, but if the device at the end does not send digiline, send item through to black? 21:20 independent56 https://imgur.com/a/MmgoXAh This is my setup 21:21 independent56 if event.type == "digiline" then 21:21 independent56 digiline_send("item","") 21:21 independent56 end is inside the controller 21:22 Hawk777 You can’t do that, because item routing is decided instantly. By the time the device at the other end of the digiline replies, the item *has already been routed*. It’s too late. If you have fixed routing decisions, you could make the remote device send the routing decision earlier and the tube remember it. If you need to decide based on item type, you can either put the intelligence in the routing tube itself (e.g. give it a ro 21:22 Hawk777 g table of items and where to send them, potentially in what quantities, rather than only remembering one direction), or else have an earlier tube send a report of the approaching item to the remote system, giving it time to instruct the routing tube what to do with it before the item arrives. 21:22 independent56 Oh, makes sense. 21:22 independent56 Thanks 21:22 independent56 I need to rethink my setup 21:27 independent56 https://pastebin.com/13Lzaw1m Still send items down the red pipe only 21:28 calcul0n__ is there really an event.itemstring? i use event.item.name 21:28 independent56 Oh wait, that function no longer exists? 21:29 independent56 https://pastebin.com/13Lzaw1m It says in the docs 21:30 calcul0n__ i don't know but i've never seen that 21:30 calcul0n__ maybe some outdated doc? 21:30 independent56 I can't belive it's in the offical wiki 21:31 Hawk777 Doesn’t the later controller need to not just return the message, but remember it and return the value later when the “item” event appears? As written, the later controller only returns a string on a “digiline” message; AFAIK Lua controlled tubes don’t have “sticky” routing, that is, they don’t remember previous return values, you have to return the direction you want on the item event itself. 21:32 independent56 Even a "if event.type == "item" then return event.message end" won't work. Is the event table overwritten? 21:32 Hawk777 Yes, each time the code runs, the event table pertains to the specific event being handled. The previous event is gone. 21:32 Hawk777 So when you’re handling an item event, the old digiline event is gone. 21:33 independent56 https://pastebin.com/nLyUwxzt 21:33 independent56 Still all reds 21:34 independent56 https://imgur.com/a/3pcVUHv 21:34 Hawk777 OK, not sure what the problem is at this point, but other than names or that sort of thing, that’s what I would expect to work. 21:35 independent56 Could you recreate it on your machine to make sure this problem isn't part of my server? 21:35 calcul0n__ remember the whole code is executed for each event 21:35 independent56 I don't think pipeworks is up to date on my server 21:35 independent56 I'll update it. 21:36 calcul0n__ in your last example both cases event.type == "item" will run 21:37 Hawk777 I assume the comments delimit two separate code blocks installed on two separate tubes. 21:37 calcul0n__ ho, makes sense 21:37 independent56 Yes, that's what they do 21:39 calcul0n__ a debug screen could help imo :) 21:39 independent56 Updated pipeworks and now i'm not coding in multispace, only monospace 21:39 independent56 And... it works exactly like it's not supposed to 21:41 independent56 The first luacontroller works fine 21:42 independent56 Arghh 21:42 independent56 Fucking digilines 21:45 independent56 "warning: message was too comlex or contained invalid data" 21:46 independent56 But thats when i send it on digiline 21:46 independent56 damn you 21:47 calcul0n__ most of the times i get this when message is nil 21:47 independent56 Ahh, makes sense 21:47 calcul0n__ "too complex" makes it counter intuitive :) 21:48 independent56 OHHH! "event.message", instead of "event.msg" 21:48 calcul0n__ ho lol, i missed that 21:50 independent56 https://pastebin.com/kXJidv0A 21:50 independent56 Here is the updated code 21:50 Hawk777 Looks like you stopped using “mem.” which I believe you still need. 21:51 calcul0n__ yep 21:52 independent56 Programming is a chore and not a hobby 21:52 independent56 Yes. it works now. I can sleep now. 21:53 independent56 But only aftertaking to my laptop and server with a hammer 21:56 MTDiscord The words of every minecraft modder when MC gets an update 21:58 independent56 Thanks for your contribution to this chat, adding humor to an otherwise angry conversation 21:59 MTDiscord Yo welcome bruh