dungeonqueer Posted September 29, 2017 Share Posted September 29, 2017 An Entity is a general representation of an object in-game, it seems. Through a GUI, I would have a user select objects containing a specified interaction, which would then be stored as Entities for later use. Considering an Entity has basic info on the model, its height, size, position, and extends other interfaces that contain its actions, id, and such, I assumed that it would be a safe way of storing them. When the process continues, however, and the resource depletes and returns, the user no longer targets the object to gather resources. So the question here is, how is one meant to store objects so that, once it disappears and returns, it still notices it as the same object. Would this entail creating a custom Object with Position and id attributes solely? Quote Link to comment Share on other sites More sharing options...
Alek Posted September 30, 2017 Share Posted September 30, 2017 Your understanding of Entity is not correct. An entity is not a representation, it's a reference to the generic object in game. This means when the entity is destroyed, so is the reference. When a new entity is created, so is a new reference. This is not so readily apparent because in Java everything is a value, and there is no way to represent a reference. Also an Entity is an interface between all the entities, ensure you arent object slicing if you are storing the object as an entity versus NPC, RS2Object, etc. I italicized some key words that you can Google if you need a further explanation. Quote Link to comment Share on other sites More sharing options...