Time Nick Message 02:10 MTDiscord Oh that was a different testing I promised to Xenith, my bad. What do you want me to benchmark for you? I could show you my lua processing times for boxgen, it's very compute intensive and will demo the differences starkly haha 02:10 MTDiscord I can show luaJIT vs PUClua5.1 vs luaJIT with JIT off, and lua 5.4 if desired 02:11 MTDiscord see ping in #modding 02:12 MTDiscord kk, I'm caught up, Give me a bit here to get that typed up 02:12 MTDiscord ty 02:27 MTDiscord Here's my test program I'm using so far. It's bad because os.time() is only accurate to seconds, does provide some info though: lua a = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"} local time = os.time() b = {} c = 0 for i=0, 5000000, 1 do for i, v in pairs(a) do b[i] = v end end print("Pairs executed in " .. os.time()-time .. " seconds.") time = os.time() for i=0, 5000000, 1 do for 02:27 MTDiscord i, v in ipairs(a) do b[i] = v end end print("IPairs executed in " .. os.time()-time .. " seconds.") time = os.time() for i=0, 5000000, 1 do for i=1, #a, 1 do b[i] = a[i] end end print("Indexing executed in " .. os.time()-time .. " seconds.") 02:38 MTDiscord For PUClua 5.1, That resulted in: 2 seconds for pairs() 4 seconds for ipairs() 2 seconds for indexing() For luaJIT that resulted in: 0 seconds for all.... So I took the for-loop max variable size and increased it by a factor of ten for each, resulting in: 1 seconds for ipairs() 5-6 seconds on average for pairs() 1 seconds for indexing. I am testing luaJIT again to compare indexing to ipairs better now 02:40 MTDiscord Scaling up another factor of ten, indexing was 12 seconds and ipairs was 12 seconds, but realize my method of access is probably less than ideal using indexing. Often indexing is fastest on luaJIT. roughly 5-10% gains in my experience. Now for PUClua 5.4 02:40 MTDiscord and luaJIT in interperter only mode 02:52 MTDiscord For luaJIT in interpreter only mode with the same setup as PUClua 5.1, I got: Pairs(): 0 seconds 02:52 MTDiscord IPairs executed in 1 seconds. Indexing executed in 0 seconds. 02:53 MTDiscord so much faster than PUC lua in all regards, same relative relationships 02:56 MTDiscord Finally, results from PUClua 5.4: Pairs executed in 2 seconds. IPairs executed in 2 seconds. Indexing executed in 1 seconds. 02:57 MTDiscord @wsor, user of things Based on my tests, yeah luaJIT still kicks butt in either interpreted mode or JIT mode. Pairs is better for interpreters for speed, but you also don't have nicely sorted output. 02:57 MTDiscord It also shows that indexing is likely better on PUC lua in general 02:58 MTDiscord thank you 06:42 MiniontobyPI hey 08:11 MiniontobyPI hey 08:17 MiniontobyPI how to resize a picture for a hud image 08:21 MiniontobyPI like this 08:21 MiniontobyPI [combine:8x8:-8,-8=character.png 08:21 MiniontobyPI how to do this for an hud image 08:53 MiniontobyPI can someone help me? 10:11 entuland MiniontobyPI: reading the API seems like there are fields you can pass to decide the scale, there shouldn't be any need to use those image filters 10:11 MiniontobyPI hmmm 10:11 MiniontobyPI sad 10:12 entuland why sad? doesn't matter how you achieve it, the point is achieving it, no? 10:16 MiniontobyPI idk how 10:31 whosit found a cause for some broken recipies in mods: empty fields in recipies (now?) are treated same as skipping them? 10:31 whosit so {"mymod:diamond_fragments", "", ""}, is equivalent to {"mymod:diamond_fragments"} 10:32 whosit but modding book says that empty fields must also be matched for recipie to work 10:32 whosit this breakes recipies like this: 10:32 whosit https://github.com/runsy/jonez/blob/master/init.lua#L277 10:33 whosit for palace_window_top and palace_window_bottom 10:33 whosit since "" are just thrown away, those recipies are conflicting 10:33 whosit when this change has happened? is it a bug? 11:13 MTDiscord there is a ton of such recipes leveraging on partial use of the crafting grid, if those empty strings were ignored, lots of default minetest recipes would either stop working or work in different ways 11:13 MTDiscord say, the simple torch 11:13 MTDiscord are you sure that is the exact spot of the problem? 11:18 whosit sorry, it's hard to explain it clearly, but I will try :) 11:20 MTDiscord uhm... maybe the torch wouldn't be affected in that case, gotta check the source 11:20 whosit there are "shaped" recipies, and modding book says that you can either specify empty slots in them (with empty strings "") or leave them out. And recipie matching behaviour will be different 11:20 whosit if you leave them out - the recipie should be movable around the grid 11:21 whosit if you specify empty strings, for example around torch, then it will match only placed in the center of the grid 11:21 whosit that's how Modding Book says it should work 11:22 whosit and I found some recipies (like jonez mod) that depend on this behavior of "matching empty strings" 11:22 whosit but, currently, that does not work in the engine 11:22 whosit and {"mymod:diamond_fragments", "", ""}, is equivalent to {"mymod:diamond_fragments"} 11:23 MTDiscord yes, I get the point, I'll try to repro it 11:23 whosit so, book says: first will match only in the left slot of the grid, and second recipie you can move around the grid 11:33 MTDiscord I can confirm that no matter the emtpy strings, 5.4.1 allows for moving the items around the crafting grid as if they weren't there 11:34 MTDiscord can't tell if it's a bug or if it's an intended change of behavior and the book hasn't been updated to match the change 11:51 MTDiscord I'm no expert in the core engine code but my understanding is that the way recipes are checked hasn't changed in a few years, I'm afraid you'll need to get the attention of more knowledgeable people around 11:52 whosit should I ask about this in #minetest-dev? 11:53 MTDiscord I think it fits there, yes 11:53 whosit ok, thank you 11:53 MTDiscord yw 13:06 Bombo anyone got the draconis mod? there is a book called 'Bestiary' but i can't read it, can't place it anywhere 13:26 MTDiscord @ElCeejus, Synthwave Warlord ^ 16:20 AntumDeluge Bombo, on ContentDB it says "Most other info you may need to know is detailed in the Bestiary". But I don't know how to use it either. Maybe its a work-in-progress. 16:27 AntumDeluge There is a bug in the code. I'm looking at it now. 16:34 AntumDeluge Oh, I think it might not be a bug... 16:36 AntumDeluge It has something to do with the "draconis:lectern" node. It looks like you have to use it to fill out the bestiary. 17:42 MTDiscord @ElCeejus, Synthwave Warlord 18:29 Bombo AntumDeluge: hm i tried it, i put the bestiary in the lectern, looks good, but still no text 18:30 Bombo hm there are two slots in the lectern 18:52 AntumDeluge Bombo, the other slot is for "draconis:manuscript". But I still don't know how it works. 19:02 Bombo AntumDeluge: yes i saw that too, and i put the manuscript there, nothing happens 19:16 MinetestBot 02[git] 04sfan5 -> 03minetest/minetest: Fix swapped vertex colors on GLES2 1369c70dd https://git.io/JsJfe (152021-05-11T19:15:39Z) 19:16 MinetestBot 02[git] 04SmallJoker -> 03minetest/minetest_game: Attachments: Proper data cleanup in callbacks (#2865) 1371ea0c6 https://git.io/JsJfv (152021-05-11T19:15:47Z) 19:25 AntumDeluge I have a problem with formspec security. I have created a shops mod ( https://forum.minetest.net/viewtopic.php?t=26645 ). The problem is that the formspec is associated with node meta. So if a second player interacts with the formspec, it affects the transaction of the first player. I'm using node meta to set formspec because I need the "allow_metadata_inventory_put" functionality.... 19:27 AntumDeluge I've thought about trying to suppress showing a formspec if it is already in use by another player, but I'm not sure if that is possible with using node meta data... 19:27 AntumDeluge I also came across the ActiveFormspecs mod ( https://forum.minetest.net/viewtopic.php?t=19303 ), which looks like it could be a solution if it does what I think it does... 19:28 AntumDeluge But I wanted to know if someone knows something I don't about securing formspecs. 19:28 AntumDeluge If I can avoid depending on another mod, I'd probably rather do that. 19:35 AntumDeluge Is there a way to retrieve a formspec instance & store it an a variable/table? 19:35 sfan5 formspecs do not have instances 19:35 sfan5 you use a node's inventory in a formspec completely disconnected to the node 19:35 sfan5 though this would still mean multiple players can't put items at the same time 19:36 AntumDeluge Isn't there a Lua or C++ object that is created when a formspec is shown? 19:36 sfan5 Lua certainly not, C++ probably; but it's all on the client 19:37 AntumDeluge So, no wait to retrieve & manipulate that. 19:37 AntumDeluge *way 19:38 sfan5 if you want to control what gets shown to who use minetest.show_formspec() 19:38 sfan5 (obviously) 19:39 AntumDeluge Yes, but as I understand it, I won't be able to retrieve the "allow_metadata_inventory_put" callback. 19:40 AntumDeluge Or am I mistaken about that? 19:41 sfan5 the callback happens on the node 19:41 sfan5 you can tell the formspec to show the node inventory and it'll function like usual 19:42 AntumDeluge Oh, I see. Thanks sfan5. I'll explore that. 19:44 AntumDeluge "though this would still mean multiple players can't put items at the same time" Actually, I don't think that will be a problem for me as the inventory itself doesn't actually hold anything. It is simply used to drag items onto to invoke the "allow_metadata_inventory_put" callback. 19:45 AntumDeluge However, I do store a value in the nodes metadata that is important. But that should be easy to get around by using a key with the player's name. 19:54 AntumDeluge Does it make a difference whether "meta:get_inventory():set_size()" is called in "on_construct" or "after_place_node"? 20:34 AntumDeluge Bombo, I got a response about the bestiary: https://github.com/ElCeejo/draconis/issues/9 23:35 beanzilla Hi all, I would like to know how to do a goto within my mod. (I keep getting a `'=' expected near 'skip'`, My paste is https://pastebin.com/y4SvDMbY) 23:37 entuland your code seems malformed to begin with 23:37 MTDiscord Don't use goto unless you know everyone that uses your mod will use luajit 23:37 entuland you were missing a doublequote before the steel definition 23:38 entuland and yes, please try and avoid that goto, you don't need it there for sure 23:38 entuland this is a better spot to post your code for the future as well: https://ideone.com/w4lg6E 23:39 entuland as you can run it there and verify if it's okay (assuming it doesn't contain any call to minetest-specific stuff or the alike) 23:40 beanzilla So I guess really to not use the goto I'd need too do ... https://ideone.com/P8qlfz 23:41 entuland yeah that may work, or use the inequality operator, really matter of tastes there likely 23:42 beanzilla Anyway, thank you Jonathon and entuland for the help. 23:42 entuland yw 23:44 AntumDeluge Is there no way to catch "put" & "take" events in the player inventory? 23:48 AntumDeluge Oh, maybe I don't need to do that. I misunderstood something sfan5 said. 23:48 MTDiscord uhm... isn't that just a formspec like any other which you can intercept with on_player_receive_fields? 23:49 MTDiscord Put/take doesnt seem to be a field 23:49 AntumDeluge on_player_recieve_fields works for buttons & other fields. But not for put/take for "list". 23:50 MTDiscord oh okay 23:50 MTDiscord Seems like an oversight 23:51 AntumDeluge I think I actually want a "detached" inventory, not "player". But I think I still end up with the same problem. 23:51 MTDiscord Ah, minetest.register_on_player_inventory_action 23:51 AntumDeluge Oh, nice. Thank you GreenXenith. 23:51 entuland that sounds promising indeed by the name :P 23:51 MTDiscord Knew there had to be something :] 23:52 MTDiscord No idea if it will work for detached inventories 23:52 entuland there always is a way (tm) 23:52 entuland sometimes it involves threatening with a large mallet, but hey 23:52 MTDiscord Detached inventories actually have their own callbacks 23:53 MTDiscord defined when registering them 23:54 AntumDeluge I'm guessing detached is what I want to use, as sfan5 said.