Skip to content

ShardSpace

class ShardSpace(
val shard: Int,
private val source: ShardTerrainSource = ShardTerrainSource.CacheRegions
)
Example
on_object_option(Assets.WorldObject.poordoor, "Look-through") { player ->
val space = World.spatial.space(player.shardId)
val here = player.tile4.tile
val objects = space.objectsAt(target.tile4.tile)
player.message(if (space.raycast(here, target.tile4.tile)) "You see ${objects.size} things there." else "Something is in the way.")
}
val shard: Int
val instanceMap: InstanceMap?
fun placeNpc(
index: Int,
packedTile: Int
)
fun removeNpc(index: Int)
fun placeProjection(
index: Int,
packedTile: Int
)
fun removeProjection(index: Int)
fun placeTransient(
entity: Entity,
packedTile: Int
)
fun relocateTransient(
entity: Entity,
oldPacked: Int,
newPacked: Int
)
fun removeTransient(
entity: Entity,
packedTile: Int
)
fun globTransientsWithinRings(
centerPacked: Int,
maxRings: Int,
visit: (Entity) -> Unit
)
fun collisionFlag(
x: Int,
z: Int,
height: Int,
viewer: Int = NO_VIEWER
): Int
fun canTraverse(
height: Int,
x: Int,
z: Int,
dx: Int,
dz: Int,
size: Int = 1,
extraFlag: Int = 0,
strategy: CollisionStrategy = CollisionStrategy.Normal,
viewer: Int = NO_VIEWER
): Boolean
fun canTraverse(
from: Tile3,
dir: Direction,
strategy: CollisionStrategy = CollisionStrategy.Normal,
viewer: Int = NO_VIEWER
): Boolean
fun isClipped(
tile: Tile3,
viewer: Int = NO_VIEWER
): Boolean
fun worldItemAt(
tile: Tile3,
id: Int
): WorldItem?
fun objectAt(
tile: Tile3,
slot: Int,
viewer: Int = NO_VIEWER
): WorldObject?
fun objectsAt(
tile: Tile3,
viewer: Int = NO_VIEWER
): List<WorldObject>
fun objectsAt(
tile: Tile3,
observer: Actor
): List<WorldObject>
fun sweepTransientObjects()
fun raycast(
from: Tile3,
to: Tile3,
viewer: Int = NO_VIEWER
): Boolean
val DYNAMIC_BITS: IntArray
const val NO_VIEWER: Int = -1
const val OVERLAY_VIEW_RADIUS: Int = 3