Adding units to AI / modding difficulty

Delian0

Chieftain
Joined
Dec 22, 2014
Messages
4
Hello,

I'm trying to make a mod which changes difficulty by adding specific units to all AI players at the start. Is there any way I could accomplish this?

Thanks.
 
If you want generic defensive, explorer or worker units, you can write an XML only mod to alter the AIStartingDefenseUnits, AIStartingWorkerUnits and AIStartingExploreUnits values in the HandicapInfos table.

If you want to add specific units to specific AI sponsors, you can use Lua to add the units as the game starts via the pPlayer:InitUnit() method (see FreeAlienUnitPlotBonus.lua and FreeOrbitalUnitPlotBonus.lua for examples)
 
Thank you for the information whoward69.

If I may ask, which would be the best event in which I should add my code? Something like.. OnAIPlayerPlanetfall.

Thanks.
 
Top Bottom