CUCoreLib
Core modding library for Casualties: Unknown. Adds content registration, hooks and shared utilities that other mods build on!
CHANGELOG
Changelog
I figured that this would be nice to have, as to easily take a look at everything that's been done and why your mod might not work with the new update (sorry!)
New stuff documents new stuff introduced in the latest version
Changes refer to potential mod-breaking changes, which may need manual work to update
Fixes refers to bugfixes that will not or are very unlikely to break your mod
v1.1 (Stable) (Fullgame! Yay!)
- Note: v1.1 is the last release that has Demo support, so new changes or APIs added after this update (v1.2 or higher) can break on a Demo install
New Stuff!
- In lieu of adding a bunch of other changelogs, "Full steam release support".
- Updated Assembly-CSharp.dll reference to fullgame ver ^
- Added
.ase/.asepritefile extension support - Added an
isCheatoverload forConsoleCommandRegistry.Register() - Added
CustomItemInfo.MetamorphicDropandDropPool.MetamorphicCrystalDefaults to the!unobtainableflag
Changes
- Full, er, steam release support. See https://cucorelib.jimmyking.dev/docs/full-game-transition/ for more information on migrating your mods!
Fixes
- Fixed structure backgrounds desyncing in multiplayer
- 'Reset to default' on a mod's settings tab now only resets that tab's options instead of every setting
- Strengthened
SaveSystem.TryLoadGame - Custom tile and liquid tile injection/generation failures no longer abort world generation in select cases
- Saved item ids that cannot be resolved (missing or outdated owning mod) are now warned about in the BepInEx log, not only by the vanilla in-game alert
- Updated
floodfill/settileautofill - Other things I may have missed for the fullgame, note v1.0.7.2/v1.0.6 still works (CCL was developed with the fullgame in mind since v1.0.5 after all -w-)
v1.0.7.2
New Stuff!
- Added
CustomLiquidTileInfo.TextureandOpacityfor room-lit custom liquid surfaces from images - Added client-authoritative attribute field for statuses (Thanks, ovoid_ovvie!)
- Implement Apply() and ApplyAbsolute() for networking status sync
- Text option for settings
- .cfg options are automatically appended to your mod options menu, if there are no collisions
- ^ reverted this for now
Changes
- Custom liquid containers with
scaleWeightWithConditionscale to0.1uat 0% condition - CCLBody overhaul (Thanks, @MCPO-Spartan-117)
- Updated to Together v5.1.4 (multiplayer), for crafting compatibility additions.
- Structure
spawnCountsincreased to 12 entries
Fixes
- Updated compatibility with MP's traders
- Fixed multiplayer crafting for recipes streamed from the host, the client now translates its recipe index to the host's one
- The settings window now shifts left when a mod adds a custom settings sidebar, so the window + sidebar pair stays centred
- Skipped patching vanilla recipes in MP for CCL, which should help compatibility (and for the future mp update)
- Optimized liquid tile rendering
- Fixed saved body and limb statuses being skipped before their first access upon game restore (I am very smart)
v1.0.6
New Stuff!
- Multiplayer snapshots now sync custom locale strings and recipes, and supports v5
- It is time. (for fullgame preparations)
Changes
- Multiplayer support now targets Together v5.0.0 (plugin GUID
CasualtiesMP). KrokMP 4.0.1 and 4.1.2 support has been deprecated. (If you need v4 support, you'll need to download CUCoreLibv1.0.5- mods written with CUCoreLib's api should still work!) - Custom building and custom liquid save data now carries the layer it was captured on (for saving + loading, in case the layer changes)
Fixes
- Multiplayer liquid sync now uses the host's liquid ordering, if possible
- Fixed entire mod crashing when referencing invalid mod ID as dependency
v1.0.5
New Stuff!
- Added
CustomItemInfo.scaleConditionTowardto choose the weight to scale to. E.g. you can now have something that goes up in weight when lower condition - Added
CUCoreUtils.GetLastDialogue(...)for checking the last dialogue ID or selected text. - Added
DamagePlayerOnImpactforAddRigidbody2DbuildingEntites setbodyfieldandsetlimbfieldcan now change fields on attached CUCoreLib statuses withStatusType.Field. (I.e. ToxicStatuses.Toxicity)- Added
CUCoreUtils.CheckModVersion("com.example.mymod");for automated-ish version checking, see https://cucorelib.jimmyking.dev/docs/utils/ for more info SpawnFrequencynow has a float overload! Pass fractions such as1.5f,0.01f, or12.42fthrough the new overload for a chance to spawn more (or less) entires of your item into the lootpool (Thanks, @Jetfire).createLocalenow accepts an optional mod GUID, e.g.createLocale net.Jimmyking.netdescents- Locale files can now be scoped per mod with the
{LangCode}-{modGuid}.jsonnaming scheme (e.g.EN-net.Jimmyking.netdescents.json), both as embedded resources/loose files, to avoid locale conflict. - ^ that is, any given locale with the mod GUID inside the file name takes priority for said mod
AssetLoaderaudio loading now supports.oggfiles. Rejoice,.oggenjoyers!- Added
MultiplayerApi.BroadcastEverywhere(channel, payload, reliable),MultiplayerApi.BroadcastToPeer(channel, clientId, payload, reliable) - Multiplayer
Healcommands now trigger the OnHeal CUCoreUtils delegate LiquidTileRegistrynow has the same layer-mask helpers as tiles and buildings (LayerToMask,LayersToMask,AllLayersExcept)
Changes
- I guess the mod's v1.0.5 now? I pushed a hotfix, but that had the v1.0.5 version. I guess the stable is v1.0.5 now and next nightly is v1.0.6 then :p
- Moodle queues now default to .5s refresh (this matches vanilla, so it should fix mismatched animations)
- Explicit MP support for buildingEntities, tiles. Note this might break for people using v1.0.4/1.0.5 <-> v1.0.6 in terms of crossplay
- Custom buildings (and items) no longer stick around between scene changes in certain cases. This shouldn't (?) break your mods, but do tell me if it does
- Dropped the KrokMP v3 compat backfill, surely there's no one using v3 nowadays
Fixes
- Invalid recipe item or result IDs are rejected with an error instead of breaking the crafting menu.
- Liquid track hotfixes for client multiplayer
EnableHotReloadwarns instead of throws when it can't seeAwake()- Terrain tiles now use IDs 0-255 (Fixing multiplayer tiles breaking for people without ccl joining)
- Fixed mod keybind descriptions missing, I'm honestly not sure why it took this long to fix >.>
- Fixed custom battery charge resetting (Thanks, MCPO-Spartan-117!)
- ""Fixed"" large amounts of data being truncated when sending over multiplayer requests
- Fixed
AddRigidbody2D(t'was a layer issue) - Fixed modded buildingEntities ignoring locale overlays for buildingEntities
- Reworked settings UI
setbodyfieldandsetlimbfieldnow autofill custom statuses too- Fixed liquidStack<> containers from always spawning at 100%
- Multi-stage (same name) moodles no longer stack queued copies when their intensity changes
v1.0.4
New Stuff!
- The good part about making a library mod is that whenever I want a new feature for one of my other mods, I can share it with the rest of the world :)
- Well, you can, too. It's open source!
- Potentially related, added
TryGetOwnerModGuidqueries to the item, liquid, building, tile, and recipe registries - Not related, added
GunProperties. Super basic fields for now, might think about custom stuff later down the line - Custom liquids can set
unobtainable = trueto exclude themselves from random minibarrel contents. - Added
AssetLoader.LoadFrameAnimationFromEmbeddedResources(...)for ordered embedded sprite-frame animations, with hot-reload cache invalidation. - Added
CustomItemInfo.LiquidMaskAnimationIdso container fill masks can use registered sprite animations whileLiquidMaskremains supported for static masks. - Added the built-in
bug-report [description] [bool screenshot] [severity]command. Send quick reports to your favourite (?) modders! - Added
CUCoreUtils.EditVanillaItem(...) - Added
CUCoreUtils.OnHealandCUCoreUtils.OnLastStandcallbacks, yay! - Added
ItemRegistry.ToCustomItemInfo(...)andCUCoreUtils.ToCustomItemInfo(...)for converting vanilla item definitions - You can now have your entire mod's items in one image with
CUCoreUtils.SplitSpriteSheet(...), if you want that for some reason - You'd be better off using ^ for animations, of which now works with LiquidMasks and can be imported from embedded assets!
- Cool missing item textures now for missing sprites, thanks @comradefoxx!
- Spritesheet support (very basic)
Changes
- Structure markers now resolve registered CUCoreLib tile and building-entity IDs interchangeably, using marker type to choose priority
- QoL settings menu compatibility
- Fixed ScaleWithCondition scaling towards 0.1f. Technically this is basegame, but a bit confusing to most
- Tiles now can use alphanumeric IDs
TileRegistry.Register("auric", ... )(o7 calamity)
Fixes
- KrokMP v4 support
- Fixed multiplayer statuses and
CCLBodycontributions leaking from a client body onto the host player. - It feels kinda weird making QoL changelogs in here, but the reason that one hasn't gotten any updates is since it's tied to mpv5, (which is in its early playtest phase) and I really don't want to navigate my tangled version control to handpick the features and remove v5 support. Guuuh.
LightPropertiessupports localRotation(light rotation),Offset(light offset), andFalloffIntensity(harshness/softness)- Added optional sync between
ModOptionsRegistrysettings and manually bound BepInEx config entries when they share the same namespaced ID or key suffix - Added
CCLBodyfor formula-owned vanillaBodyfields such as blood pressure and encumbrance values, so mods can inject simple per-mod contributions without writing their own Harmony patches. - ^ do send suggestions for more body fields that might want to be added!
StatusMoodleDefinitioncan now carry a direct sprite icon instead of requiring a pre-existing vanilla icon ID.- Tiles? Liquids? Why not both? Added early liquid tile support
- Liquid registration now has an onuse field and inject field that can be used in place of the item
- Removed the watermark, except it wasn't there in the first place and didn't even work, erm...
- QoL Unknown-multiplayer-CUCoreLib compatibility patch, may or may not work
- Custom tile drops are no longer tied to KrokMP compatibility (yeah.)
- Settings menu description fixes
- Fixed a startup
InvalidProgramException, affecting only a few people (?) - Mod options now fall back to their registered label/description/dropdown text when no locale overrides exist (whoops!)
- Item.stats works properly for a couple more immutable stats
- ^ once more, do send suggestions for more body fields that might want to be added!
- Autofills now exist for
floodfillandsettile - Documentation, bleh...
- Moved a bunch of stuff around, really sorry for your forks if you touched the hot reload code
- Fixed custom items spawning without box colliders for the first instance. Thanks, @Sylviebbq!
- Sorry, germs are now present in the ground water again (fixed liquid tile wrappings). Thanks again, @Sylviebbq!
v1.0.3
New Stuff!
- Hotloading is a lot more mod-author friendly, so that you don't have to wrangle your code around it (as much)
- Check out the new docs for information! ^^
- Nightly/on-commit releases for CUCoreLib!
- Added itemsVisible and tagRestriction (tags only, no crafting quality)
- Added more verbose warnings
- Runtime debugger for variables was introduced, under the console command
debugwatch - Added early AssetBundle support for minigame screens, with a guide to follow soon
- Added bundled body animation curve/profile loading support, ^
- Added
DropPoolsupport for custom items, so they can target corpses, crates, traders, and capsules directly. Access this via the new itemregistry fieldDropPool = DropPool.FoodCrate | DropPool.MedicalCrate. - The specific fields are
Corpse, MedicalCrate, FoodCrate, ContainerCrate, Trader1, Trader2, Trader3, (or, for all three trader species) AllTraders, DropCapsule, CapsuleContainer - Added itemregistry field
WorldSpawnPerChunkfor randomly spawning raw items into the world per chunk - Added
SetWornSprite/setWornSpritehelpers for refreshing live worn sprites - Added a few more CUCoreUtils functions akin to ^
- Animation support
Changes
- !! Recipes with no args now default to 90% condition instead of 0% condition !! (Sorry, it was the lesser or two evils. You need to use (0f) to have it back to 0% condition requirement)
- Locale recursive directory search was accidentally removed and now re-added
- Slimmed down batteryProperties, as I was overcomplicating it. Your mods will work still, but you may face some slight changes
- Custom structures now no longer spawn in the tutorial, and spawn up to only once in the debug world
- Massively overhauled
customDataitem properties. Tl;dr it's now a per-Itemruntime conditionalweaktable. - This means that it's now per-item state and can use the new apis:
SetCustomData,RemoveCustomData,HasCustomData,GetAllCustomData. It works well with custom scripts, as well - This means it's no longer shared between all of the same item type (???), and as always, saves between layers and runs ^^
Fixes
- Battery 0% condition issue...
- Fix keycode optimization (Thanks, @Jacbo1)!
- Crafting qualities now work and are added to the locale
spawncategorynow can spawn all modded items- Fixed lighting module pointLightOuterAngle/pointLightInnerAngle
- Fixed equippables teleporting when trying to equip on top on another, as well as console error logs whilst equipping for the first time
- Minor optimization changes
- Fixed QoL image integration again
- Fix modded watermark (this is a modded..)
- Item colliders now ignore image transparent pixels
- Fixed
spawncategoryduplicate autofill weirdness spawncategorynow supports an optionalmodGUIDfilter- Fixed late applications of icon sprites not working for wearables (e.g. auto equipping via traders and whatnot)
- More docs work, once again :)
- Added more warning code (i.e. for missing moodle sprites)
- Fix wearable sprite defaults
- Settings menu changes (Thanks, @Black_Moss)!
v1.0.2
New Stuff!
- Added a multi-block structure system via
StructureRegistry, for custom structures. Will need to integrate still via the custom-structure-webapp side, though... - Added expanded minigame helper support, subject to change
- Added keybind and keycode-related support
- Added XML documentation comments across the codebase! (this is the large change of the version)
- Added preloading for embedded images for optimization
- BuildingEntites how has a SpawnLayers field
- Added InventoryIconScale field to items
- Embedded locale files now work instead of needing to be bundled alongside the mod
Changes
- Expanded settings and locale UX support (locale category work, EN fallback behavior, and menu improvements)
- Updated moodle image defaults to use a
33.33fpixels-per-unit baseline. - Set
BuildingEntitys to default to being Standard placement style instead of None. - Having a light property now doesn't give your item a battery for some reason
Fixes
- Sprite PPU behavior for is no longer fixed.
- Fixed several settings-page interaction issues, thanks @Black-Moss!
- Added console and utility support, thanks @Black-Moss!
- Reduced duplicate-warning noise.
- Added a dedicated multi-block structures docs page
- Refreshed setup, settings, assets, utils, minigame, moodle, and status documentation.
- Documentation, documentation, documentation.
- Battery fixes once more
- Fix console errors with RegisterSpawnEntities
- Added a few enums for clarity
v1.0.1
New stuff!
- Hot reload! See https://cucorelib.jimmyking.dev/docs/debug-testing for more details
- ^ You can now develop your mod without needing to close the game at all! (for basic functionality)
- Automatic sandbox/debug world config
- Version checker
- Liquid sprite mask
Changes
- Added more smart defaults and regular defaults
- Battery fixes
Fixes
- Fixed tiles not working
- Fixed lifepod in mp
- Fixed createLocale
- Improved webapp, added sitemap
- V4.0.0.0 mp compatibility
- DestroyAtZeroCondition fixes
- Recovered the changelogs from the great time catastrophe! Not so great now, huh?
v1.0
- Release!
Reminder for mod developers:
- This .dll must be in the BepInEx/plugins/ folder
- Your own mod must add an assembly reference to this mod. For non-visual studio users, you must add a reference in your .csproj
- For visual studio users, right click assemblies -> add assembly -> navigate to the CUCoreLib.dll file
- For more info, see https://cucorelib.jimmyking.dev#setup
Happy modding!