Does anyone know if it is possible to create a new unit from python.
I want to allow a worker to build a air base. The way I was going to have it happen is to add a imrovement called "air strip construction" with a upgrade time of say 4 turns, and then when the improvement is upgraded, replace it with a air strip unit (which I have based on the carrier except it is a land unit now and has no movement).
However I can't find any API function which allows a new unit to be created (other than giving a order to a city to start training one).
The only other workable idea I have came up with is that you have to build one as normal (in a city) and then get your worker to start working at the site (and build the improvement) and then once it is complete (or upgrades), automatically move the prebuilt airbase to the new location. But this is far from ideal.
The other way which is the easiest but the most unrealistic is to just allow the airbase to move. It also is a bit wierd to have to load your airbase (which at the moment is using the graphics of the carrier (which actually doesn't look that bad on land when stationary)) onto a transport ship or even a galleon so you have one to support your conquests on a different continent.
I want to allow a worker to build a air base. The way I was going to have it happen is to add a imrovement called "air strip construction" with a upgrade time of say 4 turns, and then when the improvement is upgraded, replace it with a air strip unit (which I have based on the carrier except it is a land unit now and has no movement).
However I can't find any API function which allows a new unit to be created (other than giving a order to a city to start training one).
The only other workable idea I have came up with is that you have to build one as normal (in a city) and then get your worker to start working at the site (and build the improvement) and then once it is complete (or upgrades), automatically move the prebuilt airbase to the new location. But this is far from ideal.
The other way which is the easiest but the most unrealistic is to just allow the airbase to move. It also is a bit wierd to have to load your airbase (which at the moment is using the graphics of the carrier (which actually doesn't look that bad on land when stationary)) onto a transport ship or even a galleon so you have one to support your conquests on a different continent.