Skip to content

bukowa/twdll

Repository files navigation

Total War Script Extender (twdll)

Build CodeQL

Run custom C++ code inside Total War: Rome II and Attila's Lua engine.

Installation

  1. Download latest release from Releases
  2. Extract twdll_rome2.dll or twdll_attila.dll to your game folder
  3. The DLL only activates when called by a mod

Usage

Load the DLL in your Lua script:

-- For Rome 2
package.loadlib("twdll_rome2.dll", "luaopen_twdll")()

-- For Attila
package.loadlib("twdll_attila.dll", "luaopen_twdll")()

-- Use the API
twdll.Log("Hello from C++!")

Docs:

Development

Requirements

  • Visual Studio 2022 (C++)
  • CMake 3.29+

Build

# Rome 2
cmake --preset rome2
cmake --build --preset rome2

# Attila
cmake --preset attila
cmake --build --preset attila

Project Structure

src/
├── main.cpp              # DLL entry point
├── common/               # Shared utilities
├── rome2/                # Rome 2 specific code
└── attila/               # Attila specific code

Release

  1. Update CHANGELOG.md
  2. Commit and push to master
  3. Create git tag: git tag v1.0.0 && git push origin v1.0.0
  4. GitHub Actions builds and releases automatically

About

twdll is a mod for Total War: Rome II & Attila that extends the game's scripting capabilities by registering custom Lua functions

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors