rift.world
AreaBoundsAreaRectAreaRefCollisionFlagCollisionStrategyCollisionStrategyBlockedCollisionStrategyIndoorsCollisionStrategyLineOfSightCollisionStrategyNormalCollisionStrategyOutdoorsCollisionViewCopiedSpaceDirectionEngineEntityListIdleTimeoutsInstanceMapLockLevelNodeRefNodeScriptNodeScriptsRecordCollectionRecordUnrestoredRecordsReadScenePlaceScenePlacesShardSpaceSpaceCopySpaceSelectionSpaceZoneSpacesStepStepDirectionStepTypeTile3Tile4WorldWorldObjectShapeWorldRecordsWorldSpatialIndex
Functions
Section titled “Functions”entitiesWithin
Section titled “entitiesWithin”inline fun <reified T : Entity> WorldSpatialIndex.entitiesWithin( center: Tile3, radius: Int, shard: Int = WorldSpatialIndex.GLOBAL, noinline predicate: (T) -> Boolean = { true }): List<T>
fun WorldSpatialIndex.entitiesWithin( center: Tile3, radius: Int, vararg types: KClass<out Entity>, shard: Int = WorldSpatialIndex.GLOBAL, predicate: (Entity) -> Boolean = { true }): List<Entity>on_input<DeveloperCommandInput> { player -> if (name != "near") return@on_input val here = player.tile4 val near = World.spatial.entitiesWithin<Entity>(here.tile, radius = 5, shard = here.shard) player.message("${near.size} things within 5 tiles.")}npcsWithin
Section titled “npcsWithin”fun WorldSpatialIndex.npcsWithin( center: Tile3, radius: Int, shard: Int = WorldSpatialIndex.GLOBAL, predicate: (Npc) -> Boolean = { true }): List<Npc>on_npc_option(Assets.Npc.hans.id, "Shout") { player -> val here = target.tile4 val goblins = World.spatial.npcsWithin(here.tile, radius = 8, shard = here.shard) goblins.forEach { it.speak("Coming!") }}placeRecoveredKey
Section titled “placeRecoveredKey”fun placeRecoveredKey(): Stringon_event<PlaceRecovered>(placeRecoveredKey()) { subject -> Logger.info("${subject.uuid} was moved off its saved tile")}playersWithin
Section titled “playersWithin”fun WorldSpatialIndex.playersWithin( center: Tile3, radius: Int, shard: Int = WorldSpatialIndex.GLOBAL, predicate: (Actor) -> Boolean = { true }): List<Actor>on_object_option(Assets.WorldObject.poordoor, "Ring-bell") { player -> val here = target.tile4 World.spatial.playersWithin(here.tile, radius = 10, shard = here.shard).forEach { it.message("Someone is at the door.") }}projectionsWithin
Section titled “projectionsWithin”fun WorldSpatialIndex.projectionsWithin( center: Tile3, radius: Int, shard: Int = WorldSpatialIndex.GLOBAL, predicate: (WorldProjection) -> Boolean = { true }): List<WorldProjection>on_input<DeveloperCommandInput> { player -> if (name != "boats") return@on_input val here = player.tile4 val boats = World.spatial.projectionsWithin(here.tile, radius = 30, shard = here.shard) player.message("${boats.size} world projections within 30 tiles.")}Properties
Section titled “Properties”worldNumber
Section titled “worldNumber”val worldNumber: Inton_login { player -> player.message("Welcome to realm $worldNumber.")}worldRecords
Section titled “worldRecords”val RiftPackage.worldRecords: WorldRecordsimport rift.ecs.Persistimport rift.ecs.Persistent
@Persistent class Signature(@Persist val text: String = "")
on_object_option(Assets.WorldObject.poordoor, "Sign") { player -> val book = Game.worldRecords.collection<Signature>() book.put(player.uuid.toString(), Signature("Was here.")) player.message("You sign the guestbook (${book.keys().size} signatures).")}