Character location when zoning
Posted: Thu Apr 21, 2016 11:39 am
I am having some problems with a really trivial detail.
When a character zones between chunks, they are set with an IsZoning() flag until they are established in the next chunk. If you watch the character's location, after the flag has been removed they will still show a location from the previous zone (but the correct chunk now), and then at times an additional location that is different, but still in the previous zone, and then eventually they will show their coordinates in the new zone.
The reason this matters:
When a character with a pet zones, the pet will notice that their owner is no longer in the same chunk through their movement AI. They will then be removed from the previous chunk and added to the new chunk. They also need to be placed in the same location as the character. This means that right now, even after the character has completed their shift into the next chunk, for several cycles the location is invalid; it is from the last chunk, so the pet might be sent all the way across the zone to the other border.
The only solutions are to wait some specified period of time before moving the pet to the new location (to make sure it is correct), or to warp the pet if it is particularly far away from the owner. The second option is not really ideal and more of a workaround, and the first is a little messy, as in 'how long do we wait?'. If anyone understands the zoning mechanics a little better and can find out why after the character has zoned it takes a second or two to start showing the correct character location, I'd be glad to know, and perhaps we can fix it.
When a character zones between chunks, they are set with an IsZoning() flag until they are established in the next chunk. If you watch the character's location, after the flag has been removed they will still show a location from the previous zone (but the correct chunk now), and then at times an additional location that is different, but still in the previous zone, and then eventually they will show their coordinates in the new zone.
The reason this matters:
When a character with a pet zones, the pet will notice that their owner is no longer in the same chunk through their movement AI. They will then be removed from the previous chunk and added to the new chunk. They also need to be placed in the same location as the character. This means that right now, even after the character has completed their shift into the next chunk, for several cycles the location is invalid; it is from the last chunk, so the pet might be sent all the way across the zone to the other border.
The only solutions are to wait some specified period of time before moving the pet to the new location (to make sure it is correct), or to warp the pet if it is particularly far away from the owner. The second option is not really ideal and more of a workaround, and the first is a little messy, as in 'how long do we wait?'. If anyone understands the zoning mechanics a little better and can find out why after the character has zoned it takes a second or two to start showing the correct character location, I'd be glad to know, and perhaps we can fix it.