Jump to content

Entity Attributes change upon Resurgence?


dungeonqueer

Recommended Posts

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?

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

  • Alek locked and unlocked this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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