Python Question

Flying Pig

Utrinque Paratus
Retired Moderator
Joined
Jan 24, 2009
Messages
15,647
Location
Perfidious Albion
What do you need to do to make a building which spawns units upon its construction? Like having an MI5 building which gave you 5 spies, or a Royal Marines Poole wonder which gave you marines?

I assume it can be done in Python, but how would you actually do it?
 
What do you need to do to make a building which spawns units upon its construction? Like having an MI5 building which gave you 5 spies, or a Royal Marines Poole wonder which gave you marines?

I assume it can be done in Python, but how would you actually do it?

tsentom1's King Richard's Crusade wonder gives a free unit upon construction (and then every few turns after). You can probably scavenge and adapt the first part of his code. It probably uses onBuildingBuilt in the EventManager.
 
I'm no python expert, but i'm fairly sure it can be done with the "onBuildingBuilt" function in the cvEventManager. As for how to do it, i'm not sure, but you could probably scavenge some code from tsentom1's King Richard's Crusade wonder, which gives free Crusader units every few turns (just remove the "every few turns" part).


EDIT: ninja'd by turningmachine!
 
Back
Top Bottom