Time Nick Message 00:09 Peter_Lankton so i am still kind of new to lua and minetest modding. is there a way to override the objectref:set_pos() function? i want to make it so if any mod teleports a player, it first does something then runs the original function i.e. teleport the player. 01:17 Kimapr Peter_Lankton: Yes. you need to acquire one (1) ObjectRef, then modify its methodtable (pass the obj to `getmetatable` to get it) 01:36 Peter_Lankton Kimapr it tells me its a nil value when i try "ObjectRefmetatable = ObjectRef:getmetatable()" 01:39 Peter_Lankton oh wait no i think i figured out what i did wrong lol 01:42 Peter_Lankton i had thought the metatable func was part of the object thingy. anyway, with that done, i now have the best anti-noclip mod ever. 01:44 germ So that framinetest server ? 01:44 germ Peeps get educated, much ? 01:44 Peter_Lankton its still buggy and sometimes makes the player get stuck. however i think i can fix that. its already the best regardless. 01:45 Peter_Lankton i have no idea what you are talking about. i dont play other peoples servers. no need to be a dick about it 01:48 germ Lol no! 01:49 Peter_Lankton ok then link me the source repo of this better anti noclip mod. 01:49 germ I wasn't even reading, it's a cold prompt: I am trying to get the kid of a friend `educated' (whatever this means) 01:50 Peter_Lankton oh were u replying to an old post? 01:51 germ Not even ! I just had a tried at that Framinetest server.. I'm curious where I could take it. Idk if there is a lot more than what I've seen so far 01:52 Peter_Lankton oh someone named Peeps im guessing. i guess i was not aware because peeps also means people. or do u mean u acidentally pasted that here instead of the game chat? 01:53 germ I meant people 01:53 Peter_Lankton i thought u talking about the framinetest thing was responding to me about my noclip mod. telling me they have a better one. 01:54 germ no not at all.. You have a problem with your Minetest, comrade ? 01:55 Peter_Lankton oh ok. sry for the misunderstanding lol. no im good. i mean i was having problems but i figured out a solution. which was why i came here in the first place. 01:56 germ oh that's neat .. Yeah I should read more before just starting talking.. I am so alone lol 01:56 Peter_Lankton heh. me too 02:03 Peter_Lankton so its probably not the first. but my anti noclip mod uses the raycast feature. i tried looking for other anti noclip mods but they kinda sucked. so i am making my own. right now any node that has a collision that is different from the nodebox has issues as the raycast seems to use the nodebox. so maybe it just will check and ignore nodes where the nodebox and collisionbox dont match. it also has to check whether the 02:03 Peter_Lankton node is collidable anyway. 02:07 Peter_Lankton heh im so lonely now that im discussing my mod development in the irc. which i dont usually do. anyway since its just gonna distract me and i got what i came here for, i will be going now. byeeeeeeeee! 02:09 muurkha byee 08:44 imi hi, am I allowed to double reference a stack in two inventory lists or am I supposed to make a deep copy? 09:32 MTDiscord Peter_Lankton: Overriding :set_pos doesn't help with detecting noclip at all, unless the "noclip" is induced by a bug in one of your mods calling :set_pos on the player. Player movement does not call :set_pos. 09:32 MTDiscord ah nevermind that was unrelated apparently 09:33 MTDiscord btw raycast uses the selectionbox, not the collisionbox, so yeah, that doesn't work 12:43 sfan5 imi: that's allowed, the api functions just copy the data out of the ItemStacks and don't persist the objects themselves 12:45 imi ok thanks 17:17 Warr1024 Kimapr and Peter_Lankton: if you want an example of modifying what set_pos does to a player, https://gitlab.com/sztest/nodecore/-/blob/master/mods/nc_player_pickup/teleport.lua 17:18 Warr1024 The process is pretty simple: I just "juggle" a deferred function every tick until there's at least one player online, then grab the metadata off that player and install the patch. The patch itself just wraps around the old set_pos function and adds the logic I want. 20:13 Peter_Lankton @luatic "raycast uses the selectionbox" ok thanks for making that clear to me. i was not sure if it used the selection box or nodebox specifically. i think i will just compromise and make it ignore those nodes. that does weaken the anti noclip a bit but i dont expect houses to be made with those nodes as the walls lol. and Warr1024 thx for the example. i think i found something that works for me. mine will wait until 20:13 Peter_Lankton the first player joins using the register_on_joinplayer then modify the metatable. just found out i also have to override move_to lol. 20:14 MTDiscord Peter_Lankton: raycasts are the wrong tool anyways 20:14 MTDiscord you probably want box-box collisions, which are pretty simple to implement 20:15 Peter_Lankton yeah that would be better. 20:15 MTDiscord you likely want something like an adaption of https://github.com/appgurueu/disable_build_where_they_stand, where instead of disabling placement of to-be-placed nodes, a globalstep periodically checks for collisions between players and existing nodes, and deals with players who collide with boxes 20:15 MTDiscord I had considered implementing this but ultimately considered it pointless 20:15 MTDiscord normal players can get stuck in nodes just as well if they are able to dig or place them locally 20:16 MTDiscord so checking for collision unfortunately isn't reliable and distinguishing noclipping from "regular" glitching becomes pretty much impossible 20:17 MTDiscord anti noclip + only considering nodes not diggable/placable by the players + dbwts may work reasonably well though 20:18 MTDiscord TL;DR: if you somehow manage to legitimately enter a block, Minetest allows you to stay and move within it, s.t. noclipping is possible even for non-cheat clients 20:19 Warr1024 Peter_Lankton: the reason why I didn't use on _joinplayer was because I wanted my hook to (1) automatically expire once I had made the modification to the metatable once, and (2) leave absolutely no footprint once it had been installed. 20:20 MTDiscord I don't like that minetest.after loop 20:21 MTDiscord It fails to ensure that the hax are applied as soon as possible 20:21 Peter_Lankton so i guess i would need some way to cast the shape of the players collision box instead of just a ray cast. i did figure out how to make players not get stuck in nodes they place though. and it kind of works for things like doors too. i just make it ignore the raycast if the above and below are the same pos. 20:21 MTDiscord NodeCore does the "if you get stuck inside a solid then you get teleported out" thing too, but it's very limited. It's entirely disabled if you have the noclip priv (it can't check and doesn't care whether its actually "on" or not) and only works on some materials based on full-node collision, not collisionbox (nodes with complex collisionboxes it basically just ignores) and it only works if you stand still for a second (i.e. you have 20:21 MTDiscord the option to struggle and it will wait for you to be done first). 20:22 MTDiscord Peter_Lankton: "i did figure out how to make players not get stuck in nodes they place though" - that's exactly what dwbts does. And pretty much perfectly. 20:22 MTDiscord (dwbts is short for disable_build_where_they_stand) 20:22 MTDiscord I have only one mechanic that avoids using selectionboxes and that one also just uses full nodes (plus, it actually does a custom "old fashioned" raycast with coarse stepping instead, because the ability to "quantum tunnel" is actually desired in that case). 20:22 MTDiscord (dwbts is short for disable_where_build_they_stand) 20:23 MTDiscord oof 20:23 MTDiscord double oof, I replied to the wrong message (at least IRC peeps can't see this) 20:23 MTDiscord anyways you don't need coarse stepping for that 20:23 MTDiscord I don't need coarse stepping, but it makes it work nice and cheatp 20:24 MTDiscord you can always get the next node by intersecting with the next 3 axis parallel grid planes 20:24 MTDiscord that way you won't miss nodes due to a too coarse stepsize 20:24 Peter_Lankton dwbts sounds helpful. it is kinda annoying how i can sometimes place blocks inside myself even when noclip mode is off. when its off its inconsistent. 20:24 MTDiscord yeah, just adding a vector to another vector is quite a lot less expensive than computing a handful of plane collisions ๐Ÿ˜„. If I were trying to solve a different problem, maybe ... but then considering the costs of reimplementing raycasts, I'd really try to just pick a different problem entirely. 20:25 MTDiscord it is very manageable, I wrote the code but didn't test it 20:25 MTDiscord it's like 30 lines? 20:25 MTDiscord these planes are all axis parallel, so computing the intersection points is pretty trivial 20:26 MTDiscord In my case, I was simulating radiation, and the ability to tunnel through thin films, as well as the ability for non-full-node things to be able to absorb stuff that would have passed through a "hole", were both helpful for both realism and gameplay. 20:26 MTDiscord Peter_Lankton: IIRC the issue is/was that the engine itself uses a dirty clientside hack for enable_build_where_you_stand 20:26 MTDiscord or disable_... 20:26 Peter_Lankton does it take into account if the player's collision is not default? because in my server, its possible for players to change size and shape. which i know from experience made the mesecons pressure plates look funny. 20:26 MTDiscord (whatever it was called) 20:26 MTDiscord It's nice when you can get free realism by just making the bugs in your code match up with the bugs in reality. 20:26 MTDiscord Peter_Lankton: Of course it does. My code is perfect. 20:27 Peter_Lankton well i will give it a shot 20:28 MTDiscord I don't know why I would be going through 150 lines of computing node collision boxes just to then shittily approximate the player box which Minetest gives me for free ๐Ÿ˜† 20:28 MTDiscord Using luatic's code ... pros: does what it says pretty well, and even handles a ton of corner cases you probably hadn't thought of. cons: now your project looks like it's been written by a compulsive overengineerer. 20:28 MTDiscord remember me I still have that weight balanced tree in modlib 20:28 MTDiscord reminds me* 20:28 MTDiscord hmm, the idea of weight-balanced anything in modlib sounds pretty ironic... 20:29 MTDiscord I don't know if it's actually weight balanced though, I never tested that 20:29 MTDiscord I just tested that it worksโ„ข๏ธ 20:29 MTDiscord I never checked the weight balance invariant ๐Ÿ’€ 20:29 MTDiscord whatever, B-Trees are superior anyways 20:29 MTDiscord I can match the performance of Python's sorted containers lib using them 20:29 MTDiscord (in pure Lua, that is) 20:34 Peter_Lankton cool it works! though i could not help but notice there is no license on the disable_build_where_they_stand repo. 20:37 MTDiscord ah, upgrade to triple-oof then. 20:45 Peter_Lankton hmm. also seems to make scaffolding impossible. dunno if thats the right term. but that thing where you hold shift on the side of a edge and place a node under you to build a bridge. cant do that now with the dwbts mod. 21:28 MinetestBot 02[git] 04rubenwardy -> 03minetest/minetest: Fix shadows dropdown and clean up shader settings (#13481) 13bc4fc6d https://github.com/minetest/minetest/commit/bc4fc6d6483d37de7703374ce1ade213ff354ec7 (152023-05-03T21:28:02Z)