Skip to content

Npc.attachProp and Horse.attachProp: props on the joints of NPCs and horses - #353

Closed
Kharote wants to merge 1 commit into
mainfrom
feat/npc-horse-attach-prop
Closed

Kharote wants to merge 1 commit into
mainfrom
feat/npc-horse-attach-prop

Conversation

@Kharote

@Kharote Kharote commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

What this changes

A server asked for props on characters' skeletons ("attach entity to entity, or at least to a bone"). Player.attachProp hung a mesh on a joint of a player's body only. Every game finds the body of an attached prop by its network id, and NPCs and horses are found the same way, so they now carry props too.

  • New Npc.attachProp / Npc.detachProp and Horse.attachProp / Horse.detachProp, taking what Player.attachProp takes (model, joint or hand, position, rotation, scale). The props go with the NPC or horse (removed with it).
  • New Prop.attachedBody: the player, NPC or horse a prop hangs on. Prop.attachedTo still names only a player, so C# scripts keep its Player type.
  • Docs for the new members (since 1.2.3); C# SDK regenerated.

How it was tested

  • node --test Backend/scripting/runtimes/js/props.test.cjs: 14 passed (new: an NPC and a horse carry props on joints and hand slots, detachProp takes only their own, the props go when the NPC is removed or the horse destroyed; attachedBody / attachedTo).
  • SDK examples type-check; the C# SDK matches the API (build_csharp_sdk.py --check).
  • 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.

…horses

Player.attachProp hung a mesh on a joint of a player's body only. Every
game finds the body of an attached prop by its network id, and NPCs and
horses are found the same way, so they now carry props too: a basket on a
back, a lantern in a hand, a pack behind a saddle.

- New Npc.attachProp / Npc.detachProp and Horse.attachProp /
  Horse.detachProp, taking what Player.attachProp takes; the props go
  with the NPC or horse.
- New Prop.attachedBody: the player, NPC or horse a prop hangs on.
  Prop.attachedTo still names only a player.
@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