Time Nick Message 00:42 greeter don't you just love it when you're exploring your own server, and you're like "wait, who's been way out here?" 00:48 VanessaE heh 00:48 VanessaE sounds like me the other day 00:49 VanessaE I was following an electrical feed, reworking poles, before I knew it I was 3km east of the spawn :) 00:50 greeter nice. doesn't take long sometimes 00:52 greeter i was just exploring to look for a good spot to setup a pixel art area and i found random torches in the ocean. i'm a good kilometer and a half from spawn and it's a fairly new server 01:05 Emerald2 Hi greeter! 01:06 greeter greetings Emerald2. how are you? 01:07 Emerald2 Hey I'm doing well. Yourself? How's Ravenchat? 01:11 greeter i'm doing great thanks. so far so good lol :-) 01:27 greeter hmm looks like freenode has a few issues tonight :-S 01:28 Emerald2 We had some netsplits yesterday. 01:29 greeter ah i see 01:29 greeter all my irc servers reset yesterday because ramnode is patching that chip bug 01:33 greeter anyhow i best get going for the night. take care all 01:34 Emerald2 Sweet dreams greeter. :) 01:40 blaise I'm updating my kernel now also 01:41 blaise I can't seem to get windows 10 to get past that stupid fall creators update so I don't guess it will get the update any time soon... 01:41 blaise not that it matters anyway, the software patch doesn't really help much... 01:42 blaise microcode updates help a lot more but even that doesn't do much 01:57 Open_Future sofar around? 02:00 Emerald2 Might be having dinner. If he's around he heard you ping him. 02:05 Open_Future ok thanks 02:12 sofar indeed dinner time 02:12 sofar afk more 02:12 swift110-phone_ Hey sofar 02:23 nullawk How old is minetest? 02:23 blaise ehrm 02:23 blaise lets see 02:24 nullawk I did try and look, and saw Version History shows the first release (0.2.20110529) on may 29th 2011. but by that version number I would guess it to be older 02:25 blaise https://github.com/minetest/minetest/releases 02:25 nullawk jul 31st 2011 02:26 blaise yeah 02:26 blaise I think that may be the first official release to github 02:26 blaise but probably not the first official release? 02:27 rubenwardy it was publicly released nov 2010 02:27 rubenwardy on the IRrlicht forums 02:27 rubenwardy at least 02:27 rubenwardy may have been posted elsewhere prior 02:27 blaise yeah, that sounds a bit more on target 02:27 rubenwardy https://forum.minetest.net/viewtopic.php?f=3&t=19208 02:27 rubenwardy ^ relevant 02:28 nullawk https://web.archive.org/web/20111204014805/http://minetest.com:80/ first snap of the site by archive 02:28 rubenwardy minetest.com is not our site 02:28 rubenwardy we use minetest.net 02:29 nullawk "October 10, 2010 marked the time that Minetest was started," 02:29 rubenwardy that's the oldest version you can download, he probably started it before 02:31 nullawk it sounded like before that day it was laggy and not really a game 02:31 rubenwardy lol 02:31 rubenwardy yup 02:31 rubenwardy that's how game design works 02:31 rubenwardy you start crude and it hopefully gets better 02:31 rubenwardy oldest version of the actual website: https://web.archive.org/web/20120918234257/http://minetest.net:80/ 02:35 rubenwardy here;s an older version, from when it was on c55's website: https://web.archive.org/web/20111105232234/http://c55.me/minetest 02:45 est31 rubenwardy: didnt c55 post a very early version of minetest to his github 02:45 rubenwardy wasn't it on sourceforge first? 02:46 rubenwardy oh, you mean https://github.com/celeron55/minetest_nmpr 02:46 rubenwardy yeah, that's newer than 10/10/2010 though 02:46 est31 yeah 02:46 est31 ok 02:46 rubenwardy it's from 24/10/10 infact 02:49 rubenwardy first github commit is from 27/10/2010 02:50 rubenwardy lol 02:51 rubenwardy one of the first commits is "vokselijuttu lisätty" which translates to "Voxel was added" 02:51 rubenwardy apparently 02:51 est31 af95cfc7a15788386d055a5b4a7377673d36b8bf ? 02:52 rubenwardy yeah 03:07 Open_Future sofar was wondering if you got that map of canada yet? 03:07 swift110-phone_ Which map of canada 03:28 Open_Future sofar was going to export part of a minecraft map for me 03:28 Open_Future I'm a teacher and want to use minetest with my class...need a map of Canada (more or less) and sofar was working on exporting one from minecraft that used some real world data.... 03:29 erudition cool. I'm guessing there's an automated tool for that? 03:30 Open_Future its over my head, he volunteered to do it...which is great 03:31 erudition So it appears that in lua, require() is just a more efficient version of dofile(), in that it only runs the other script once, then caches the result. But when trying to split up my code, I got require() is disabled when mod security is on. Why is it that we're forced to use the less efficient dofile()? 03:31 erudition (open query for anyone that might know) 03:37 Cornelia I think require looks on the path 03:38 Cornelia Oh... 03:38 Cornelia erudition: require can load binary code 03:39 Cornelia dofile is restricted to Lua scripts 03:39 erudition can't we just block that part of it? 03:39 erudition I see 03:39 Cornelia require doesn't execute scripts, it loads a module 03:39 Cornelia And a module could even a script, but it could also be native code 03:39 Cornelia So to prevent mods from doing "very bad things" they can't use require 03:40 erudition even though it's only the native code that's bad 03:40 Cornelia Can't really block part of built-in Lua functionality without rewriting Lua :p 03:41 Cornelia It's easier to just stop the require call and only allow dofile and loadfile 03:41 Cornelia If you want the "load once" behaviour: 03:41 erudition seems like just checking the MIME type of called files would work 03:41 erudition but I guess not 03:41 erudition so how does one load a module? 03:41 Cornelia local my_file = loadfile("my_file.lua") ; my_file() 03:42 Cornelia I don't think we can load modules. We can run Lua scripts, though 03:42 erudition :( I just want to split up my code 03:42 Cornelia Put your pieces in their own files and use dofile :p 03:43 Cornelia Or loadfile 03:43 Cornelia I'm using dofile to load in tables that contain code I need 03:43 Cornelia Like I have a "settings.lua" that reads in Minetest settings and returns a table 03:43 Cornelia Well.. I will. :P 03:44 Cornelia I currently just have an empty file while I'm building the mod 03:44 erudition is that the same as if they were in the same file? 03:46 Cornelia Sorta 03:46 Cornelia You can, at the end of your extra script, return something 03:46 Cornelia I.e. return { ... } 03:47 Cornelia And when you do: local data = dofile("data.lua") 03:47 Cornelia That table will be in the data variable 03:47 Cornelia dofile executes the file as a chunk in the same space as the others.. so if you make globals they'll be visible.. 03:47 Cornelia But.. they'll be visible to ALL MODS 03:48 erudition well say I have a utility function, such as function say(msg) minetest.chat_send_all(msg) end 03:48 Cornelia Mmkay.. 03:48 erudition and I want all my utility functions in a separate file 03:48 Cornelia You should be using "local function" or it's global and visible to all mods 03:49 Cornelia I think... :P 03:49 erudition how can I call say(stuff) from init.lua 03:49 Cornelia One moment... 03:49 erudition without any extra periods haha 03:50 Cornelia https://github.com/CorneliaXaos/guidebooks/blob/master/api/init.lua 03:51 Cornelia In progress code.. so that stuff might not be 100% correct :p 03:51 Cornelia But look at "local implementation = ..." 03:51 Cornelia Then look at this: 03:52 Cornelia https://github.com/CorneliaXaos/guidebooks/blob/master/api/implementation.lua 03:52 erudition wouldn't that mean having to call implementation.say() 03:52 erudition ? 03:52 Cornelia Yes. 03:52 erudition which defeats the purpose of shortening the name lol 03:53 Cornelia But.. it lets you split your code up 03:53 Cornelia Instead of having it all in one giant init.lua 03:54 erudition yeah, but looks like I'll have to put my say() function at the bottom of every lua script 03:54 erudition if i want to use it for its purpose 03:54 Cornelia Why.... 03:54 Cornelia You could put it in a "chat_functions.lua" 03:54 erudition again, that defeats the purpose 03:54 Cornelia And dofile it into a local chat variable 03:55 erudition did you see what the function did? 03:55 Cornelia Then call chat.say where needed. 03:55 erudition It's just to shorten minetest.chat_send_all(msg) to a concise say() 03:55 erudition since I'm using it often 03:55 Cornelia Oh.. 03:55 Cornelia Then.. 03:56 Cornelia local say = minetest.chat_send_all 03:56 Cornelia But that would have to go in every file 03:56 erudition like in Java, i dont want System.out.println() 03:56 Cornelia Personally, I'm against shortening the built-in functions 03:56 erudition so i make a method called say() 03:56 Cornelia "built-in" 03:56 erudition or "print" 03:56 Cornelia Ewww.. (sorry) 03:56 Cornelia That just spaghettis the code 03:57 erudition what? you prefer System.out.println()? 03:57 Cornelia It's fine if you could potentially have different ways of saying things 03:57 Cornelia I would just use the full call, yes. 03:57 erudition you're the first i know of 03:57 Cornelia Like sometimes say calls the Minetest function, and others it prints a log or something. 03:57 erudition "print" is such a basic thing, ya know? 03:57 Cornelia Lua has a print 03:58 Cornelia It'll go to the log file, though. 03:58 erudition right - and it's nothing but "print" 03:58 erudition which is beautiful 03:58 erudition that's all I want :) 03:58 Cornelia Yea, Well.. Lia is a hyper-small interpreted language. 03:58 Cornelia Java has a massive standard library 03:58 Cornelia *lua 03:58 erudition javascript then 03:59 erudition BASIC 03:59 Cornelia Again.. 03:59 Cornelia Probably writes to the log 03:59 Cornelia Or the console 03:59 Cornelia Saying something to players isn't "basic" 03:59 erudition when it comes to this domain... 03:59 Cornelia It has to do a bunch of networking to get it across 04:00 erudition it's *the* most basic 04:00 erudition sure, but that's not exposed to us 04:00 Cornelia And to organize namespaces appropriately, Minetest functions are put into a Minetest global table 04:00 erudition "print" isn't basic either then haha 04:01 Cornelia Well.. why don't you do this: 04:01 erudition yeah, that's fine 04:01 Cornelia local print = minetest.chat_send_all 04:01 erudition maybe I could do say = otherfile.say 04:01 erudition ah 04:01 erudition same thing 04:01 Cornelia You could even... 04:01 erudition since functions are first class values 04:02 Cornelia --[[ start of mod init.lua ]] say = minetest.chat_send_all ; ... bunch of Lua code and calls to dofile ... ; say = nil -- end of init.lua 04:03 Cornelia Since say is global, dofile will see it 04:03 Cornelia Even safer is to add a "local old_say = say" and set say to old_say at the end 04:03 erudition that's perfect 04:04 Cornelia As long as you didn't call any mod which needed old_say you'd be fine 04:04 erudition although what's unsafe about say()? 04:04 Cornelia But I find that to be a hack. 04:04 erudition it's just an alias for a command that every other mod can use anyway 04:04 erudition why set it to nil? 04:04 Cornelia 1) pollutes globals table, 2) what if there's a mod called "say" 04:04 Cornelia Setting to nil clears the value 04:04 Cornelia Do the old_say isntead 04:05 Cornelia *instead 04:05 erudition well it doesn't pollute anything if it's local 04:05 erudition oh, then dofile can't see it, hmm 04:05 Cornelia local old_say = say ; say = minetest.chat_send_all ; ... ; say = old_say 04:05 Cornelia The point -- yea 04:06 erudition haha set the other mod to old_say 04:06 erudition nice 04:06 Cornelia Making it global makes it so you wouldn't have to redefine it in every chunk. 04:06 Cornelia Hmm.. 04:06 erudition would that really be a conflict with a mod? isn't a mod more than just a function 04:06 Cornelia I wonder if it's still work with local say (the dofile's I mean) 04:07 erudition i.e., a mod called "say" doesn't mean that say() is a thing, does it? 04:07 Cornelia The PIL book says dofile compiles the script file as a chunk and executes it in the current context... I think.. 04:07 Cornelia Most mods make a global table that is called the mod's name 04:08 Cornelia It might not, but it could. 04:08 erudition damn 04:08 erudition who knew it was so complicated just to make an alias 04:09 erudition alright, so dofile isn't working anyway xD 04:09 Cornelia Of you have access to a Lua interpreter test things: 04:09 erudition yeah i can try accessing it from a dofile 04:09 Cornelia --[[ inside test.lua ]] local say = print ; dofile("other.lua") 04:10 Cornelia --[[ inside other.lua ]] say("something") 04:10 Cornelia It either works or you get an error. 04:10 Cornelia > lua test.lua 04:10 Cornelia See what happens. 04:10 Cornelia I'm on my phone and can't. :P 04:11 erudition dofile isn't working anyway 04:11 Cornelia :/ 04:11 erudition says it can't find the file 04:11 Cornelia What do you mean? 04:11 Cornelia I dunno why... 04:11 Lord_Buckethead !tell Open_Future at what scale are you trying to get the map anyways? 04:11 MinetestBot Lord_Buckethead: yeah, yeah 04:11 erudition the path is correct 04:12 Cornelia Either files aren't in the right place or the path isn't set up properly 04:12 Cornelia What OS? 04:12 erudition Well I'm on gnu/linux but i'm remotely editing with my friend on a windows PC 04:13 Cornelia Wow. :P 04:13 erudition the only thing that's not kosher is the slashes 04:13 Cornelia Testing on Linux? 04:13 Cornelia Try running the test from Linux. 04:13 erudition no I'm full time gnu/linux 04:13 erudition I guess I will later when I can get the files over here 04:13 Cornelia I mean the test scripts I gave above. :P 04:14 Cornelia Just the two one liner test scripts... XD 04:14 erudition okay 04:14 Cornelia echo local say = print ; dofile("other.lua") > test.lua 04:14 erudition I'll make a new mod lol 04:14 Cornelia echo say("something") > other.lua 04:15 Cornelia lua test.lua 04:15 erudition oh 04:15 Cornelia But.. you could run it in a shell in twenty seconds. :P 04:15 Cornelia And know. :P 04:15 erudition if i have lua 04:15 Cornelia Surely you have a package manager of some kind.. :p 04:16 Lord_Buckethead erudition, require is just more complex to sandbox 04:16 Cornelia [package manager] install lua 04:16 erudition Lord_Buckethead: yeah... 04:16 Lord_Buckethead with dofile, loadfile, etc there are APIs you can reuse 04:16 erudition Cornelia: yep, i know 04:16 Lord_Buckethead require is kinda a blackbox, or at least it seems so 04:17 Cornelia I would have tested it already.. but my Android phone doesn't have a Lua interpreter. :P 04:17 Lord_Buckethead Cornelia, https://www.lua.org/demo.html 04:17 erudition actually the shell doesn't like the quotes 04:17 Lord_Buckethead bookmark that 04:17 Cornelia We need files. 04:17 erudition ^this 04:17 Cornelia We're testing dofile 04:18 Cornelia Replace them with single quotes 04:18 Lord_Buckethead what do you want to (ab)use it to do? 04:18 erudition seeing if dofile can see locals 04:18 Cornelia It should be fine then... Or.. just vim the files first 04:19 Lord_Buckethead iirc no because it changes the scope 04:19 erudition not in fish 04:19 erudition but yeah I got it 04:19 Cornelia From what I recall when I read the PIL book.. dofile (or at least loadfile) make the script it loads / does a function and executes it as a single chunk.. I was wondering if it saw the locals declared before the dofile 04:20 Cornelia You could also try loadfile("other.lua")() 04:20 Cornelia :p 04:20 Lord_Buckethead Cornelia, https://www.lua.org/pil/4.2.html 04:20 Lord_Buckethead its limited by chunk 04:20 Cornelia Ah.. I see. 04:20 Cornelia Yea.. 04:21 Lord_Buckethead and any script loading/execution function **has** to change chunk 04:21 Cornelia I was remembering wrong. :P 04:21 Cornelia So.. yea.. If you really want a global "say" you could try the temporary redefinition approach, erudition 04:22 erudition mhm 04:22 Cornelia But I'd recommend just returning a table with the function from a "utility.lua" file 04:22 Cornelia local utils = dofile("utils.lua") 04:22 erudition alright 04:22 Cornelia utils.say 04:22 erudition mhm. assuming dofile works 04:22 Cornelia It's cleaner and less likely to break something. 04:23 erudition yup 04:25 erudition local tools = dofile("tools") 04:26 erudition or does the path have to be minetest.get_modpath("mymod") .. "\tools.lua" 04:26 * Lord_Buckethead wishs more mods did error correction 04:27 erudition 2018-01-07 22:00:12: ERROR[Main]: ModError: Failed to load and run script from C:\Users\jacob\Desktop\minetest-0.4.16-win64\bin\..\mods\Master\viralblocks\init.lua: 04:27 erudition 2018-01-07 22:00:12: ERROR[Main]: ...est-0.4.16-win64\bin\..\mods\Master\viralblocks\init.lua:5: module 'C:\Users\jacob\Desktop\minetest-0.4.16-win64\bin\..\mods\Master\viralblocks/tools.lua' not found: 04:27 erudition I'm trying to correct this error :P 04:27 Cornelia Yes. 04:27 Cornelia You need the mymodpath .. 04:27 erudition it's there 04:28 erudition maybe the odd forward slash ? 04:28 erudition amongst all the windows backslashes 04:28 Cornelia Shouldn't matter 04:28 Lord_Buckethead shouldn't 04:28 erudition that's what i thought 04:28 Lord_Buckethead are you sure the file exists? 04:29 Lord_Buckethead maybe you named it tool.lua or something 04:29 erudition tools.lua haha 04:30 Cornelia Is your mod called "Master"? 04:30 erudition nope, that's the master branch, we have it in git 04:30 Cornelia Is "viralblocks" a mod in a mod pack called "Master"? 04:31 Cornelia Yea.. that might be why things are funky.. 04:31 erudition technically, yes 04:31 erudition i added a modpack.txt 04:31 Cornelia Hmm.. 04:32 Cornelia Is this on GitHub? 04:33 erudition yes actually 04:34 Cornelia Can I see the URL? :P I just wanna peek and see if I can spot an error or not. 04:35 erudition absolutely. thanks for your help and patience 04:36 erudition https://github.com/JacobHaig/ViralBlocks 04:37 Cornelia You.. declare a lot of globals right away.. 04:37 erudition don't worry, we'll localize them 04:37 erudition kinda wish lua was local by default 04:39 Cornelia Also the functions you declare in tools.lua are global 04:40 erudition well at the time we wanted it to be library-ish 04:40 erudition but i'll have to fix that too 04:40 Cornelia First question: does the paths in the errors above exist? 04:41 Cornelia The closest way to "library-ish" is to make the file return a table containing the functions. 04:41 erudition gotcha - still trying to get used to the whole tables thing 04:42 erudition the paths in the error were straight from the generated minetest.get_modpath("mymod") .. "\tools.lua" 04:43 Cornelia Yes.. but do they exist on your system? :P 04:43 Cornelia It looks like they should. 04:45 erudition do they @WIs? 04:45 erudition it's his windows system lol 04:45 Cornelia Was that using require? 04:45 Cornelia Probably not, right? 04:46 Cornelia Hmm.. 04:46 erudition no, require gave security error 04:46 Cornelia I don't think I'll be able to help much more... If my computer were on I could test it. 04:46 erudition okay, thanks though 04:47 Cornelia I'm not sure why that isn't working.. 04:47 Cornelia I've seen several mods do similar. 04:48 Cornelia Take a peek here: https://github.com/minetest-mods/technic/blob/master/technic/init.lua 04:48 erudition does minetest cache the mods directory? 04:49 Cornelia I wouldn't think so. :P 04:49 erudition so i don't need to restart it to see a new file 04:49 erudition okay 04:50 Cornelia Oh.. hmm.. 04:50 Cornelia I think you'd just need to reload the world. 04:51 Cornelia But I'm not certain. :P 04:52 erudition okay, got it to work on my system, sweet 04:53 erudition so will local say = tools.say work? 04:53 erudition just curious 04:54 Lord_Buckethead yes 04:54 erudition great 04:55 Lord_Buckethead you can even get a local right that and then replace the value of tools.say 04:55 erudition a local right that? 04:56 Lord_Buckethead like that 04:56 * Lord_Buckethead has just failed at typing thats all 04:58 erudition Cornelia: if you're wondering, we're attempting to build Conway's Game of Life in minetest 04:59 Cornelia I realized. :P 04:59 erudition probably not the best first mod haha 05:00 erudition or first-time-with-lua thing 05:00 Lord_Buckethead huh what are the rules like for 3d versions of that? 05:00 Lord_Buckethead s/3d/interesting 3d/g 05:00 erudition those exist! and there's at least one mod for that 05:01 erudition but actually I'm just interested in 2d planes 05:01 erudition so every height could theoretically be a separate playing board 05:01 * Lord_Buckethead briefly wonders did anyone figure out how to get it to work in n-dimensions 05:02 erudition that's pretty trivial actually, but you'd need to make up rules for every dimension 05:04 erudition a 72-sided cell survives if it has how many neighbors? 37-46? haha 05:04 Lord_Buckethead that kinda feels like cheating, I was thinking of a set of rules that works in a whole bunch of dimensions 05:05 erudition but you couldn't visualize that anyway, which is the fun part :P 05:05 erudition oh sure, the rules could be like dimensions/3 or something 05:05 Lord_Buckethead like die if neightbour =< floor(N * 1.5) 05:06 erudition there ya go 05:06 * Lord_Buckethead awaits hashlife in minetest 05:07 erudition honestly the hardest part of this project hasn't been the GOL code, or even Lua 05:07 erudition it's the Minetest 05:07 erudition trying to check the neighbors of... air blocks 05:07 Lord_Buckethead wat? 05:07 erudition ABMs don't work 05:08 erudition it's been interesting 05:08 Lord_Buckethead ABMs are horrible 05:08 erudition so we've learned 05:08 Lord_Buckethead don't see why it wouldn't work 05:08 erudition why what wouldn't? 05:08 Lord_Buckethead 'air' isn't really all that diffirent from 'default:stone' 05:09 erudition oh I know 05:09 Lord_Buckethead erudition, abms for air nodes 05:09 erudition I'm sure I could assign an abm to every air node somehow 05:09 erudition but that would blow up 05:10 Lord_Buckethead so assign ABMs to your game of life nodes 05:10 erudition we did lol 05:10 erudition that's no enough 05:11 erudition two problems with that - one is that it's only good for the die/survive rules 05:11 erudition another is abms occur in an erratic order 05:11 Lord_Buckethead they were never meant for this 05:11 erudition you don't say haha 05:11 Lord_Buckethead they are not meant for half the stuff they are used for 05:12 WIs lol 05:12 Lord_Buckethead ok 05:41 luk3yx If I did an invisible image button with a label on top, I might be able to centre/center text 05:41 Cornelia I was gonna mention the other day.. you could bake the text into an image.. maybe? 05:42 luk3yx Possibly, but the more textures the worse it is 05:42 Cornelia Anyways.. goodnight. 05:42 luk3yx Bye 05:44 luk3yx doors_blank.png 05:45 luk3yx doors_blank.png^[colorize:#000f 05:45 luk3yx For those people who override doors_blank.png for whatever reason 05:46 luk3yx Perfect 06:11 luk3yx Final code: image_button[,;,;default_dirt.png^\\\[colorize:#343434;exit;