Jump to content

Object reference becomes irrelevant when reloading, how to?


Botre

Recommended Posts

Ok, so I have an Entity variable holding the value of an entity (not null). 

When I walk away far enough or teleport away, this variable's value becomes irrelevant: when you walk back to the initial Entity the value does not refer to that same Entity anymore (I doesn't refer to anything anymore actually). I suppose this is because the game reloads and a new reference is given, if I'm wrong about this please inform me :)

 

Is there a way to store the initial value so that it does not become irrelevant whenever an entity is reloaded? I'm thinking about storing data of the initial Entity and then re-scanning for that data, but kinda hoping for a better solution :p

  • Like 1
Link to comment
Share on other sites

The way our wrapper system works is simply to wrap the client's reference of the entity. Unfortunately because of the way the RuneScape game engine works, there exists the situation which you have described. If it's a player or npc, you can call .getIndex() to get the player or npc's index on the client's global list. For objects you can do .getUID() to get the unique hash of the object. 

  • Like 3
Link to comment
Share on other sites

The way our wrapper system works is simply to wrap the client's reference of the entity. Unfortunately because of the way the RuneScape game engine works, there exists the situation which you have described. If it's a player or npc, you can call .getIndex() to get the player or npc's index on the client's global list. For objects you can do .getUID() to get the unique hash of the object. 

 

Ah beast! Exactly what I was looking for :D

ty!

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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