Skip to content

KenshiLua v0.3.10-alpha

Choose a tag to compare

@Genpretz Genpretz released this 30 Oct 15:58
· 0 commits to 09d6a84121764c5bc6cc5941b9022e40f4bacb2e since this release

Full Changelog: v0.3.9-alpha...v0.3.10-alpha

This release updates KenshiLua to KenshiLib 0.5.0, expanding binding coverage to 668 classes (+118 classes and 8,784 methods) with extensive AI, weather, animation, rendering, and item bindings. It introduces complete OIS input system enum tables, automated binding inventory and live-subsystem in-game test suites, enhanced LuaLS hover documentation and handle comparison contracts, and major UI and economic improvements to the Animal Husbandry example.

Downloads

  • KenshiLua v0.3.10-alpha.zip: the mod. Install it into your Kenshi/mods/ directory.
  • KenshiLua-LuaLS-Addon-v0.3.10-alpha.zip: editor definitions for the KenshiLua API. Optional.

Highlights

KenshiLib 0.5.0 Upgrade & Core Subsystem Bindings

Upgraded the embedded engine SDK to KenshiLib 0.5.0 and added bindings for 118 new engine classes, achieving 100.0% coverage across 668 registered classes, 8,784 methods, and 3,716 properties:

  • AI Subsystem: Complete binding of AITaskSytem, Blackboard, AIPackage, OrdersReceiver, WaitingStateAI, TargetInfo, TaskRequest, and AI contracts (Contract_DefendPlayerBase, Contract_HiredAlly, Contract_Timed, Contract_UntilExSlave, and Contract_UntilOutOfDanger).
  • Weather & Environment: Bound WeatherSystem, WeatherInstance, WeatherRegion, Season, and fog controls (WeatherSystem_FogValues, WeatherSystem_ZoneFog).
  • Animation & Combat: Bound AnimationData, AnimationEvents, AnimationChoices, SingleAnimation, AnimationLayer, AnimsListsManager, CombatState subclasses, RagdollAnimation, GunClass, and RangedCombatClass.
  • Zone & Rendering: Bound ZoneMapContent, ZoneMapContentOrderLoader, ZoneSmell, ZoneSmell_Smell, Renderer, KingOfRenderThread, and related nested classes.
  • Items & Subsystems: Completed RobotLimbItem bindings with corrected Gear inheritance, SeveredLimbItem, Formation, TownList, Research, SharedKing, LocaleInfo, and LocaleManager.

OIS Input System Enums

Exposed Object-Oriented Input System (OIS) enum tables directly to Lua:

  • OIS.KeyCode: Full keyboard keycode mapping (e.g. OIS.KeyCode.KC_SPACE, OIS.KeyCode.KC_ESCAPE).
  • OIS.MouseButtonID: Mouse button constants (MB_Left, MB_Right, MB_Middle, etc.).
  • OIS.Type, OIS.ComponentType, OIS.Keyboard.Modifier, OIS.Keyboard.TextTranslationMode, OIS.OIS_ERROR, OIS.Interface.IType, OIS.InputManager.AddOnFactories, OIS.Effect.EForce, OIS.Effect.EType, and OIS.Effect.EDirection.

Automated Binding & Live Subsystem In-Game Test Suites

Significantly expanded the automated in-game test harness (kltest):

  • Added binding_inventory.lua, an automated test suite introspecting and validating runtime registration across all 668 bound classes and global tables.
  • Added kenshilib_050.lua, verifying constructors, methods, and handle behaviors for new KenshiLib 0.5.0 classes.
  • Added live_subsystems.lua, querying real-time game world state, weather systems, zone data, and combat subsystems inside a running game session.

Animal Husbandry Example Mod Overhaul

  • Responsive UI Reflow: The husbandry interface now adapts to arbitrary resolutions and aspect ratios, restraining growth above 1080p, scaling cleanly from minimum resolutions, and featuring an engine-styled portrait frame.
  • Modal Input & Dialogue Handling: Added modal input capture to prevent background clicks during livestock sales, with automatic dismissal when a new conversation starts.
  • Economic Rebalance: Added sales.resaleMultiplier (default 0.50), applying Kenshi's standard 50% vendor resale penalty to player-bred animal sales.
  • Content Expansion: Added new icons, new harvestable animal products (fur, wool, hair, horn, teeth, ganglion), and corrected sex enum mappings (0 = both, 1 = male, 2 = female).

Added

  • Enum & Constant Additions: Exposed itemType.LUA_SCRIPT with integer constant documentation.
  • Container Enhancements: Added numerical indexing for Ogre unordered maps and sets, and automatic pointer-object wrapping for pointer-valued map entries.
  • Handle Comparison Contracts: Updated hand:operator_eq and hand:operator_ne type definitions to accept hand | RootObjectBase | boolean, matching C++ overload semantics.
  • IDE Documentation Workflow: Added description candidate import tools preserving reviewed metadata and grounding hover text directly in SDK comments.
  • CI Version Tagging: Added automated GitHub Actions workflow to tag releases on version bump commits to main.

Fixed & Changed

  • Engine Null Safety: Guarded AnimationClass:getEvents() to return empty tables when the underlying engine pointer is null, preventing crashes on unloaded or incomplete animation states.
  • Type Assertion Errors: Improved checkObject error messages to name the specific expected C++ type instead of generic argument failures.
  • Inheritance Hierarchy Correction: Corrected RobotLimbItem inheritance to derive from Gear rather than directly from Item.
  • IntelliSense STL Compatibility: Guarded CampaignData struct size and member offset assertions under #ifndef __INTELLISENSE__ to eliminate false front-end compiler errors under modern Visual Studio STL layouts.
  • Test Harness Reliability: Improved unattended Steam process discovery when executable paths are protected, and ensured clean game shutdown via os.exit after suite execution.
  • Generator Deduplication: Fixed generator alias resolution for template containers and deduplicated AITaskSytem.orderedGoals registration.
  • Cross-Platform Test Fixtures: Normalized Windows and POSIX URIs in fixture tests and excluded binary assets from workspace scans.