Platyping's Promotions and Traits

Wanted to know what you thought about this new modding thing I want to implement for the enhanced promotions modcomp...

I am adding two new tags in the xml

pythonCanDo
pythonCallback

this work similarly to the events versions

so a new python file CvPromotionsInterface would be used where you can define the python functions used to determine custom conditions for promotions and a custom effect.

how useful do you think that would actually be for modders that plan to use the mod?
 
well, would you find that useful? if in vanilla instead of putting your promotion codes in EventManager you can make them directly for promotions?

I've decided on two types of promotion canDo

canAlwaysDo
canDo

where can Always do overrides the normal prerequisites for a promotion (like prereq promotions, techs, tier etc)

those would be useful right :p
 
Well, since I don't even play Civ nowadays, why will I find it useful or not :D

But generally, modders who have decent knowledge of python/SDK will be able to do modifcations whether you put your codes in EventManager or your new file.

Modders who have no understanding of programming will still not understand what to do with that file, so who is your target audience :D
 
Sorry to bump, but I noticed that you deleted a bunch of your promotions. While I'm not going to ask for the reasoning behind this (I suspect it deals with quality > quantity), I was wondering if you or anyone else still had the Summoner and Necromancer promotions. If so, could you please send them to me?
 
Sorry to bump, but I noticed that you deleted a bunch of your promotions. While I'm not going to ask for the reasoning behind this (I suspect it deals with quality > quantity), I was wondering if you or anyone else still had the Summoner and Necromancer promotions. If so, could you please send them to me?

Today is your lucky day :D i have, see attach file.
 

Attachments

  • Promotions.rar
    768.4 KB · Views: 171
Sorry to bump, but I noticed that you deleted a bunch of your promotions. While I'm not going to ask for the reasoning behind this (I suspect it deals with quality > quantity), I was wondering if you or anyone else still had the Summoner and Necromancer promotions. If so, could you please send them to me?

Whatever isn't in the promo and trait pack, all deleted.
All standalones also deleted.
 
I was wondering if someone could help me. I tried adding the Arrogant trait and got some peculiar results. Here is what I did:

Added XML from Module folder
Added Python code from included python file

Game seemed to work and would run when I tried it out. Now, I had a copy and paste remnant and arrogant trait also gave 100% pillage gold.

When I removed it and made arrogant trait worth only the trait intended by Platyping, the game would crash upon starting a custom scenario and launching.

Any ideas?
 
@ WilliamOfOrange: how where you getting the 100% pillage Gold? Which file? Maybe if you would post this file it could help.

@ Platyping: is this intended?
Spoiler :
Code:
## Corrupt Trait ##
		iPlayer = pCity.getOwner()
		pPlayer = gc.getPlayer(iPlayer)
		if pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_ARROGANT")):
			pPlayer.changeGold(- pCity.getProductionNeeded() /10)
## Corrupt Trait ##

Edit:
@ WilliamOfOrange: it's not Python crashing the game, maybe it's a mismatch in a Schema file (like CIV4CivilizationsSchema.xml for example). I would not use modules for this, merge it with your mod and test it again.
 
Fixed and reuploaded. That was for corrupt trait.
 
@ WilliamOfOrange: how where you getting the 100% pillage Gold? Which file? Maybe if you would post this file it could help.

Isenchine: It was a copy and paste from the Orbis modmod

Edit:mad: WilliamOfOrange: it's not Python crashing the game, maybe it's a mismatch in a Schema file (like CIV4CivilizationsSchema.xml for example). I would not use modules for this, merge it with your mod and test it again.

yeah, thanks....forgot to mention and was just going to edit my post to add that I could not find anything from the Schema file that needed to be added. I know there must be something, but could not find it. Perhaps a must closer look. If I just use the modules, it should work with whatever mod, right?
 
Isenchine: It was a copy and paste from the Orbis modmod

Which doesn't say which file it was (Python ?). But I guess it's not the problem.


yeah, thanks....forgot to mention and was just going to edit my post to add that I could not find anything from the Schema file that needed to be added. I know there must be something, but could not find it. Perhaps a must closer look. If I just use the modules, it should work with whatever mod, right?

I don't play with modules as they can often be a source of problems (I always merge everything), but I experimented the Negative Traits Modules with my mod and I had no problem, even when my Civilization Schema is different thant this one.

So apparently the fact that it has a different name (NegativeTraits_CIV4CivilizationsSchema.xml) is sufficient for it to check only the additional loading of just the file NegativeTraits_CIV4TraitInfos.xml.

Which doesn't help you a tad, sorry!...
 
Some of these traits go out of sync for multiplayer

An example of a fix for expansive trait

in

def onCityBuild ....
Code:
 if pPlayer.hasTrait(gc.getInfoTypeForString("TRAIT_EXPANSIVE")):
             iExpansive = 5014   #make sure this id is not used for anything else
             iPlayer = city.getOwner()
	     iCity = city.getID()
	     CyMessageControl( ).sendModNetMessage( iExpansive, iPlayer , iCity, -1, -1 )
and then in

def onModNetMessage ....

Code:
       if iData1 == 5014:
	     pPlayer = gc.getPlayer(iData2)
	     pPlayer.getCity(iData3).changePopulation(1)
other traits that cause out of sync ( there are a few ) can be fixed in a similar way
 
Top Bottom