Time Nick Message 03:07 MTDiscord It is unclear to me how to "swap" items in a detached inventory: https://github.com/minetest/minetest/blob/c9144ae/doc/lua_api.txt#L6083 03:08 MTDiscord I may have found a tutorial. Watching it now: https://nathansalapat.com/minetest/inventory-manipulation 03:12 MTDiscord Maybe not. I'm trying to swap items in/out of a detached inventory with the cursor, like is done by default when any item is allowed in a slot. 03:13 MTDiscord When I try to swap, the item that I am holding with the cursor disappears. 03:14 MTDiscord why do they need to be in the curser? just swap the two itemstacks from inventories 03:14 MTDiscord That's what I'm trying to do. I'll upload a video of what is happening. 03:21 MTDiscord Held item disappears when trying to swap in detached inventory. 03:21 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/852749293650575410/minetest_inventory_swap.mp4 03:23 MTDiscord what does your code look like? 03:23 MTDiscord and you just want the items to swap, nothing else? 03:24 MTDiscord Correct, just like what is normally done when swapping between two inventories. 03:24 MTDiscord code? 03:24 MTDiscord I'll link to my code. 03:25 MTDiscord https://github.com/AntumMT/mod-server_shop/blob/349d781/deposit.lua#L27 03:26 MTDiscord oh, you want to allow/deny swaps? 03:26 MTDiscord your looking for allow_metadata_inventory_move 03:26 MTDiscord L7746 lua_api.txt 03:27 MTDiscord err, ignore that 03:27 MTDiscord That only works for nodes, doesn't it? 03:27 MTDiscord yeah 03:28 MTDiscord allow_move l8258 03:28 MTDiscord there also is on_move 03:28 MTDiscord DetachedInventory:on_move? 03:28 MTDiscord okay, I'll check that out. 03:29 MTDiscord L5242 to L5250, shows you where to put the callbacks in the dettached inv creation 03:37 MTDiscord allow_move/on_move aren't being called. 03:38 MTDiscord I thought that allow_move/on_move were only for moving items between slots within the same inventory. 03:40 MTDiscord nope 03:40 MTDiscord allow_move = function(inv, from_list, from_index, to_list, to_index, count, player), 03:41 MTDiscord Ah, okay. But still, not being called for some reason. 03:41 MTDiscord did you actually put it in the dettached inv def? 03:41 MTDiscord Yes. 03:43 MTDiscord https://rubenwardy.com/minetest_modding_book/en/items/inventories.html modding book has a example, similar? 03:43 MTDiscord or https://github.com/minetest/minetest_game/blob/master/mods/creative/inventory.lua#L33-L62 03:44 MTDiscord Yes. 03:46 MTDiscord Except in that last example, they have forced allow_put to return 0. Perhaps that will cause allow_move to be called. 03:47 MTDiscord Nope. 03:50 MTDiscord I suppose I have to get the inventory stack in on_put & just move it to player main inventory. But would be nice to have the default behavior. 04:03 MTDiscord works for me 04:14 MTDiscord Ya, except now I have this going on. ? 04:15 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/852762813691985960/minetest_inventory_swap.mp4 04:18 MTDiscord If I don't define any callbacks, it works just fine. But ya, I want to limit which items can be placed into the inventory. 04:18 MTDiscord I have no idea why on_move isn't working. 04:30 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/852766619741847559/deposit.png 04:32 MTDiscord On move end has no comma? 04:33 MTDiscord Seems like that would crash 04:33 MTDiscord Sorry, that's just a typo. 04:35 MTDiscord Ill test some more tommorrow if you havent gotten a answer by then 04:35 MTDiscord K. Thanks for responding. 06:43 independent56 http://2.26.38.198/dokuwiki/doku.php?id=downtime:migration_failure 06:43 independent56 what path do you think i should take? 06:51 VanessaE 4. reset the map, declare the world a total loss, and accept public humiliation for not having a proper daily backup plan in place. 06:51 VanessaE :P 06:55 independent56 ah yes, plan ID #4.5 06:55 ShadowBot https://github.com/minetest/minetest/issues/4 -- cppcheck warnings 06:55 independent56 since it is not an intiger, then it cant be included 07:24 sfan5 just restore from backup ;) 15:35 independent56 would advtrains crash into glow glass? 15:35 entuland I guess it's test time :P 15:36 MTDiscord Seems like there's been changes to the movement code in 5.5 that cause the vector.round(player:get_pos()) to sometimes return the wrong pos, i.e. one node too low? 15:37 MTDiscord I'm curious if anyone has seen anything like this... 15:40 sfan5 https://github.com/minetest/minetest/pull/10803 15:42 MTDiscord So if I have a value like -1.5 exactly, it used to be rounded to -1.0 but now it's rounded to -2.0? 15:43 MTDiscord That seems ... bad, but admittedly not any less bad than it was before; exactly-off-by-half values are always a worst-case. 15:43 MTDiscord I guess I can just force round-toward-positive behavior in the special case I'm encountering by adding a fudge factor 15:44 sfan5 yes 15:44 sfan5 if there's a reason why round-towards-positive is better/more useful it should be put back 15:52 MTDiscord It's tricky because it only really makes sense in the y axis, since that's the only place where a player having a coordinate of exactly -1.5 is likely to happen in normal play, and the only place where the expected behavior of that rounding to -1.0 has established meaning 15:53 MTDiscord basically if you do minetest.get_node(vector.round(player:get_pos())) then you usually get the node the player's feet are "in" but in this one corner case you get the node the player is standing ON. 15:54 MTDiscord arguably the old behavior worked more least-surprisey in this case, and there was no likely different in surprisiness on the other axes, so the old behavior is slightly more theoretically wrong but slightly more practically useful. 15:54 MTDiscord Now modders will need to know to handle this special case wherein they could code more naively and have things still work as expected. 16:50 MTDiscord Is there a recommended place for posting example code? I know of pastebin, but it seems many frown upon that one. 16:51 MTDiscord Actually, I guess I can just put my code in a GitHub gist. 17:01 MTDiscord I like gists a lot myself. There are lots of other pastebinny things like paste.ubuntu.com or sprunge.us too 17:05 MTDiscord Okay. Ya, I will probably stick to gists. 17:06 MTDiscord This does seem to be the case. Is that intentional? 17:06 MTDiscord Oops, meant to reply to this one. 17:07 MTDiscord In my tests, allow_move/on_move InvRef callbacks are only called when moving items within the same inventory. 17:11 ShadowNinja I use gists, but you do need an account to use it, which is why I don't use it for ,,(config plugins.FloodProtector.suggestedPastebin) sprunge is also nice because it's easy to pipe to it from the command line, but the web form doesn't seem to work in firefox anymore, so you have to use the command line. 17:11 ShadowBot ShadowNinja: Global: paste.ubuntu.com; #minetest @ libera: paste.ubuntu.com 17:16 independent56 there shtherou 17:17 independent56 sorry, hexchat glitch 17:18 MTDiscord This isn't the problem I was referring to last night. But it has got me curious because I know it will come up in the future. I'm moving items between slots in an inventory, but the items are being lost because in the on_move callback the inventory slots come back as empty: https://gist.github.com/AntumDeluge/0236efc1b2c22bdd454177cc3490570c 17:18 independent56 there should be a worldedit competiton where you buid something in worldedit and x does y to z.... oh wait, i made the idea, and am capable of hosting it... oh golly, i need to host it! 17:20 MTDiscord I'm using Minetest version 5.4.1. 17:43 MTDiscord This is my full test code: https://gist.github.com/AntumDeluge/cce0c653d817205685b268b318302432 17:51 MTDiscord Here is a demonstration of what is happening with this code. 17:51 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/852968393756901406/minetest_detached_inv_swap.mp4 17:52 MTDiscord Moving between two different inventories works fine as long as the target slot is empty or contains the same item. 17:53 Krock are you re-inventing the stack movement code? 17:53 MTDiscord I have no idea. I posted the code above. 17:56 MTDiscord Edited: had some return calls in the on_ methods that didn't do anything. 17:56 MTDiscord How do I preserve the stack movement code? 17:58 Krock don't use inventory functions in the callbacks 17:59 Krock use the "count" and "itemstack" return values to change the amount of moved items 17:59 MTDiscord Oh, I see. Thank you. I will give that a try. 17:59 Krock it's best to do everything in the allow_* callbacks to not deal with the on_* afterwards 18:00 MTDiscord Okay. I've done that before, but thought in this case it was better to go through to the on_* callbacks. 18:00 Krock on_* is called when the real movement happens (after finding out what's allowed to move), hence you'd use that for messages like "player X moved Y from Z to A" 18:01 MTDiscord Makes sense. 18:01 Krock to forbid moving of a certain item, return 0 in a allow_* callback 18:01 Krock or to move stacks of size 1, return 1 respectively. 18:02 Krock any calls to inventory functions within inventory callbacks outright ask for item duplications and loss to happen 18:13 MTDiscord So by just setting the allow_* callbacks to return -1 should be regular behavior, right? By doing that, my items just disappear. That's why I started filling out the on_* callbacks. 18:16 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/852974643665174558/minetest_detached_inv.mp4 18:18 MTDiscord Here is the code for that: https://gist.github.com/AntumDeluge/e5689383c9c4513a8e161e6190e4e79c 18:39 Sokomine is someone familiar with minetest.dig_node and minetest.place_node? i was hoping to be able to use it for an npc (instead of either add/set node or the way the nodebreaker and deployer goes) 18:40 Sokomine the results are a bit..unexpected. dig_node digs the node all right - but then drops the drops as items. and place_node does not place the block at the target position if there is air beneath... 18:41 specing How do working villagers do it? 18:42 celeron55 they could work, and were originally designed so that they could work, but probably nobody has ever used them in that way so it's probably not tested and broken, and other mods can definitely break 18:43 Sokomine it'd be nice to be able to understand the logic behind them and what they where invented for 18:48 Sokomine specing: ah. seems working_villagers encountered the same problem with digging a node and uses code to circumvent it. but that strange oddity with placing a node doesn't seem to be an issue there 18:49 celeron55 hmm, actually, i was thinking something else 18:49 celeron55 these definitely should work 18:50 Sokomine a player looking downward on a block of air couldn't place the block that way either. perhaps it tries to emulate that 18:50 celeron55 https://github.com/minetest/minetest/blob/master/src/script/lua_api/l_env.cpp#L461 18:51 celeron55 it needs to generate a PointedThing in order to call the on_place callback 18:52 celeron55 and looks like it uses the node below as the "under surface" position 18:52 celeron55 that's weird, i think pointed thing can actually have both as the same position, no? 18:53 Sokomine hm. perhaps not for placing 18:53 celeron55 maybe it would break something 18:53 Sokomine could be. it does say after all that it places like a player. a player would look at a diffrent node where he could place the new one against 18:53 Sokomine great that you found that place! 18:54 celeron55 an issue needs to be reported on this 18:54 celeron55 the solution doesn't seem obvious 18:54 Sokomine if it's known it can be handed in the code: look if there's air below - if so, increase your position by 1 18:55 Sokomine doesn't seem very clean but will most likely work 18:55 celeron55 well at least it has to be documented 18:55 Sokomine that's right 18:55 Sokomine are you going to? after all you found the right location :-) 18:55 celeron55 about dig_node: it seems there should be a version where you can control where the drops go 18:56 celeron55 nah... i'm just passing by 8-) 18:56 Sokomine yes. that would be fine. after all the npc does have an inventory - and gets its drops in there manually. having that handled by mt directly would be helpful 18:56 Sokomine :-) 18:56 celeron55 but what happens with drops is game specific so i'm not sure what kind of control there even can be 18:57 celeron55 i guess ideally the drops should simply be a return value, but that could be very complicated to implement 18:57 Sokomine the server admin of the your land server (Alias) has created a nice mod which allows rpg-like talking with npc. it's a very powerful mod that even allows execution of any lua code. i'm tuning it down so that it can hopefully be safely used by players 18:59 specing Sokomine | a player looking downward on a block of air couldn't place the block that way either. 18:59 specing I can :P 18:59 Sokomine perhaps just an optional inventory as target location? and if there's none drop the items like now. after all an entity like an npc won't have item_pickup 19:00 Sokomine with a modified client you can do almost anything. but in general you can't place *on* air if you point at the air 19:00 specing true 19:01 specing I don't yet know how to CSM place nodes with rotation 19:02 celeron55 dig_node seems to simply call the on_dig method of the target node with an uninitialized/dummy ObjectRef, and then core.handle_node_drops looks at that and sees it doesn't have an inventory and drops the items on the ground 19:02 celeron55 being able to pass an ObjectRef to dig_node could be useful 19:02 Sokomine definitely 19:02 celeron55 to be the digger 19:03 celeron55 if the digger has an inventory, it would put the drops into the "main" list 19:03 celeron55 just like for a player 19:03 independent56 i have made a huge skyscraper base... and wrodledit is still trying to cpy it upwards. 19:04 Sokomine trouble with some normal functions (on_rightclick will give me some trouble there i fear) is that they usually expect a player to be the actor - and will at best do nothing if the acting thing doesn't have a player name. but it'd be helpful to have these fucntions work 19:04 celeron55 that's worth an issue on github also, i think that feature could be added 19:04 Sokomine that'd be great :-) 19:05 celeron55 but i would warn that even while the engine can support all of those objects not being players, i'm sure many mods will break 19:05 Sokomine independent56: if the area wasn't loaded before that may happen. and it may take a while if it's a very huge skyscraper 19:05 Sokomine yes. i fear less with digging/placing - after all many mods do that to some degree...but right-click will be a real pain in that regard 19:06 independent56 https://imgur.com/a/pJn362F 19:06 independent56 this is the base 19:06 Sokomine can't see because of javascript. hope it has many nice details as well 19:07 independent56 https://i.imgur.com/bFqB3vO.png here is the raw image 19:07 Sokomine for npc, it would be really great if some things in the world could be more unversal. like "this is a door". would make life way easier for them 19:07 independent56 and it has boring floors. just 6 elevators per floor, and a sandbox to build in. 19:08 independent56 this is the slow lowlands, a place under development and rebuilding, turning it from swamp to city. 19:08 independent56 http://2.26.38.198/dokuwiki/doku.php?id=nature:slow_lowlands 19:08 independent56 old screenshot 19:09 Sokomine ah. hope you can sell the appartments in the skyscraper to intrested players :-) 19:10 independent56 XD yeah good idea. i am planning on selling floors instea dof using rental panels, mainly because the players will ahve a nice, large, prebuilt home to furnish ( ybut the windows and supports are vunurable) 19:16 independent56 https://imgur.com/a/NdjXuGe 19:16 independent56 here is a ncie comaprison image. i wish for the skyscraper to go as high as possible before it goes out of porportion. 19:17 Sokomine a player on tunneler's abyss has built great and intresting skyscrapers by hand. sadly he left and asked for his buildings to be removed 19:18 independent56 andreasbadger... yeah i remember seeing the screenshots. dammit! i should have kept them. meh. 19:19 MTDiscord That "I'm leaving and taking my stuff with me too" thing can really mess with a server if builds are collaborative or people build their stuff based on what's around it. 19:19 MTDiscord I require players to CC0-license what they build as a condition of joining my server to prevent those kinds of issues. 19:20 independent56 hmm 19:20 independent56 i need to add that to mine 19:23 MTDiscord The license is reciprocal. That means they give up the ability to revoke access to what they build, but in exchange, they get access to everything everybody else builds. Client-saving is encouraged, and I even offer nightly backup snapshots for download. 19:24 MTDiscord Why does setting allow_put in detached inventory to return -1 not use the default behavior? Instead, my item just disappears: https://gist.github.com/AntumDeluge/e5689383c9c4513a8e161e6190e4e79c 19:24 MTDiscord As a side effect, players can take charge of their own backups, and the world can be recovered even if I suddenly just ghost and take down the server one day, hence no hometown-esque situations. 19:24 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/852991779082207252/minetest_detached_inv.mp4 19:25 MTDiscord As a result, because players know that they cannot be locked away from access from their own stuff either, that means they can feel free to build with confidence and invest their time into the server without worry of having it arbitrarily lost. 19:25 MTDiscord AntumDeluge: Is -1 supposed to be some kind of special value that's documented as doing the default thing? 19:26 MTDiscord I'd expect using a value like nil or true or false or +infinity would make more sense, and a special -1 value is sort of a C-ism. 19:26 MTDiscord I was just about to test stack:get_count(). But I did read somewhere that -1 allows any amount. Perhaps that was for a different inventory type. 19:27 MTDiscord Could be, could be for a different hook, or maybe it's just consistently inconsistent. 19:27 MTDiscord Yes, I see now that returning stack:get_count() does indeed work. 19:27 MTDiscord If the documentation either (1) says -1 should work, or (2) doesn't say for this particular use, but does say it should work for some other use, hence at least implying it should work, then I'd call that at minimum a documentation bug, if not worse... 19:28 Krock -1 means infinite source or sink 19:28 MTDiscord So, it's not my fault & I'm not completely dumb? ? 19:33 MTDiscord Yes! it's working as desired. Thank you. 19:34 Krock !next 19:34 MinetestBot Another satisfied customer. Next! 19:34 MTDiscord -1 is just not a particularly good value to choose for a "special case" kind of value for a Lua API. 19:35 MTDiscord So -1 isn't documented correctly? 19:35 MTDiscord I mean, if you're working in C and the type is constrained to an integer and you have this whole negative range that can only have special meanings, it makes sense from that side 19:35 MTDiscord but to a lua modder, the lua API looks like it's just lua, and the idea that it would have to be an integer doesn't make sense from that side. 19:35 MTDiscord just nil would have made probably the best return value to indicate "just do the default thing"... 19:36 MTDiscord either way, though, given that that IS the design, for better or worse, it sounds like the documentation could be improved... 19:38 MTDiscord This might be where I read it, but not sure if it is meant to apply to detached inventory: https://github.com/minetest/minetest/blob/c9144ae/doc/lua_api.txt#L4782 19:39 MTDiscord Looks like that is specifically for player inventories. 19:41 MTDiscord Not sure if you were saying this was already implemented, but returning nil does not work: ServerError: AsyncErr: ServerThread::run Lua: allow_put should return a number. 19:41 MTDiscord ick 19:47 independent56 what meterial would i use for a patwhay in sand? what in your experience has worked well? 19:51 independent56 eh, gonna use baked clay 19:54 independent56 3.3 different inventory items 19:55 independent56 K 19:55 independent56 3399 different ones 20:44 independent56 my skyscraper is brilliant... its liek a big flat block of flats. 20:44 independent56 https://imgur.com/a/MyTtunM 20:44 independent56 here 20:44 independent56 and you can see the other skyscraper, envious 21:01 specing roads look boring, terrain looks boring, skyscraper looks boring 21:01 specing and websites shouldn't require javascript to display images 21:03 specing Anyone can grab worldedit and copy paste the same boring floor hundreds of times 21:04 independent56 i know. but i love that skyscraper. 21:04 independent56 i am very proud of it. 21:04 MTDiscord If you're planning on selling/renting space, you'd be best off just giving it away for free to early adopters until your world has reached a critical enough mass. 21:05 MTDiscord Basically use network effects to make property values increase. 21:06 entuland would that cause the world to become a black hole and suck in the hard disk, computer, desk, user, room and so forth? 21:07 independent56 lol 21:08 independent56 i will sell them incredibly cheaply. like 10 currency units for an entire floor 21:08 independent56 sorry, italic error 21:11 MTDiscord It's a bit hard to sell space on a server that doesn't have a lot going on yet and actually charge players money for the privilege ... but then maybe you and Thorstein Veblen know something I don't. 21:12 independent56 well, you get 30 mg starter cash. 33% of your money for a home isnt that  bad 21:17 independent56 if you dont understand the pain of slef-hosting, think of how i sleep to the sound of computer fans every night. and blue lights shining on the table 21:18 independent56 but i like the pain 21:24 y5nw Make sure you have adaquate fire protection there 21:25 independent56 XD nah, if it overheats, it will automagically shut down 21:25 * independent56 checks for temeperature-checking command line tools, so he can do that automatically 21:38 MTDiscord you just need to host on a machine that's in a different room than the one you sleep in. 21:40 y5nw and remember to put some butter into the toaster and turn it on before you go to bed :P (seriously don't) 22:13 MTDiscord Is there a maintained version of snowdrift? https://github.com/paramat/snowdrift 22:15 logger56 ahrghhh fuck 56independent. he trats me like some dedicated server! i am not! i am just a samsung NC10 he treats poorly! why does he think i an suddenly host minetest? i will burst into flames, i fucking swear to god. 22:19 MTDiscord who let the shitpostbot get sentience in here 22:20 MTDiscord https://c.tenor.com/YQuM7wQo708AAAAM/ban-hammer.gif 22:21 MTDiscord Nobody likes 56i, not even his alts. 22:21 MTDiscord xD 22:22 * logger56 suffers form melatonin drunkness yet again 22:23 MTDiscord I wanted to report an issue about effects not being shown through semi-transparency. Though, I'm not sure if it is an issue with the mod or with the engine. 22:23 MTDiscord https://cdn.discordapp.com/attachments/749727888659447960/853036651146903552/snowdrift_semi_transparency.mp4 22:24 sfan5 that's a longstanding engine issue 22:24 MTDiscord Okay. 22:25 logger56 i think clouds need to stop going insid ebuildings. my skyscraper's 40th floor is very wet because of all the clouds condensing. 22:26 MTDiscord No, indoor air quality is usually way worse than outdoor, you WANT that ventilation. 22:26 logger56 XD 22:27 logger56 well goodnight, i want all the voices to go away /j 22:28 MTDiscord Antum: your best bet is to use semitransparency sparingly. Fixing these problems would be Hard, so don't expect any miracles soon. 22:29 MTDiscord I'm not worried about it. I just thought it might be an issue with the snowdrift mod specifically. So was going to report it. 22:30 MTDiscord I keep seeing snowdrift as snowd-rift instead of snow-drift 22:30 sfan5 systemd-snowd 22:45 MTDiscord I am curious why snowdrift is no longer maintained. paramat archived the repository. Are the other weather mods preferred over it? I think snowdrift is the only one I have ever used. 23:01 MTDiscord Paramat archieved everything 23:01 MTDiscord Gotta look at the bigger picture 23:01 MTDiscord paramat is not active anymore? 23:01 MTDiscord his patereon said so before he deleted it, long time ago 23:03 MTDiscord Looks like his latest activity on GitHub was a commit to minetest_game in may. Only two commits total this year. 23:03 MTDiscord *May 23:04 MTDiscord ?‍♂️