Skip to content

Npc.setPopulation exclude: places kept empty of the level's people - #354

Closed
Kharote wants to merge 1 commit into
mainfrom
feat/population-exclude
Closed

Kharote wants to merge 1 commit into
mainfrom
feat/population-exclude

Conversation

@Kharote

@Kharote Kharote commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

What this changes

A server with levelPeople on wanted its villages lived in but some towns (Kuttenberg, Grund) empty for the players to live in.

  • New Npc.setPopulation setting exclude: up to 256 Areas or area ids, level areas such as a settlement's outline (kkut_locationKutnaHoraArea_1 is Kuttenberg's) or a script's own. The level's people placed inside get no body, and those already there go.
  • With levelPeople every game has the level's own people, also those the server gives no body: the people of an excluded area are hidden in every game by a level edit of their entity (their placement GUID is the edit's GUID), and given back once the area is no longer excluded. An added level's person has no level entity and only gets no body.
  • Docs: Npc.setPopulation exclude, with Kuttenberg and Grund as the example; C# SDK regenerated.

How it was tested

  • node --test Backend/scripting/runtimes/js/npcs/people.test.cjs: 22 passed (new: an excluded area keeps the level people out and they come back when it is lifted, ids and Areas, wrong values throw; with levelPeople the people inside are hidden by entity edits and given back).
  • SDK examples type-check; the C# SDK matches the API.
  • Kit run in the game: follows.

Checklist

  • I read CONTRIBUTING.md and agree that my contribution is licensed as it says.
  • The change is my own work: no code, assets or dumps that are not mine or that come from the game.
  • python Dev/tools/format_source.py --check passes.
  • Tests cover the change, and the checks of this pull request pass.
  • Public behaviour that changed is documented (KCD-Synced/KCDS-DOCS) or needs no docs.

A server with levelPeople on wanted its villages lived in but some towns
(Kuttenberg, Grund) empty for the players to live in.

- New setting exclude: Areas or area ids (a settlement's level area, or a
  script's own). The level's people placed inside get no body, and those
  already there go.
- With levelPeople every game has the level's own people, also those the
  server gives no body: the people of an excluded area are hidden in every
  game by a level edit of their entity, and given back once the area is no
  longer excluded.
@Kharote

Kharote commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Shipped in KCDS 1.2.3 through #358.

@Kharote Kharote closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant