Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Most of AI script files don't use native functions, it's mean that they could be modified, recompiled and reused as mods.
Preparing UDK project
Development/Src/MMH7AIMod/Classes/*files to Your UDK project.
- Edit file
[UDK Project]\UDKGame\Config\DefaultEngine.iniin Your UDK project. Add to section
Currently MMH7AIMod is proof-of-concept of possibility to modding AI scripts. It consists of few classes that makes possible to inject Your AI classes into game. These files should not change anything in scripts behavior.
- AIModObjectsBuilder - creates Combat AI and AI Sensors
- AIModAdventureAiBuilder.uc - modified copy of H7AdventureController, it's used to inject AIModH7AiAdventureMap into game. Don't modify this class, it's only used method is InitAdventureAI.
- AIModH7AiCombatMap - copy of H7AiCombatMap.
- AIModH7AiAdventureMap.uc - modified copy of H7AiAdventureMap
Simple/Dumb AI mod example
Let's make simple mod that changes behavior of scripts.
- First copy "H7AiSensorGoodTimeToWait.uc" from "MMH7Game" to "MMH7AIMod"
- Rename file and class inside to "MyH7AiSensorGoodTimeToWait".
- Open file "MyH7AiSensorGoodTimeToWait.uc" and change implementation of "IsGoodTimeToWait" method to `return true;'
- Open file "AIModObjectsBuilder.uc" and change
mSensors.InsertItem(ACS_GoodTimeToWait, new class 'H7AiSensorGoodTimeToWait' );to
mSensors.InsertItem(ACS_GoodTimeToWait, new class 'MyH7AiSensorGoodTimeToWait' );
- Install and run game with mod.
Now enemy creature will always start their round from waiting.
- Recompile script using "UnrealFrontend".
- Copy "UDKGame\Script\MMH7AIMod.u" to game directory "Might and Magic Heroes VII\MMH7Game\CookedPC"
- Open file "[My Documents]\My Games\Might & Magic Heroes VII\MMH7Game\ConfigMMH7Engine.ini". Add to section
- Run game and wait until main menu appears.
- Inject mod dll "MMH7ScriptsMod.dll" using "Extreme Injector". You can get "MMH7ScriptsMod.dll" by compiling sub-project "MMH7ScriptsMod" or here