Total War: WARHAMMER

Total War: WARHAMMER

AI General Mode
grimwold Jun 21, 2017 @ 2:15pm
For other total wars
So is there a chance for this to come out for other total wars.
< >
Showing 1-7 of 7 comments
Nozkin Aug 9, 2017 @ 6:37am 
It seems like the original author isn't planning too, so I'm making a half-arsed attempt to port this to Atilla. I'm probably in over my head so it's 50/50 really but I'll let you know if I manage it.
grimwold Aug 9, 2017 @ 7:00am 
thanx atilla was pritty fun.
Barbecue Sep 9, 2017 @ 2:35pm 
Originally posted by Nozkin:
It seems like the original author isn't planning too, so I'm making a half-arsed attempt to port this to Atilla. I'm probably in over my head so it's 50/50 really but I'll let you know if I manage it.

Yea let us know bro I really want this for Attila or something
Kase Aug 4, 2018 @ 3:42pm 
please on rome2. I miss this mod sooo much
ckleomh Jul 19, 2019 @ 9:42am 
From Hambango , the author, when asked for pointers to duplicate his mod :



First you'll need the Package File Manager : https://sourceforge.net/projects/packfilemanager/
With this tool you'll be able to open the game's .pack files (and my mod) .

When you open my mod with it, you'll see the three files it changes:

"lib_battle_script_unit.lua" and the "battle_start.lua"for both campaign and custom battles.
All three files are included in WH1's data.pack and WH2's data.pack and data_2pack.
I have no idea where they are located for R2 and Attila, or if they even exist for those games.

The changes in "lib_battle_script_unit.lua" are fairly minor. I only added some variables I needed for my code and changed one line which gave new script units their name .
This line I had to change, because the original version gave units from two different reinforcing armies the exact same names, which lead to the ai planner not being able to distinguish them.

The two "battle_start.lua" files represent the main part of my mod.
I'd suggest starting with Spectator mode, it's a little easier to get into, I guess.

What the mod does in a nutshell is initializing a new ai script planner (the kind which is also used for the enemy ai) and asign to it the units the user selects. The script units are taking from the script units list which is associated with the player's army. There are some additional functions like checks for summons, reinforcements which just arrived on the battlefield, etc., nothing too complicated.

A little warning: the new function, which is used for the chasing down of routing enemies after the battle's won, has been cobbled . So it's VERY rudimentary, and I'm sure the sorting algorithm for each unit's target could be done much better. I'll revisit it sometime in the future.

AI General is a little bit more complex, as it uses the internal names given to the UI components representing the unit cards as reference to the selected units. There's no direct way to link a unit card to the script unit it represents. So I had to take the name string of the cards and calculate from it their unit's index in the script unit array. I's a bit messy but it seems to work.

As you'll soon see my whole code is a bit messy. This is mainly because it has grown massively over time as more and more new stuff has been added. That and the fact, that I'm not that reat of a coder :D

There are some files I'd suggest you take a good look at, in order for you to understand the inner workings of the battle scripts. All those files are contained in the data.pack for WH1 and WH2. In there they are located in the script\_lib folder (Again, I've got no idea where they are for R2 and Attila):

lib_battle_manager.lua
lib_battle_script_ai_planner.lua
lib_battle_script_unit.lua
lib_generated_battle.lua

Here are some web resources which proved useful to me:

http://www.twcenter.net/forums/showthread.php?742110-Turn-on-lua-log-file-Maybe-quite-helpful-for-everyone-who-is-working-with-the-lua-scripts-

http://wiki.totalwar.com/w/Total_War:_ATTILA_KIT_-_Campaign_Script_Interface

http://wiki.totalwar.com/w/Battle_Script_Documentation

http://www.twcenter.net/forums/showthread.php?425548-List-of-all-Lua-functions-used-by-NTW

Sadly, the scripting documentation provided by CA is rather lacking.

Alright. that's it for now
I hope I was able to help you out a bit.
Feel free to ask if you've got any questions!

Have a good one!
Last edited by ckleomh; Jul 20, 2019 @ 1:16pm
Trazyn the Infinite Oct 10, 2019 @ 12:23am 
I am so grateful for the existence of this mod for Warhammer 2, and were this to exist for Rome 2.. my god. It'd be heaven. Attila would be downright sweet too, as Ancient Empires is quite a lovely mod unto itself (I like Ancient Rome in its happy times, not it's OH GOD WHY IS EVERYTHING ON FIRE! times heh).
AlienEatingPizza Oct 29, 2019 @ 10:00pm 
Any Updates On this?
< >
Showing 1-7 of 7 comments
Per page: 1530 50