I'd like to modify the West Point national wonder to make the game a little more interesting:
Instead of giving military units produced in that city an additional 4XP, I'd like for them to instead be randomly given one of three promotions normally reserved for Great Generals (Leadership, Tactics, or Morale). I'd also want to offset this advantage by requiring additional time to create military units in that city (-25% or -50% production bonus).
Is this a pretty easy mod to make? Where do I get started?
Well, this does sound like a programming job. Do you know any?
In my signature there is a link to a Python modding tutorial, so that would be a starting point.
The first part would be possible to do in CvEventManager.py on the unitBuilt callback. You basically intersect the game once any unit is built and detect if the city has the wonder. If so, you add one of the promotions randomly. The methods you need are CyCity.isHasBuilding() and CyUnit.setHasPromotion(), but you also need to know the enumerated index value of both the wonder and the promotions (the BuildingType and the PromotionTypes respectively). For this you should use CyGlobalContext.getInfoTypeForString() - for compatibility reasons.
The second part (increased build cost for units in the city) could possibly be done with a negative value in Civ4BuildingInfos.xml (the iMilitaryProductionModifier) tag.
If the above doesn't make perfect sense to you, then you need to start learning some of the basics of Python programming and modding in general. Or you could ask someone with a little experience to do this mod for you. It would be about 50 times less work to simply write the code than to guide someone with no experience (if this description fits you) through creating this mod.
I'd give it a try myself, if I have the time. Well, I already spent time on this mod by writing this post. Are you gonna create this mod from a standard BtS installation or are you basing it on another mod?
edit: I'm not sure about making units more experienced to build... Perhaps turn the new-and-improved West Point into a World Wonder instead?
edit, again: I wrote a Python script for use with the standard BtS CvEventManager.py. I just couldn't help myself, plus it only took about 3 minutes.
Spoiler:
Code:
def onUnitBuilt(self, argsList):
'Unit Completed'
city = argsList[0]
unit = argsList[1]
player = PyPlayer(city.getOwner())
[B] eWestPoint = gc.getInfoTypeForString("BUILDING_WEST_POINT")
if city.isHasBuilding(eWestPoint):
iRandPromotion = CyGame().getSorenRandNum(3, "west point")
if iRandPromotion == 0:
ePromotion = gc.getInfoTypeForString("PROMOTION_LEADERSHIP")
elif iRandPromotion == 1:
ePromotion = gc.getInfoTypeForString("PROMOTION_TACTICS")
elif iRandPromotion == 2:
ePromotion = gc.getInfoTypeForString("PROMOTION_MORALE")
unit.setHasPromotion(ePromotion, True)[/B]
Since this is for a standard BtS game, this should also work the same:
Code:
if city.isHasBuilding(113): unit.setHasPromotion((44, 45, 47)[CyGame().getSorenRandNum(3, "west point")], True)
I was just looking to modify the West Point national wonder in standard BtS. I'd like to keep it a national wonder so more than one civilization in the game could (conceivably) be able to produce multiple units with these promotions attached to them.
I like the idea of random, because I don't want the player to have complete control over the situation. It's almost like great people, but with military units. Maybe you'll get that grenadier with a Leadership promotion; maybe he'll come out with Tactics instead, and you'll find a different use for him. The increased build time for units was just an idea I had to partially compensate for the power of the wonder, and arguably to add some realism (think of it as extra training time for elite officers).
(Incidentally, I have absolutely no idea how such a wonder would appeal strategically to the AI. I imagine it would be difficult to express its value.)
I appreciate your help with this, and I'll have a look at the modding links you recommended.
Ahh...one thing I forgot. I would want one of those three promotions INSTEAD OF the 4exp West Point normally provides. Is there a way of shutting the +4exp off?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.