youneuoy / M2TWEOP-library

Completely rewritten version of EOP
https://youneuoy.github.io/M2TWEOP-library/
GNU General Public License v3.0
53 stars 7 forks source link
assembler d3d9-overlay game-development hooking imgui lua-api plugins-api reverse-engineering
EOP

[![Build Status](https://img.shields.io/github/v/release/youneuoy/M2TWEOP-library?style=for-the-badge&color=3d1d00)](https://github.com/youneuoy/M2TWEOP-library/releases) [![Build Status](https://img.shields.io/github/downloads/youneuoy/M2TWEOP-library/total?style=for-the-badge&color=a87300)](https://github.com/youneuoy/M2TWEOP-library/releases) [![Build Status](https://img.shields.io/discord/713369537948549191?style=for-the-badge&label=Discord&color=b33102)](https://discord.gg/Epqjm8u2WK)
## What is M2TWEOP? The M2TW Engine Overhaul Project (M2TWEOP) is designed to expand the capabilities of the strategy game *Medieval 2: Total War*. EOP uses C++ and Assembly to modify the game's code in-memory and exposes this to the end user via a Lua API.

Features

Contributions

This project wouldn't be possible without all the amazing contributions from the Medieval 2 modding community. Thank you to all of our contributors so far!

Lua Examples

Removing engine limits

function onPluginLoad()
    M2TWEOP.unlockGameConsoleCommands();
    M2TWEOP.setAncillariesLimit(16);
    M2TWEOP.setMaxBgSize(100);
    M2TWEOP.setReligionsLimit(50);
    M2TWEOP.setBuildingChainLimit(40);
    M2TWEOP.setGuildCooldown(3);
end

Playing sounds, displaying GUIs and spawning units

-- onGeneralAssaultsGeneral is a custom EOP event
function onGeneralAssaultsGeneral(eventData)
    local attacker, defender = eventData.attacker, eventData.defender
    -- Check if the character is a Nazgul
    if (hasTrait(attacker, "NazgulRace")) then
        -- Play a sound
        playSound(nazgulScream)
        -- Display some text
        showWindow("The Nazgul have arrived.")
        -- Spawn a new unit
        spawnUnit("Gondor Infantry", "Anorien", "Minas Tirith", 3, 4, 1, 1)
    end
end

For a full list of EOP Events, see here

Getting Started with M2TWEOP Lua Scripting

M2TWEOP-Tutorials

Building Locally

M2TWEOP Library and GUI

Requirements

Use Choco for easy installation of the DirectX SDK.

How to build

  1. Clone the project
  2. Run Developer Powershell for Visual Studio 2022 in Admin mode
  3. Navigate to where you have cloned/extracted the project
  4. Run a build script like
# Default build script for full release
.\buildEOP.ps1 -modFolder "E:\Steam\steamapps\common\Medieval II Total War\mods\Tsardoms-2.2"

# Release build script without config or luaPluginScript.lua
.\buildEOPDev_release.ps1 -modFolder "E:\Steam\steamapps\common\Medieval II Total War\mods\Tsardoms-2.2"

# Debug build script without config or luaPluginScript.lua
.\buildEOPDev_debug.ps1 -modFolder "E:\Steam\steamapps\common\Medieval II Total War\mods\Tsardoms-2.2"

You can get support for building/developing on our Discord server.

Documentation

If you want to open a PR to fix documentation/Intellisense issue, please refer to the following files

See the README in the documentationGenerator folder for more details

Disclaimer

Acknowledgments

Version History

License

The project uses the GPL-3.0 License.