Minetest logo

IRC log for #minetest, 2023-05-03

| Channels | #minetest index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
00:07 duds` joined #minetest
00:07 Peter_Lankton joined #minetest
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.
00:37 Guest87 joined #minetest
00:40 duds` joined #minetest
00:54 Alnotz joined #minetest
01:09 Lesha_Vel joined #minetest
01:14 duds` joined #minetest
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:17 smk joined #minetest
01:29 Sven_vB joined #minetest
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 duds` joined #minetest
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:50 YuGiOhJCJ joined #minetest
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:06 Sven_vB joined #minetest
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:07 Peter_Lankton left #minetest
02:09 muurkha byee
02:16 Trifton joined #minetest
02:26 duds` joined #minetest
03:03 duds` joined #minetest
03:43 duds` joined #minetest
03:47 peterz joined #minetest
04:00 MTDiscord joined #minetest
04:12 peterz joined #minetest
04:16 peterz joined #minetest
04:19 duds` joined #minetest
04:49 Lesha_Vel joined #minetest
04:53 duds` joined #minetest
05:43 calcul0n joined #minetest
06:05 appguru joined #minetest
06:14 duds` joined #minetest
06:38 TomTom_ joined #minetest
07:32 appguru joined #minetest
07:55 duds` joined #minetest
08:19 mrkubax10 joined #minetest
08:21 Thelie joined #minetest
08:29 duds` joined #minetest
08:44 imi joined #minetest
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:03 duds` joined #minetest
09:09 Thelie joined #minetest
09:32 MTDiscord <luatic> 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 <luatic> ah nevermind that was unrelated apparently
09:33 MTDiscord <luatic> btw raycast uses the selectionbox, not the collisionbox, so yeah, that doesn't work
09:38 duds` joined #minetest
09:46 appguru joined #minetest
10:00 sys4_ joined #minetest
10:39 mrkubax10 joined #minetest
10:44 proller joined #minetest
10:53 mrkubax10 joined #minetest
11:16 pomup joined #minetest
11:40 appguru joined #minetest
12:06 Alnotz joined #minetest
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
13:27 sparky4 joined #minetest
14:46 definitelya joined #minetest
15:00 An[m]1 left #minetest
15:28 Thelie joined #minetest
15:30 proller joined #minetest
15:40 debiankaios joined #minetest
15:58 mrkubax10 joined #minetest
17:04 Peter_Lankton joined #minetest
17:05 meldrian_ joined #minetest
17:05 potatoxel[m]1 joined #minetest
17:05 cation_ joined #minetest
17:05 Thermoriax joined #minetest
17:06 Thermoriax joined #minetest
17:06 A_Dragon joined #minetest
17:06 Talkless joined #minetest
17:06 vintprox[m] joined #minetest
17:08 pounce joined #minetest
17:09 lebruhgamer[m] joined #minetest
17:10 Fleckenstein[m] joined #minetest
17:10 tel1 joined #minetest
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.
18:33 illwieckz joined #minetest
18:44 ___nick___ joined #minetest
18:55 meldrian joined #minetest
19:30 ___nick___ joined #minetest
19:33 ___nick___ joined #minetest
20:12 Trifton joined #minetest
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 <luatic> Peter_Lankton: raycasts are the wrong tool anyways
20:14 MTDiscord <luatic> you probably want box-box collisions, which are pretty simple to implement
20:15 Peter_Lankton yeah that would be better.
20:15 MTDiscord <luatic> 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 <luatic> I had considered implementing this but ultimately considered it pointless
20:15 MTDiscord <luatic> normal players can get stuck in nodes just as well if they are able to dig or place them locally
20:16 MTDiscord <luatic> so checking for collision unfortunately isn't reliable and distinguishing noclipping from "regular" glitching becomes pretty much impossible
20:17 MTDiscord <luatic> anti noclip + only considering nodes not diggable/placable by the players + dbwts may work reasonably well though
20:18 MTDiscord <luatic> 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 proller joined #minetest
20:20 MTDiscord <luatic> I don't like that minetest.after loop
20:21 MTDiscord <luatic> 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 <Warr1024> 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 <luatic> 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 <luatic> (dwbts is short for disable_build_where_they_stand)
20:22 MTDiscord <Warr1024> 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 <Warr1024> (dwbts is short for disable_where_build_they_stand)
20:23 MTDiscord <luatic> oof
20:23 MTDiscord <luatic> double oof, I replied to the wrong message (at least IRC peeps can't see this)
20:23 MTDiscord <luatic> anyways you don't need coarse stepping for that
20:23 MTDiscord <Warr1024> I don't need coarse stepping, but it makes it work nice and cheatp
20:24 MTDiscord <luatic> you can always get the next node by intersecting with the next 3 axis parallel grid planes
20:24 MTDiscord <luatic> 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 <Warr1024> 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 <luatic> it is very manageable, I wrote the code but didn't test it
20:25 MTDiscord <luatic> it's like 30 lines?
20:25 MTDiscord <luatic> these planes are all axis parallel, so computing the intersection points is pretty trivial
20:26 MTDiscord <Warr1024> 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 <luatic> 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 <luatic> 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 <luatic> (whatever it was called)
20:26 MTDiscord <Warr1024> 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 <luatic> Peter_Lankton: Of course it does. My code is perfect.
20:27 Peter_Lankton well i will give it a shot
20:28 MTDiscord <luatic> 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 <Warr1024> 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 <luatic> remember me I still have that weight balanced tree in modlib
20:28 MTDiscord <luatic> reminds me*
20:28 MTDiscord <Warr1024> hmm, the idea of weight-balanced anything in modlib sounds pretty ironic...
20:29 MTDiscord <luatic> I don't know if it's actually weight balanced though, I never tested that
20:29 MTDiscord <luatic> I just tested that it works™️
20:29 MTDiscord <luatic> I never checked the weight balance invariant 💀
20:29 MTDiscord <luatic> whatever, B-Trees are superior anyways
20:29 MTDiscord <luatic> I can match the performance of Python's sorted containers lib using them
20:29 MTDiscord <luatic> (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:36 Trifton joined #minetest
20:37 MTDiscord <Warr1024> 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.
20:56 appguru joined #minetest
21:28 MinetestBot [git] rubenwardy -> minetest/minetest: Fix shadows dropdown and clean up shader settings (#13481) bc4fc6d https://github.com/minetest/minetest/commit/bc4fc6d6483d37de7703374ce1ade213ff354ec7 (2023-05-03T21:28:02Z)
22:11 Peter_Lankton left #minetest
22:18 illwieckz joined #minetest
22:37 panwolfram joined #minetest
23:51 Lesha_Vel joined #minetest
23:51 Charbomber joined #minetest

| Channels | #minetest index | Today | | Google Search | Plaintext