KCDS 1.1.2

KCDS 1.1.2

Servers and players both need 1.1.2: a client and a server of different versions refuse each other.

New for resources

Aiming and the crosshair (client)

  • LocalPlayer.aiming (client only): true while the local player aims a bow, a crossbow or a gun (the game's aim pose is on), or works a KCDS siege engine. Other players read false.
  • Events localPlayerAimStart and localPlayerAimEnd (client): raised when the local player starts and stops aiming.
  • Hud.setHudPart(name, 'rangedOnly'): the HUD part shows only while the local player aims and is hidden otherwise; while aiming it and its parent Cursor are kept shown even when the game takes its cursor away with a bow drawn. A part another resource hides stays hidden. true and false work as before; any other value throws TypeError.
  • The crosshair's own HUD parts: CursorCross (the yellow centre dot), CursorOutline and CombatCursorCross (the melee combat star with its arrows). Cursor still hides all three. A server that hides the dot can keep the combat star: Hud.setHudPart('CursorCross', 'rangedOnly').

Crowns

  • Player.crown: 'sigismund' (Sigismund's crown, without his hair), 'wreath', 'twitchWreath' or null. Worn over the player's own hair, seen by every player and by later joiners.
  • Player.hairCrown: false draws a hair that carries a crown (Sigismund's hair m_hair_zikmund) without it; true, the default, shows it.
  • Items.register({ crown }): a crown as an inventory item. It is always usable (label "Wear" unless given); using it puts the crown on or takes it off, and it comes off when the player no longer holds an item of that type. Items.info(item).crown names it.

Throws, paths and props

  • prop.followPath(keys, { ease, spin }): up to 32 keys { ms, position, rotation?, arc? } the script worked out, such as a throw with its bounces or a piece hopping square to square. Every player's game plays the whole path from one message; spin (radians a second) tumbles it on top. The server and late joiners hold the end at once.
  • prop.launch(velocity, { ms, gravity, spin }): throws a prop from where it stands. A prop without physics flies the parabola for ms; a rigid prop is handed to its physics as setVelocity.
  • prop.glideTo(..., { ease: 'linear' }): an even pace, as a thrown body flies; 'smooth', the default, eases in and out as before.
  • Rigid props for other players glide from pose to pose instead of jumping; a jump over 5 m (a reset or teleport) is at once.
  • Item meshes as rigid props: the game's item meshes (stones, apples) now simulate. Their body gets a box of the mesh's size carrying the prop's mass (or, with 0, a mass of its size as wood).
  • PropGhost.create({ ring, opaque }) (server and client): ring: false leaves out the ground ring of a tinted preview, opaque: true draws the meshes whole.

Weapon sets

  • Items.info(item).weaponSlot: 'mainHand', 'polearm', 'ranged', 'offHand', 'dagger', 'torch' or null. The body holds one weapon of each slot across all its weapon sets: two longswords, or a longsword and an axe, cannot both be in sets, while a longsword, a polearm and a bow can.
  • Inventory.set refuses two equipped weapons of one slot with invalidEquipment and the conflict { rule: 'sameWeaponSlot', weaponSlot }, instead of answering ok and having the game take one off (which made the weapon sets flicker).
  • Player.equip of a weapon takes off the equipped weapon of its slot (it stays in the inventory) and empties the set it was in.

Level editing

  • LevelEdit.apply({ kind: 'collider', at, hidden | position, rotation }): edits the level's invisible collision itself: the colliders at a place are taken away, or moved and turned, and come back as the level had them with restore().
  • A hidden or moved building takes all its collision, wherever it lies along the building: a long wall or a castle ring kept its collision before.
  • A deleted door or gate takes the invisible clip in its opening: a hidden or moved brush also takes the level's invisible collision brushes inside its bounds (collision proxy materials that only people collide with). Deleting Raborsch's big gate left a wall before.
  • World.raycast (server and client) names the level's invisible collision as levelObject.kind: 'collider'.

Lua

  • os.clock() counts the seconds since the resource's Lua state started, from the host's clock. It stopped at -2147.48 after about 36 minutes before, so charge times and timeouts measured with it broke.

World Architect

  • Invisible collision can be picked (named "Invisible collision"), deleted, moved and turned; Export for server takes it along.
  • Deleting a door or a gate also takes away the invisible clip in its opening.
  • Panels without backgrounds and clicks: with a big project the editor drew its panels while the game was still applying the project's ground edits; those drawings got lost, only the text showed and no button worked. A drawing the game did not take is now drawn again.
  • Leave, then a server: after leaving World Architect, joining a server showed the server list over the joining game, and only a second Join got in. The list now stays away.

Fixes

  • NPC names in the HUD: looking at an NPC, the HUD's bottom right corner now names it by Npc.name (an NPC made with Npc.create({ soul: 'townsman', name: 'Zelinář Gustav' }) showed its soul's name, "Craftsman"). The name shows as written, letters with accents included; a new name or nameShown turned off shows at once. The population's people keep their soul's name there until a script names them.
  • Client stop in the inventory or the pause menu: the item icons of the pages read item classes the game had built anew (a woodcutting axe in the inventory). The lookup follows the game's classes, and a fault in the icons turns the icons off instead of stopping the client.
  • Updates are small again: a release that keeps the same Chromium ships the previous release's signed Chromium files, so the launcher downloads only what changed (about 11 MB instead of 346 MB).