It should, yes. I honestly haven't used it in any of my OWN code before, but I've seen how others have so I'm fairly sure it will work here. Let me know how it goes.
Normally I'd say to not use it, as this code is ran EVERY time the unit is selected... But in this case, with a simple one-line effect, I don't think it's too intensive.
Afaik you have to loop over all plots for this: In my mod I used this to determine whether a civ has a copper resource and should research bronze working:
Spoiler :Code:if eTeam.isHasTech(gc.getInfoTypeForString('TECH_BRONZE_WORKING')) == False: if eTeam.isHasTech(gc.getInfoTypeForString('TECH_MINING')): if eTeam.getAtWarCount(True) >= 1: bhascopper=0 for i in range (CyMap().numPlots()): pPlot = CyMap().plotByIndex(i) if pPlot.isOwned(): if pPlot.getOwner() == ePlayer: eBonus = pPlot.getBonusType(TeamTypes.NO_TEAM) if eBonus == gc.getInfoTypeForString('BONUS_COPPER') : bhascopper=1 if bhascopper==1: iTech = gc.getInfoTypeForString('TECH_BRONZE_WORKING')
Will this check each plot in each turn? Wouldn't that resources intensive? My poor old comp.![]()
Commenting in XML is a bad idea in general. In many cases in the DLL it doesn't check to ensure that the next line is a non-comment, just that it exists. Then it skips the comments, and attempts to work with what it reads, which now might be nothing, and thus a crash. Can also wind up being that it is in a specialized loop, thinks there is more, turns out it was just a comment, which it skips, now it is trying to stay in the special loop, but loading data not intended for it, and now instead of a crash you just have REALLY weird errors.
Thanks, xienwolf. I had a bad feeling it would be in the Python: I know nothing about Python, so it's not something I'll be editing anytime soon.Hamster: Most of what spells do, especially complicated things like world spells, are done in python, CvSpellInterface.py in Assets/Python/entrypoints.
Look at the spell "Sacrifice" that can be cast in a city with a Demon's Altar (not the one cast on the Pyre of the Seraphic by Angels) for a sample of adding beakers upon casting a spell.
You are correct about slayer, you cannot grant a bonus against multiple promotions in the XML, you would have to grant 3 promotions, each giving a bonus against a single other promotion.
Savants work through UnitInfos, just like a Great Person.
Python is pretty intuitive and readable. There are some format rules which you may not get right away, but if you copy from what exists already, you make few mistakes, and people here can usually point them out for you pretty quickly as they have made the same mistake at some point previously.
Thank you for your encouragement. With everything backed up, I suppose there's no harm in experimenting with the Python. The Kuriotates world spell is similar to what I want, except it produces culture and not beakers.Savants work through UnitInfos, just like a Great Person.
Python is pretty intuitive and readable. There are some format rules which you may not get right away, but if you copy from what exists already, you make few mistakes, and people here can usually point them out for you pretty quickly as they have made the same mistake at some point previously.
By the way, what is <AddPromotionType1>NONE</AddPromotionType1> from the Spellinfos file for?
Usually the field says "NONE", but a few like "Join Great Commander" or "Blur" have PROMOTION_GREAT_COMMANDER or PROMOTION_BLUR in that field respectively.
I tried to use it to make "Slayer" a catch-all, but it did not work.