KCDS 1.0.8
KCDS 1.0.8
KCDS is now code signed: the launcher, the mod and the other Windows programs of the download carry our Certum code-signing certificate. World Architect exports work like the game's own places: their props have collision and cast shadows, fences can be vaulted, and players sit on benches, beds and chairs placed by scripts. Web views no longer lag under a busy GPU. Server owners get databases, NPC schedules and factions, navmesh paths, cart harnessing, fog and blizzards, and a lantern for players.
Servers and players both need 1.0.8: a client and a server of different versions refuse each other
when joining. The launcher updates itself on the next start; servers update from their update
channel, the new packages or the Docker image ghcr.io/kcd-synced/kcds-server:1.0.8.
Code signing
- Signed with our Certum code-signing certificate: every Windows program and library of the KCDS download (the launcher, its updater, the game client and its tools). Third-party libraries that already carry their publisher's signature keep it. Windows and antivirus software see who made them.
World Architect and placed objects
- Exported props have collision from their own model file (ovens, crates, stalls, wells, sheds, fences).
- Exported props cast the sun's shadow (shed roofs, ovens).
- Placed fences can be vaulted from both sides, like the level's own.
- Players sit on placed benches and chairs and lie on placed beds with the game's own key and animations, and stand up with the "Stand up" hint (U). Placed chairs now show their chair.
- Hidden grass stays hidden in exported works and after a Load, on any server.
- The catalog offers the game's interactive prefabs (seats, beds, work places, fireplaces, ladders) and the export keeps them usable; the editor marks models that are only models.
- Decals moved across a slope lie on the ground; grass paint grows the level's own grass; Add nature grows what suits a painted material; plane handles on the gizmo.
- Ctrl+S saves, a paste follows the cursor until you place it, a dragged group moves live, a mixed meadow brush, and Ctrl+Z / Ctrl+Y follow your keyboard layout.
- Fog and blizzard weathers in World Architect.
Players
- Web views stay smooth under a busy GPU: a dragged map page no longer jumps, and clicks and keys reach pages at once.
- A crash report now names the graphics layers in the game (OptiScaler, frame generation) and the overlay's last step.
- A crash with OptiScaler / XeSS frame generation: the overlay draws on the game's own queue.
- No crash when a blocked attacker is gone mid-block.
- Microsoft Store: no crash on level load; the licence proof goes through the GDK.
- NPC fights: no swing at a downed foe.
Server owners
Horses and carts
- Horse theft event you can cancel:
horseStealing(horse, player). It runs when a player mounts a horse that belongs to another player, beforehorseMounting. Handlers run synchronously: returnfalseand the theft is refused (the client dismounts the player, and nohorseMounting,horseMountorhorseStolenfollows). Return nothing to allow it, or decide by your own rules (factions, jobs, a wanted list, the owner online or not). The horse argument carriesownerandownerId. After an allowed theft,horseStolen(horse, player)fires andhorse.thiefnames the thief. It is cleared when the owner rides the horse again orhorse.giveTohands it on. A thief is not asked again until the owner has ridden it. - Harnessing real horses to a cart:
cart.harness(horse)/cart.harness([horseA, horseB])andcart.unharness(). One horse for a cart, two for a wagon (Cart.blueprintslists each blueprint's horse count and seats, so you choose which cart or wagon to spawn). The horses must be alive, unridden, in no other cart, in the cart's world and within 15 m. While harnessed, the horse leaves the world (horse.harnessedTonames the cart), and the cart's horse looks like that exact horse.cart.unharness()puts them back beside the cart; it refuses while someone sits in the driver seat. Events:cartHarness(cart, horses)runs before and can returnfalseto refuse;cartUnharnessfollows.cart.harnessedsays whether the cart has horses: a cart without them cannot be driven, but its other seats still work. - Who may drive and who may ride:
cartEntering(cart, player, seat)(since 1.0.0) runs before a player takes a seat and gets the seat's name. Returnfalseto refuse, for example to keep the driver seat for the owner and let others ride.cartEnter/cartExitfollow, andcart.driver,cart.whoSits,cart.seatPlayerandcart.unseatPlayerlet a script place or remove people.
NPCs
- Factions and hostility:
Faction.setRelation(a, b, 'hostile' | 'friendly' | 'neutral'),Faction.relation(a, b)andFaction.relations(). A faction is a number 1 to 65535 that you give to NPCs (npc.faction) and players (player.faction). Set "faction A attacks faction B" by making them hostile. Per NPC:npc.hostile = true(hostile to every player),npc.hostileTo(playerOrNpc)(hostile to one player or NPC, whatever the factions;falseundoes it) andnpc.isHostileTo(target).npc.aggroRange(0 to 50 m) makes an NPC attack the nearest foe it sees, and help friends of its own or a friendly faction who are struck. The eventnpcAggroruns before each such attack; returnfalseto refuse it (not offered again for 5 s). - "Use here" at any spot:
npc.useHere(position, { fragment | clip, tags, loop, facing, speed, ... }). The NPC walks to any point, not only a SmartObject, turns tofacingand plays the fragment or clip there.npcIntentDonereports the walk andnpcAnimationEndthe action. - Daily schedules:
npc.setSchedule([{ hour, position, ...action }]). Up to 48 entries by the world clock. At each hour the NPC is sent to the entry's position: withuseHerewhen the entry has an action (fragment, tags, clip, loop, facing), otherwise withmoveTo(speed, radius, pathfinding).npcScheduleEntry(npc, { index, hour, position })fires for each entry, andnpc.schedulereads it back. Between entries a script can give other orders until the next entry comes. - Did it arrive?
npcIntentDone(npc, status)reports how amoveTo,follow, patrol leg oruseHerewalk ended:'reached','blocked'or'failed'(no way there).
Navmesh queries for scripts
Terrain.findPath(from, to)gives the way on the game's navmesh as the game's NPCs would walk it:{ reaches, points }, the points from start to end.reachesanswers "can you walk here?". When the goal cannot be reached,reachesisfalseand the points end where the search came nearest. Paths go aroundTerrain.blockNavmeshboxes.Terrain.nearestWalkable(place, reach): the nearest point of the navmesh where an NPC can stand, withinreachmetres (up to 50).- Both return
nullwhere the navmesh is not loaded in the game running the script, or when the start or goal is more than 3 m off it.
Databases (also from Lua)
kcds.core.Database: SQLite databases in the resource's own folder, the same from JavaScript, TypeScript, Lua and C#. Calls are synchronous: the rows come back at once, as objects (Lua tables), with no promise to wait for.Database.open('data/shop.db')(or':memory:', up to 8 open), thendb.query,db.get,db.run({ changes, lastInsertId }),db.exec,db.transaction(fn)anddb.close. Parameters:?with an array or:namewith an object.
Lua
- Configurable Lua call limit:
luaCallLimitin server.json (orKCDS_LUA_CALL_LIMIT), in seconds from 1 to 600. It sets how long one call into the server's Lua scripts may run before it fails with a timeout error. The default stays 5 seconds; a player's game always uses 5. An invalid value logs a warning and keeps 5.
Sharing code between resources (since 1.0.0)
Exports/Importswork across resources in every language. A resource lists names underkcds.exportsin its manifest and callsExports.register(name, value). Others get them withImports.get('resourceName')(Lua:kcds.core.Imports.get("economy")).
Lanterns
player.setLantern({ model, hand })andplayer.lantern: the lit lantern the game's NPCs carry at night (warm light, about 6 m), in the player's hand. It stays there on foot, while riding and in a cart. Every player sees it, including later joiners, until it is set tonull, the player leaves or the resource stops.
Weather
World.setFog(amount): fog over the weather's own for every player, from 0 (only the weather's fog) to 1 (a few metres of sight). About 0.3 is a misty day and 0.5 the game's fog weather.World.fogreads it.- Blizzards:
World.setSnow({ ..., flakeSize, storm }):flakeSizesets the flake size (0.1 to 5) andstormhow hard the wind drives them (0 calm to 1 blizzard).
Crafting
Crafting.defineWorkpiece: a smithing workpiece of your own (fields as in the game's BlacksmithWorkpieces.xml, orlikean existing one); aCrafting.defineReciperecipe then names it as itsworkpiece.- A script's smithing recipe starts at a game smithy. A product forged after the smithy closed now completes.
grindstoneStarting: returnfalseto refuse sharpening at a grindstone.- The crafting events' data is described field by field in the reference.
Level, inventory and menus
levelEdit.hideParts = ['name', ...]: hides parts of a brush's model by sub-material name, up to 8, for every player.levelEdit.material = 'objects/...'draws an object with another game material.- Inventory: clothing rows carry their dirt and blood.
Inventory.clean(id?)washes one row or all of them. ActionMenu.open({ compact: true }): shows only the marked entry, with the game's mouse-wheel icon, as the game's own prompts do.- Level edits say which waiting edits should have found their objects.
KCD1 map
- Townspeople walk on KCD1's navmesh; players start in the open street.
- Rooms lit by global illumination the game builds from the level.
- Blocked townspeople step down and reach unreachable legs out of sight.
Known limits
- The inside of a house placed from a prefab is still lit like the outdoors at night.