Skip to content

WorldSpatialIndex

class WorldSpatialIndex
Example
on_input<DeveloperCommandInput> { player ->
if (name != "look") return@on_input
val here = player.tile4
val npcs = World.spatial.npcsWithin(here.tile, radius = 8, shard = here.shard)
val objects = World.spatial.objectsAt(here.tile, shard = here.shard)
player.message("${npcs.size} NPCs near you, ${objects.size} world objects under you.")
}
fun space(shard: Int): ShardSpace
fun shardSpaceOrNull(shard: Int): ShardSpace?
fun isShardAllocated(shard: Int): Boolean
fun allocatedShards(): IntArray
fun instanceMap(shard: Int): InstanceMap?
fun objectsAt(
tile: Tile3,
shard: Int = GLOBAL,
viewer: Int = ShardSpace.NO_VIEWER
): List<WorldObject>
fun worldItemAt(
tile: Tile3,
id: Int,
shard: Int = GLOBAL
): rift.entities.WorldItem?
const val GLOBAL: Int = 0