KCDS 0.2.1

0.2.1 gives server scripts the world around the players: the clock and the weather, props, carts, particle effects, ground markers, the level's doors, chests with locks, edits of the level, siege engines with ladders and stones, rays, camera shots and placement previews. Everything a script places is seen the same by every player, and a player who joins late gets all of it when the world loads.

Servers need the 0.2.1 server as well. The launcher updates itself to 0.2.1 on the next start.

Highlights

  • World clock and weather (#65). World.setTime, setHour, setTimeScale and World.setWeather(preset, seconds) set the game's own clock and sky for everyone. Checked live with 3 clients: night, noon and a storm on every screen.
  • Props, carts and effects (#66, #67, #68). Prop.spawn(model, ...), Cart.spawn(...) and Vfx.spawn(...) / Vfx.burst(...) place the game's meshes, wagons and particle effects.
  • Doors (#73). The level's doors are the server's: Door.find, door.setOpen, door.locked, and the doorInteract event when a player works one.
  • Siege (#74, #75). Trebuchets and cannons that load, aim and fire, siege ladders and stone piles, with damage decided on the server.

World

  • Clock (#65): the time, the hour and its speed (0 stops it) for every player; a correction about once a minute while it runs.
  • Weather (#65): World.setWeather(preset, seconds) blends the game's sky to a preset of the game, for example cloudless_sunny, semicloudy_clear, cloudy_no_rain, cloudy_frequent_showers, summer_overcast, foggy_drizzly, foggy_storm and foggy_storm_no_rain (each also with _B, some with _C). A name the game does not know leaves the sky as it is. Wind travels with it; the rain follows the preset.
  • Areas (#71): script areas with enter and exit events, decided on the server.
  • Level edits (#70): LevelEdit.apply({ kind: 'entity', guid, at, hidden }) hides or moves an object the level placed, for every player; restoreAll() puts it back. Checked live on a door: hidden and back again on every screen.

Things in the world

  • Props (#66): any mesh of the game with a pose, a scale and a static or rigid body.
  • Carts (#67): the game's wagons with seats; the driver leads them.
  • Effects (#68): particle effects from the catalog, placed or played once (also on a player or an NPC).
  • Markers (#69): Marker.place(material, position, { size }) draws a decal on the ground with trigger enter and exit events. The material has to be a decal material of the game; an unknown one draws the game's plain default decal.
  • Previews (#78): PropGhost shows a ghost mesh to one player, and PropPlacer lets a player pick a spot (left click confirms) and reports it to the script.
  • Everything above is sent again to a player whose world loads, so late joiners see it too.

Doors and chests

  • Doors (#73): the server knows every door near a player, opens, closes and locks them for everyone, and hears when a player opens, closes, unlocks or picks one (doorInteract can refuse it). Checked live with 3 clients: the server's open, close and lock, and a player's own open, on every screen.
  • Chests (#72): Stash.spawn places a chest with the server's inventory; chest.locked, canBePicked and a key class lock it for everyone, and a lock pick or a key in a player's game unlocks it for all.

Siege

  • Engines (#74): SiegeEngine.spawn('trebuchet' | 'cannon', ...), load(), aim, fire(target); the stone flies the same arc on every screen, the impact and its damage are decided on the server, and an engine can be wrecked and repaired.
  • Ladders and stones (#75): SiegeLadder.spawn and StonePile.spawn; players climb, push and throw.

Rays and cameras

  • Rays (#79): World.raycast(player, from, to, options) asks a player's game what a ray hits (position, normal, distance, terrain or entity, surface); also traceAll, snapToGround and entitiesAround.
  • Camera shots (#76): Camera.startShot(player, { position, rotation }) films from a fixed place until endShot.

SDK

  • Progression (#231): setXp, and setLevel / loadProgression that can also lower a skill or a stat.

Fixed

  • Doors: the client never read the level's doors (it looked their locks up on the wrong object, which also wrote into nearby doors), and a door a player opened was shut again by the server. Both found in the live test and fixed.
  • Effects showed a white pyramid next to the particles.

Not in this version

  • Blips (#69): Blip.create is accepted and the clients add the point, but it does not appear on the compass or the map yet.
  • Custom buffs (#230): Buffs.register works on the server (stat changes, timer, events), but the icon is not shown in the player's status list yet.
  • Gizmos (#77): the clients can draw them, but no resource API sends them yet.