Quick Download
Binaries Pack: libtwdll-0.10.0.zip
Documentation: docs-0.10.0.zip
Security Attestation: Verified Sigstore Attestation
VirusTotal Scan (DLL): Multi-AV Report
Changelog
Added
- Added
twdll.tweakersmodule andTWEAKER_SCRIPT_INTERFACEobject interface (twdll.tweakers.<name>.value = val,twdll.tweakers.Find(name),twdll.tweakers.GetList(),twdll.tweakers.Dump()) — provides dynamic reflection, inspection, and modification of all 3,731 internal developer engine tweakers across campaign variables, battle combat, AI behaviors, and rendering with automatic state rollback on Lua teardown. Transparently routes mutations to the active campaign model for all 714 Campaign Variables (action points, marriage/child birth rates, cultural conversion, looting, attrition, autoresolve, and plagues) alongside direct KV database items and per-frame shader/physics tweakers. Supports direct table property assignment (twdll.tweakers.<name>.value = val), property inspection on tweaker objects (.name,.category,.description,.file,.line,.value), object method chaining (:GetValue(),:SetValue(val)), and bulk list iteration viaGetList(). - Extended the game's faction interface (
FACTION_SCRIPT_INTERFACE) withGetTechnologyStatus(technology_key)andSetTechnologyStatus(technology_key, status)— reads and dynamically changes technology research statuses (0= researched,1= disabled,2= researching,3= available,4= unavailable,5= not present,6= locked by faction level), instantly recalculating faction effect lists in real time (custom non-researched statuses must be re-applied onFirstTickAfterWorldCreatedafter save/load due to vanilla tree solver re-evaluations). - Extended the game's faction interface (
FACTION_SCRIPT_INTERFACE) withInstantlyResearchTechnology(technology_key, [report_to_ui=false])— instantly completes research of a technology through the game's native research completion path, firing events, achievements and unit upgrades and completing parent prerequisites recursively (defaultsreport_to_uito false to prevent engine crashes on technology modules without completion bundles). - Added
twdll.world.SaveGame(filename),twdll.world.LoadGame(filename),twdll.world.ExitToMainMenu(), andtwdll.world.ExitGame()— provides full programmatic control over the campaign lifecycle, enabling saving the active game to disk, loading saved games, exiting campaign to the main menu, and cleanly exiting the game process to Windows. - Added
twdll.core.GetBuildSha()— returns the 40-character hexadecimal git commit SHA hash from which the active DLL binary was compiled. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withGetFullName(),GetForename(),SetForename(name),GetForenameKey(),SetForenameKey(key),GetFamilyName(),SetFamilyName(name),GetFamilyNameKey(),SetFamilyNameKey(key),GetClanName(),SetClanName(name),GetClanNameKey(),SetClanNameKey(key),GetOtherName(),SetOtherName(name),GetOtherNameKey(), andSetOtherNameKey(key)— dynamically reads and modifies all 4 name slots (forename, clan name, family name, and other name/title) on any character, providing explicit dual-path support for direct in-memory custom UTF-8 text strings as well as multi-language database localisation keys (names.loc), persisted across turns and save/load. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withIsImmortal(),SetImmortal(is_immortal),GetResurrectionTurns(), andSetResurrectionTurns(turns)— inspects and controls character immortality flags (wounding instead of permanent death) and resurrection countdown turns. - Extended the game's faction interface (
FACTION_SCRIPT_INTERFACE) withCreateAgent(agent_key, [settlement_or_x], [y])— instantly creates and spawns a new agent character (e.g."spy","champion","dignitary","priest") on the campaign map adjacent to a settlement (defaults to faction capital) or at specific map coordinates (x, y) in the current tick. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withTransferToFaction(target_faction, [options])— instantly transfers the character and their commanded military force to another faction in the current tick. Supports an optional table{ replenish_units = bool, rebel_region = region }, with native engine cleanup of governorships/commerce raids/political plots, instant unit replenishment, regional rebel army creation, and proper event emission. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withGetLoyalty(),GetLoyaltyModifier(),SetLoyaltyModifier(value), andGetLoyaltyFactorList()— dynamically reads total calculated character loyalty (0 to 10), inspects and adjusts the direct character loyalty modifier, and returns a detailed key-value table breakdown of all active loyalty factors resolved directly from the game'sloyalty_factors_tablesdatabase. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withAddTrait(trait_key, [show_message]),RemoveTrait(trait_key), andGetTraitList()— dynamically adds traits (via native command queue), removes traits and cleanly recalculates active stat bonuses and effect bundles, and returns a Lua array of all trait key strings currently present on the character. - Added
twdll.world.GetMaxTraits()andtwdll.world.SetMaxTraits(val)— dynamically gets or sets the maximum character trait cap (vanilla hardcap of 10), enabling characters to acquire and display more traits across all trait acquisition systems. - Extended the game's military force interface (
MILITARY_FORCE_SCRIPT_INTERFACE) withGetIntegrity(),SetIntegrity(value), andHasIntegrity()— dynamically gets, sets (with clamping between 0.0 and 100.0), or checks army integrity in real time. - Extended the game's unit interface (
UNIT_SCRIPT_INTERFACE) withDisband()— disbands (permanently removes) this unit from its military force using the engine's native disband path. - Extended the game's military force interface (
MILITARY_FORCE_SCRIPT_INTERFACE) withDisbandUnits(...)— disbands one or more units from the military force, accepting eitherUNIT_SCRIPT_INTERFACEobjects or integer unit indices (0-indexed) as varargs. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withSetArtSet(art_set_key)— dynamically changes the character's visual master bundle (Campaign VMD, Battle VMD, Politician VMD, and 2D portraits) in real time, persisted across turns and save/load. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withGetArtSet()returning anARTSET_SCRIPT_INTERFACEuserdata for character art sets and portrait data (GetKey,GetCulture,GetSubculture,GetFaction,GetAgent,GetGroup,IsCustom,IsMale,HasAging,HasSeasonal,HasLevelling,HasHealth,HasReligion,IsFactionLeaderSet,GetPortraitPath,GetSettingsId). - Added
twdll.cai.EnableLogging([enabled])— enables or disables real-time Campaign AI decision logging and telemetry totwdll.log, capturing settlement occupation choices (OCCUPY,SACK,RAZE,LOOT, etc.) and decision bitmasks. - Added
REGION_SCRIPT_INTERFACE:GetReligionList()returning aRELIGION_LIST_SCRIPT_INTERFACElist of all religions present in the region, andREGION_SCRIPT_INTERFACE:GetReligionProportion(religion_key)returning the raw float proportion (0.0 to 1.0) of a specific religion. AddedRELIGION_SCRIPT_INTERFACE(GetKey,GetProportion,GetIconPath) representing individual religion entries. - Added
twdll.campaign_ui.SetEncyclopediaUrl(url)andtwdll.campaign_ui.GetEncyclopediaUrl()— dynamically gets or sets the base URL prefix for the in-game encyclopedia (e.g. redirecting in-game encyclopedia buttons to a custom local or web server), with automatic restoration of the game's default URL when passednilor an empty string. - Extended the game's settlement slot interface (
SLOT_SCRIPT_INTERFACE) withGetBuildingRotation(),SetBuildingRotation(rotation), andRefresh()— reads or sets the campaign-map building model rotation (0..5, representing 60-degree increments), persisted natively across save/load. Visual changes can be applied viatwdll.campaign_ui.RefreshSettlements()orslot:Refresh(). - Added
twdll.campaign_ui.RefreshSettlements()to force an immediate campaign-map visual refresh of all settlement building models without reloading. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withGetInfluence()andSetInfluence(value)— dynamically reads or modifies the character's political influence. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withSetDefaultBodyGuard(unit_key)— sets a persistent default bodyguard unit for a general, saved natively with savegames and enforced at all recruitment and replacement choke points. - Extended the game's character interface (
CHARACTER_SCRIPT_INTERFACE) withGetPoliticalParty()andSetPoliticalParty(party)— gets or sets the character's political party allegiance, accepting either aCAMPAIGN_POLITICAL_PARTYobject or a party record key string. - Extended the game's faction interface (
FACTION_SCRIPT_INTERFACE) withGetPoliticalPartyList(),GetPoliticalParty(party_key),GetPrimaryParty()andHasPoliticalParties()for campaign politics, plus a newCAMPAIGN_POLITICAL_PARTYscript interface (GetKey,GetSenators,GetPower,IsPrimary,SetPrimary) for the party objects they return.GetPoliticalPartyList()returns a native-style party list (POLITICAL_PARTY_LIST_SCRIPT_INTERFACE) iterated withnum_items(),item_at(index), andis_empty(). - Extended the game's region interface (
REGION_SCRIPT_INTERFACE) withGetPopulationSurplus(),SetPopulationSurplus(value),GetGrowthPoints(), andSetGrowthPoints(value)— dynamically reads or modifies the population surplus (points to expand settlement slots) and growth points of a region. - Extended the game's faction interface (
FACTION_SCRIPT_INTERFACE) withSetCapital(region)— makes the given region the faction's capital. - Extended the game's unit interface (
UNIT_SCRIPT_INTERFACE) withConvertUnit(unit_key)— replaces the unit with a new unit of the given type in the same army, using the engine's native unit conversion path (same as religion/technology upgrades). Health proportion (scaled men count), experience, and combat statistics are preserved, and general bodyguard snapshots are automatically synchronised. The original unit object is destroyed.
Changed
twdll.world.SetMaxTraits([val]),twdll.world.SetMaxUnitsInArmy([val]),twdll.world.SetMaxUnitsInNavy([val]), andtwdll.world.SetReinforcementCap([val])now accept no arguments ornilto restore the game's vanilla defaults, and all modified world/engine limits are automatically rolled back to their original vanilla values when the Lua environment is detached/cleaned up.twdll.core.Lognow accepts any number of arguments of any Lua data type (e.g.nil, numbers, booleans, tables, userdata), automatically converting them via Lua'stostringsimilar to standardprint(...).GetInfluence/SetInfluencereplace the legacy Rome 2 character methods (GetGravitas/SetGravitasandGetAmbition/SetAmbition).
Fixed
- Fixed an issue where multiple
package.loadlibcalls across scripts within the same campaign session created duplicate garbage collection proxies, causing premature uninstallation of campaign hooks during gameplay.
SHA-256 Checksums
7231e0ed5c9093dc00e57d91a907317e7d757fb8681b7b7928e6762eaf3223f0 libtwdll-0.10.0.zip
c303ed8283d8e7f125f1532d5f17b3eb88a6bb7d475ffca5c393c50c4e160e29 docs-0.10.0.zip
b1abca213675e1185cb7277e25118a6f85e93a341b896c5fa9ca8524270e9c84 twdll_attila.dll
d419ff80ab8702ade94111504d609ec35ebd3432899db514a83b2838f35dfab9 twdll_attila.pdb