Mods / Wearable Render Library

Tags: #Library
Authors: BowlSoldier, SiiMeR
Side: Both
Created: Jul 7th at 9:00 PM
Last modified: Sep 29th at 6:44 PM
Downloads: 2313
Follow Unfollow 15

Latest release (for Vintage Story 1.21.0 and 1.21.1, potentially outdated):
wearablerenderlib_1.3.0.zip  1-click install


Description

Utility library for other mods to utilize, has no effect by itself.

Adding lots of items, such as armor or clothing, which only differ by shape and/or texture and are otherwise identical, can have negative effects on performance. The game has to keep track of the product of all your item's variant groups, leading to many item codes.

This mod adds a more efficient method. You can have a single itemtype, that varies its appearance by setting `shape` or `textures` Attributes on the ItemStack at run-time. Anything that updates Attributes will cause this to happen, so this can be done via crafting, or anything else that could change an item's attributes.

How to Use

The Vanilla game uses an `ItemWearable` class for its clothing and armor. This mod can work with anything that uses that class, by instead using this mod's `ItemWearableShapeTexturesByAttributes` class. This should behave identically to the base class mechanically, the only difference should be that it's possible to dynamically change the rendering by assigning values to the `shape` and/or `textures` Attributes on the Itemstack.

If you are using CombatOverhaul / OverhaulLib, armor instead uses the `ItemWearableArmor` class added by OverhaulLib. Similarly, you can use this mod with that armor by instead using the `ItemWearableArmorShapeTexturesByAttributes` class, and assigning attributes.

Attribute Documentation

  • `shape`
    • Expects a single string as input, not a `CompositeShape` with a `base` etc.
    • That single string should be the path to the relevant shape
  • `textures`
    • Expects a mapping of string -> string, essentially a Dictionary<string, string>.
    • The key should be the TextureCode you want to override
    • The value should be the path to the relevant texture

Both path values are in the same form as in `item-types` json files. They should include a ModId, but should not include the `shapes/` or `textures/` folder and should not include the `.json` file extension.

Example usage

Examples of how to use this can be seen in my Customizable Plate Armor mod. For example, here's a recipe which alters Steel Plate helmet with custom rendering attributes, then it will display with my new shape and textures.

{
"ingredientPattern": "P_,AH",
"recipeGroup": 3,
"width": 2,
"height": 2,
"ingredients": {
"A": {
"type": "item",
"code": "game:armor-head-plate-steel"
},
"P": {
"type": "item",
"code": "game:metalplate-*",
"name": "metal",
"allowedVariants": [ "copper", "iron" ]
},
"H": {
"type": "item",
"code": "game:hammer-*",
"isTool": true
}
},
"averageDurability": false,
"name": "Reinforced Plate Armor Head",
"copyAttributesFrom": "A",
"output": {
"type": "item",
"code": "game:armor-head-plate-steel",
"attributes": {
"shape": "game:combatoverhaul/armor/plate/head-{metal}",
"textures": { "material": "customizableplatearmor:{metal}" }
}
}
}

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.3.0 wearablerenderlib 512 Sep 29th at 6:44 PM wearablerenderlib_1.3.0.zip 1-click install

* Update to 1.21 & .NET8

1.2.1 wearablerenderlib 1305 Jul 13th at 5:22 PM wearablerenderlib_1.2.1.zip 1-click install

Fix bug for servers using relative file paths to define the data folder

1.2.0 wearablerenderlib 85 Jul 9th at 2:26 PM wearablerenderlib_1.2.0.zip 1-click install

No longer requires OverhaulLib. Will work with OverhaulLib if it's installed, but it's now an optional dependency

1.1.0 wearablerenderlib 381 Jul 8th at 7:33 AM wearablerenderlib_1.1.0.zip 1-click install

Adds `ItemWearableShapeTexturesByAttributes`, which is for the vanilla `ItemWearable` class. This should allow dynamic rendering of any vanilla armor or clothing.

Also changes the registered name of the original Class from `ItemWearableArmorMeshByAttributes` to `ItemWearableShapeTexturesByAttributes`, the previous name was a typo accidentally left in. Any mods using this library will need to update to this new Class name in their JSON files.

1.0.0 wearablerenderlib 30 Jul 7th at 9:01 PM wearablerenderlib_1.0.0.zip 1-click install

Initial release. Currently only works with CombatOverhaul armors, and requires Overhaullib


2 Comments (oldest first | newest first)

💬 BowlSoldier , Jul 9th at 2:33 PM

Newest version no longer requires OverhaulLib! This should now work with vanilla armor sets and clothing, if you want to modify those in your mods.

💬 Anotzibartschad, Jul 8th at 5:16 AM

thanks nigga

 (edit comment delete)
Основной веб-сайт | Почтовый сервер | FTP сервер | Административная панель | API интерфейс | Content Delivery Network | Статические файлы | Ресурсы сайта | Изображения | Файловое хранилище | Блог | Интернет-магазин | Техническая поддержка | Справочная система | Документация | Форум | Новости | Загрузки | Демонстрация | Тестовая среда | Приложение | Медиа контент | Разработка | Промежуточная среда | Бета версия | Безопасная зона | Вход в систему | Панель управления | Портал | Система управления контентом