NpcAvatarDetails

An internal class holding the state of NPC's avatar, containing everything that is sent during the movement from low to high resolution.

Constructors

Link copied to clipboard
constructor(index: Int, id: Int, level: Int, x: Int, z: Int, spawnCycle: Int = 0, direction: Int = 0, allocateCycle: Int)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

the current coordinate of the npc

Link copied to clipboard

the direction that the npc is facing when it is first added to high resolution view

Link copied to clipboard

the direction of the first step that the npc has taken this cycle, or -1

Link copied to clipboard
var id: Int

the id of the npc in the world

Link copied to clipboard

whether the npc is inaccessible to all players, meaning it will not be added to high resolution for anyone, even though it is still within the zone. This is intended to be used with static npcs that respawn. After death, inaccessible should be set to true, and when the npc respawns, it should be set back to false. This allows us to not re-allocate avatars which furthermore requires cleanup and micromanaging.

Link copied to clipboard
var index: Int

the index of the npc in the world

Link copied to clipboard

the bitpacked flag of all the movement typed the npc has utilized this cycle

Link copied to clipboard

the direction of the second step that the npc has taken this cycle, or -2

Link copied to clipboard

the game cycle on which the npc was originally spawned into the world

Link copied to clipboard

the number of steps the npc has taken this cycle

Functions

Link copied to clipboard

Whether the npc is tele jumping, meaning it will jump over to the destination coord, even if it is just one tile away.

Link copied to clipboard

Whether the npc is teleporting. This means the npc will render as jumping if the destination is 2 tiles away, and normal walk/run/in-between if the distance is 2 tiles or less.

Link copied to clipboard

Whether the npc is teleporting, but not explicitly jumping.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun updateDirection(direction: Int)

Updates the current direction of the npc, allowing the server to sync up the current faced coordinate of npcs during movement, face angle and such.