Jump to content

Walking in Instances off the rs map


Recommended Posts

Posted (edited)

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
Posted
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?

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