Directing the AI to utilize its UA in Lua -- possible?

Vicevirtuoso

The Modetta Man
Joined
May 14, 2013
Messages
775
Location
The Wreckage, Brother
So, I've currently gotten a version of my Metal Gear Solid civilization on the Workshop uploaded as a beta. One of the main reasons it's still a beta is that the AI cannot utilize its unique ability, which is to gain gold and other bonuses by keeping units stationed in the territory of a protected City-State. I've done a fair bit of Lua coding by this point, but I've never worked with AI scripting and don't even know if it's possible without DLL edits.

Basically, I want the AI to send some military units to CS territory and keep them there. The circumstances it would do this are: only when it is playing a specific civilization (my modded civ), if it has a strong military compared to the rest of the world (at least in the top 1/3 in military rank), and is not currently at war with someone stronger than them. It would also need to check whether or not the civ is currently protecting the CS and how close it is to its capital. Is this possible with only Lua?
 
Shortly, yes.

All your circumstances are easy to check (remember to check if player is not human ;))
Harder parts are assigning certain unit to certain city-state (once circumstance are met) to continuously move there and pathing.

Of course, it will be more challenging logistically than average.
 
Back
Top Bottom