Integrated Dynamics

Integrated Dynamics

63M Downloads

Materializing an entity variable has surprising behavior

FallenEagle1 opened this issue ยท 10 comments

commented
  • ๐Ÿ› Bug

Short description:

This was first found while in the modpack atm3, then tested with just ID and dependencies.
While playing around with the materiallizer, found a bug when trying to make a static variable of a item dropped on the ground. I have a entity reader, and a materiallizer with an entity variable from the reader in it. Drop an item in front of the reader, then make a static variable of the entity in the materiallizer. It shows up on the variable as you would expect, but when the item is picked up, the static variable always reads unknown and it cant be used for any other operations. If a player is used instead of an item, it works.

Expected behaviour:

Entity items on a static variable persist after picking up the said item.

Actual behaviour:

Static variable card loses entity item information.

Steps to reproduce the problem:

  1. Place materiallizer and entity reader on a network.
  2. Get either an entity or an entity list variable from the entity reader.
  3. Through any item with any amount on the ground in front of the reader.
  4. Place entity variable into the materiallizer and place another variable in to get a static variable of the entity items.
  5. Verify the static variable has the items, pick said items up and the static variable changes to unknown.

Versions:

  • This mod: 1.12.2-0.11.0
  • CyclopsCore: 1.12.2-0.11.2
  • Minecraft: 1.12.2
  • Forge: 14.23.2.2611
commented

This is not a bug. The moment when you pick up the item entity, the entity stops existing, which is why the materialized entity will be unknown. You can see this by looking at the entity ID.

What you want to do is materialize the item inside the item entity.

commented

This isn't intuitive. I'm going to rescope this to be about making this behavior less surprising.

commented

Two ideas come to mind:

  1. Don't let entity variables be materialized at all
  2. When an entity variable is materialized, disconnect it from the entity, take a snapshot of all visible information, and store that instead
commented

The functionality makes sense now that I know of it, but was surprising when trying to get familiar with the mod. The thought process was to have a static variable to compare against what was on the ground to figure out whether or not to pulse redstone. So biggest thing was to have a easy way to check what was on the ground. I'll be going about it a different way; I have an idea already for that.

commented

In any case, it would be good if the current behaviour would be explained better in the manual.

commented

Another person has just ran into this: https://www.reddit.com/r/feedthebeast/comments/816fam/question_about_integrated_dynamics_materializer/

reddit
Question about Integrated Dynamics Materializer โ€ข r/feedthebeast
I'm started to play around with the Integrated Dynamics mod and cant figure out of I'm just misunderstanding something or if I've come across a...
commented

@jamescheetham You need to map your list of entities to items using the operator to get the item from an entity (I don't remember the name), then you'll have a list of items that you can work with.

commented

What you want to do is materialize the item inside the item entity.

How? I'm trying to have an entity reader read the items that are in front of it. I can't put an item directly into the interface for the materializer. I can create an Item variable through the logic programmer, and while I can insert that into the materlizer, it doesn't seem to create anything that is any different to the original.

I'm aware that I can achieve what I'm trying by using the Entity output rather than the Entities List output, but the first will only work iff there are exactly two items that I expect.

I can use the Get option to pull an element from a list, but it will only work if there is currently an entity for the reader, other wise I get an index out of bounds error.

I can't seem to get the getOrDefault to work as it insists on feeding it an entity, but I can't seem to see how to do that.

I'd like to say that I think that this is a great mod with a lot of power, but there are some useability aspects that are lacking.

commented

This video might help with getting this to work without requiring the materialization of Entities: https://youtu.be/NgBbJSObrmE

What seems to be happening if you try is that the Entity object is made permanent, however its contents (the Item) are not and you end up with an Entity pointing to an "unknown" Item.

Best to use the Operator and Map functions as mentioned above to convert the list of Entities into a list of Items, and then work from there. (As I demonstrate in the video.)

YouTube
This tutorial is about using Integrated Dynamics and its add-on Integrated Tunnels to control item drops. In this example tutorial that not only shows the st...
commented

Just ran into this issue with player entities; was trying to materialise a player entity variable to use as the default in a getOrDefault to prevent stuff from breaking when a player goes offline. Because the materializer stores the reference to the entity instead of the entity data statically, this doesn't work as expected.