Repository navigation
Game mods on a server: every table patch kept for the next start; a mod's items join the catalog - #357
Closed
Kharote wants to merge 3 commits into
Closed
Game mods on a server: every table patch kept for the next start; a mod's items join the catalog#357Kharote wants to merge 3 commits into
Kharote wants to merge 3 commits into
Conversation
…od's items join the catalog A resource's replace/ table patches of any game table (Libs/Tables/<folder>/<table>__<name>.xml) are now kept per server and loaded with the game's tables at the next start, not only perk patches: a mod's items (item__<name>.xml) and its clothing and hair (CharacterComponent__<name>.xml) reach every player like the game's own. The recipe and workpiece tables still load at once. On the server the rows of a resource's item patches join the item catalog when it starts, so inventories, shops, stashes and the ground take the mod's items. A worn piece gets the slot of its clothing's armour type, from the resource's CharacterComponent patch or the game's clothing; a row with a game item's GUID changes that item. The catalog now carries the game's clothing, the armour type slots and the weapon classes for this.
…ve file system can hold both
Collaborator
Author
|
Shipped in KCDS 1.2.3 through #358. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
A server can now ship a game mod, such as a Nexus mod with new clothes, hair or weapons, as a resource. The mod's files go in
replace/, and its table patches keep their names.Libs/Tables/<folder>/<table>__<name>.xml) is kept per server and loaded with the game's own tables at the next start. Until now this worked for perk patches only. The game loads its item table and its clothing and hair table (CharacterComponent) through the same object-database loader as perks, soitem__<mod>.xmlandCharacterComponent__<mod>.xmlnow reach every player. The recipe and workpiece tables still load while the game runs. The restart notice now says "game data of its own (perks, items or clothing)".item__*.xmlpatches join the item catalog (inventory/item_patches.cjs). Inventories, shops, stashes, the ground andInventory.classesthen take the mod's items by name or GUID.CharacterComponent__*.xml(the nearestArmorTypeof the clothing or the clothing it is nested in), or else from the game's clothing it wears or derives from.items ... added from item__<mod>.xml.build_catalog.pynow also writes the game's clothing (armour type, covers feet, drop model), the slot of each armour type and the weapon classes by id. The rest ofcatalog.jsonis unchanged, rebuilt from the same game.Guide: KCD-Synced/KCDS-DOCS, "Game mods: items, clothing and hair" in Sounds and game files.
How it was tested
item_patches.test.cjs, new, 2 tests:sleeves.ArmorType="Coat"lands inbody_coat; drop models resolve.weaponClass: 'longsword'and its attack mods; stackable misc items stack.Inventory.addtakes the new item.replace/libs/tables/item/starts and logs its items.runtime.table_patch(C++, new): patches of any table and depth are kept; whole tables, misplaced files and..paths are not; recipe tables stay live. Built and run with clang 19: 3/3 pass.replace/Libs/Tables/item/item__kitmod.xmladds a hood (a game hood's row with a new GUID and name):items kitmod_hood added from item__kitmod.xml.player.equip('kitmod_hood')succeeded on the server, but the game drew nothing.1 table patch(es) mounted ... loaded at this start. The same equip put the hood on, and it shows in third person.item_patches.test.cjs(Docker, node 22): 2/2. CI's first run failed on the case-sensitive file system with two folders of the same name in different case; fixed in the second commit.format_source.py --checkpasses.Checklist
python Dev/tools/format_source.py --checkpasses.