Jump to content

Walking in Instances off the rs map


k9thebeast

Recommended Posts

Your problem is that instances are loaded at random coordinates in the instance grid. If the instance is small, I would recommend working with Local Positions (found by getLocalPosition methods). This is the position relative to the current map base. When time comes to walk to a position, translate your desired local position to an absolute position by adding the map base position to it (Map#getBaseX/Y).

If your instance is very large (eg. walking around in the instance triggers region loading), then you'll have to use a different approach. Commonly people select some object in the instance as the 'Anchor position' similar to how we can use the map base in small instances. Translating positions based on the absolute position of this anchor entity.

Edited by FrostBug
  • Like 4
  • Boge 1
Link to comment
Share on other sites

22 hours ago, FrostBug said:

Your problem is that instances are loaded at random coordinates in the instance grid. If the instance is small, I would recommend working with Local Positions (found by getLocalPosition methods). This is the position relative to the current map base. When time comes to walk to a position, translate your desired local position to an absolute position by adding the map base position to it (Map#getBaseX/Y).

If your instance is very large (eg. walking around in the instance triggers region loading), then you'll have to use a different approach. Commonly people select some object in the instance as the 'Anchor position' similar to how we can use the map base in small instances. Translating positions based on the absolute position of this anchor entity.

Can you give some example?

Link to comment
Share on other sites

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...