Time Nick Message 05:52 lissobone It works. 05:52 lissobone I have tried a different method of calculating its position on the radar, because the angle between two vectors cannot exceed 180 degrees (or 1 pi radians). 05:53 lissobone Now I just shrunk the vector that points from the hunter to the huntee and made its length 1, and its coordinates are the point coordinates themselves. 05:54 lissobone The y and x coordinates match the expectations, but only if the hunter is looking directly north. This high time for me to utilize the rotation matrix. 05:56 lissobone This is high time*. 07:45 MTDiscord Why would you need a rotation matrix? 08:12 pgimeno it's an easy way to find the signed angle; lissobone wants the angle of a vector relative to another, not the angle between two vectors 08:22 Oblomov atan2? 15:41 MTDiscord "angle of a vector relative to another, not the angle between two vectors" <-- what does this even mean? 15:42 rubenwardy I'm guessing that the former means the difference between two normalised vectors 15:43 rubenwardy the latter is single number, the angle between two vectors on their shared plane 15:43 rubenwardy or maybe they mean the angle to a position from a nother position? 15:44 rubenwardy who knows 15:44 MTDiscord They're asking for an angle in both cases. It's like "no, dammit, I don't want to know the vector's magnitude, I just want to know how long it is." 15:45 rubenwardy they probably meant rotation 15:45 rubenwardy these sorts of questions need diagrams 15:47 MTDiscord haha, true.dat 17:57 MTDiscord Well, it seems lissobone wants to project onto 2D first of all ("radar"). Then the relative position of the huntee to the hunter can be described as an angle angle = math.atan(rel_pos_z, rel_pos_x) and a magnitude dist = math.sqrt(rel_pos_x^2 + rel_pos_z^2). The yaw of the player can be found using yaw = player:get_look_horizontal(). To make the angle relative to the player rotation, simply inversely apply the player yaw by subtracting it 17:57 MTDiscord from the angle angle = angle - yaw. Then the orientation-relative new pos is pos_x, pos_z = math.cos(angle) * dist, math.sin(angle) * dist. This can be done using matrices but isn't necessary for 2D. I might have messed up some signs / orientations here. 18:05 MTDiscord Hmm, the matrices thing is supposed to be "simpler" and more uniform regardless of dimensions, but it takes more up-front work to figure out the more complex math behind it. Doing the yaw/dist thing involves more mathy bits, but each bit is smaller. In this case, yeah, angle/distance is what I'd do (or even angle/dist^2) 18:06 MTDiscord I think you might want atan2 instead of atan, though, maybe? One of them handles the discontinous orthogonal case properly, as well as quadrant-disambiguation. 18:13 lissobone I have released the mod. 18:14 Desour wanna post a link so we know what you meant with the angle from one vector to another thing? lissobone 18:15 lissobone https://content.minetest.net/packages/LissoBone/manhunt/ 18:15 lissobone I discarded the vector angle solution. 18:15 lissobone An angle between two vectors cannot exceed 180 degrees. 18:15 lissobone That's why I used something I wasn't taught in school. 18:17 lissobone And the screenshots are old, the radar now is supposed to appear on the left due to some limitations I faced while making the HUD (different display resolution resulted in a highly unwanted red dot shift). 18:25 lissobone I am back. 18:29 MTDiscord Right, an angle between 2 vectors cannot exceed 180 degrees, the same way you cannot be looking farther away from something than the exact wrong direction 18:32 lissobone The matrices thing works fine, the compass now points directly at the speedrunner (it updates itself every few seconds, just like a real radar). 18:32 lissobone The only things that bother me now are: 18:32 lissobone Somewhat messy code. 18:32 lissobone HUD remains even when the hunter drops their radar. 18:33 lissobone And also the third very important thing which I forgot about. 18:33 lissobone Oh, yeah, the radar hud looks horrible. 18:34 lissobone It's just an edited and upscaled version of the item icon. 18:36 lissobone It could've been better, but the upper arc looks legitimately terrible where it bends down and then connects with the main body. 18:38 lissobone I just need to pass something like activate_closure(itemstack, player) and minetest.item_drop(itemstack, player, player:get_player_pos()) to the on_drop variable in the item registration. 18:38 lissobone Activate closure. 18:39 lissobone Deactivate windows. 18:40 lissobone I don't know why is "deactivate windows" so funny. 18:43 Desour because in the real world, you let windows deactivate all by itself over time 18:43 lissobone Well, that's technically true. 18:43 lissobone Not only technically, but factually true. 18:44 Desour deactivate itself ...* 18:44 MTDiscord https://github.com/MrGlockenspiel/activate-linux 18:45 lissobone Does windows actually deactivate itself over tiInterrupted. What the [Fifty-percent off!] is that? 18:45 lissobone Well, where is "deactivate linux"? 18:57 lissobone Now I've got a question if it's possible to remove the HUD and then drop the device on the ground. 18:58 lissobone Well, it's definitely possible, but my last attempt only generated unlimited radars. 18:58 lissobone How to simulate a natural item dropping process? 18:59 lissobone As if it was dropped with the default settings. 18:59 lissobone (default settings = untouched on_drop). 19:05 lissobone minetest.item_drop drops the switched off radar, but, for some reason, even after removing it directly, a switched on one remains. 19:10 lissobone I might be doing something wrong. 19:11 lissobone To solve the problem, I shall start from the very beginning of the issue_resolution_process. 19:24 Desour player:set_wielded_item(minetest.item_drop(player:get_wielded_item(), player, ...) 19:24 Desour something like that