Jump to content

Entity Attributes change upon Resurgence?


Recommended Posts

Posted

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?

Posted

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. 

  • Alek locked and unlocked this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...