Change Unit Cost on LUA

ZeeroHell

Chieftain
Joined
Aug 12, 2015
Messages
5
Is there a way to Change the Unit Train Cost trought LUA? Execute a XML file with an <Update>, or an SQL file, any way that could change the Unit Train Cost.

What I want is a unit with a fixed amount of turns to be built.

I have done a check that If Unit isn't being training, the Cost would be the (City Actual Production * Number of Turns I want), that way, it would update dynamically, and wouldn't if the unit is current being trained, the problem is that I can't define the unit Cost trought LUA (Database row is read-only from Lua) :sad:
 
Using Lua, City.CanTrain() in conjunction with a number of copies of your unit with varying cost values is the only way that comes to mind.

It could certainly be done with a custom DLL.
 
Back
Top Bottom