Very strange mimic #5334

Closed
opened 2023-09-28 16:20:39 +00:00 by Boot · 5 comments
Member

A Mimic disguised as cottages:feldweg_s_45_coniferous has surprising characteristics. She is more sluggish than others, ignores for a long time, but after a while she becomes aggressive too. You can't see their HP, and especially you can't beat them. However, it gets in the way physically.

A Mimic disguised as cottages:feldweg_s_45_coniferous has surprising characteristics. She is more sluggish than others, ignores for a long time, but after a while she becomes aggressive too. You can't see their HP, and especially you can't beat them. However, it gets in the way physically. ![](https://gitea.your-land.de/attachments/7af8b6c0-ff9e-431d-80ef-482dead15ed5)
Author
Member

Alias is doing some research and asked me to report the issue here to add his research later.

Alias is doing some research and asked me to report the issue here to add his research later. ![](https://gitea.your-land.de/attachments/52e56f9b-cda8-4a07-8907-c1be4ac366ea)
AliasAlreadyTaken added the
1. kind/bug
3. source/integration
labels 2023-09-29 22:24:04 +00:00
flux added this to the flux's TODO list project 2023-11-04 18:09:25 +00:00
flux added
3. source/mod upstream
and removed
3. source/integration
labels 2023-11-04 18:09:38 +00:00
Member

i don't think this is an integration issue so much as a bug in the mime code, though i haven't figured out exactly what's going on here.

the problem is that mimes imitating feldweg nodes are somehow getting the wrong selection box.

the relevant section of the code is here: 9e69b5da2c/core/procedures.lua (L230-L239)

		self.object:set_properties({
			visual = "mesh",
			textures = node_def.tiles,
			use_texture_alpha = use_texture_alpha,
			mesh = node_def.mesh,
			collisionbox = node_def.collision_box or { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
			selectionbox = node_def.selection_box or { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5, rotate = true },
			visual_size = { x = scale, y = scale, z = scale },
			itemname = nil,
		})

the cottages feldweg nodes (not just the s_45 variants) don't define a selection box, so the lua API gives them a default value, which is

{type = "regular"}

however, when inspecting affected mimes, the selection box appears as follows:

{0, 0, 0, 0, 0, 0, rotate="true"}

which means you can't point at them (unless you somehow lined up your cursor perfectly, maybe?)

i don't think this is an integration issue so much as a bug in the mime code, though i haven't figured out exactly what's going on here. the problem is that mimes imitating feldweg nodes are somehow getting the wrong selection box. the relevant section of the code is here: https://github.com/fluxionary/minetest-mobs_mime/blob/9e69b5da2c352d19a94d2225b0e8c5db85323c33/core/procedures.lua#L230-L239 ```lua self.object:set_properties({ visual = "mesh", textures = node_def.tiles, use_texture_alpha = use_texture_alpha, mesh = node_def.mesh, collisionbox = node_def.collision_box or { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, selectionbox = node_def.selection_box or { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5, rotate = true }, visual_size = { x = scale, y = scale, z = scale }, itemname = nil, }) ``` the cottages feldweg nodes (not just the s_45 variants) [don't define a selection box](https://github.com/Sokomine/cottages/blob/dbe69bcfafa2efc256554b9fa3b9196b35928f1e/nodes_feldweg.lua#L269-L279), so the lua API gives them a default value, which is ```lua {type = "regular"} ``` however, when inspecting affected mimes, the selection box appears as follows: ```lua {0, 0, 0, 0, 0, 0, rotate="true"} ``` which means you can't point at them (unless you somehow lined up your cursor perfectly, maybe?)
Member

oh, i see. apparently selectionbox of an entity is not the same structure as the selection_box of a node. silly me for assuming consistency.

oh, i see. apparently `selectionbox` of an entity is not the same structure as the `selection_box` of a node. silly me for assuming consistency.
Member

fixed via adding some code to futil db364b557a and making the mimes use it bd03e3ccc0

fixed via adding some code to futil https://github.com/fluxionary/minetest-futil/commit/db364b557a8c9a8abda78960b0ad6da5dcb45627 and making the mimes use it https://github.com/fluxionary/minetest-mobs_mime/commit/bd03e3ccc0a9cd910a73c83c889c429cb6e9b20c
flux added the
4. step/ready to QA test
label 2023-11-04 21:49:22 +00:00
AliasAlreadyTaken added this to the 1.1.122 milestone 2023-11-05 04:01:23 +00:00
AliasAlreadyTaken added the
ugh/QA OK
label 2023-12-03 21:48:16 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-12-17 23:57:38 +00:00
flux removed this from the flux's TODO list project 2023-12-17 23:57:41 +00:00
Member

this is live

this is live
flux closed this issue 2023-12-17 23:57:46 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#5334
No description provided.