Modding Elohim and Khazad

razzach

Warlord
Joined
Mar 14, 2009
Messages
125
Questions about Modding:

1. I cant seem to mod the Elohim's ability to get traits from Unique Features. I already added onMove python (including on the Building Infos) and doUniqueFeature and helpUniqueFeature pythons. I also already added the TXT_KEY_UNIQUE_FEATURES_PEDIA/HELP/ETC. The events and the eventtrigger was also added and still the "You arrived at Unique Feature" won't appear and thus don't trigger the event.

2. How do the Khazad instantly have a dwarven vault in their cities? Can I adopt this to other civs - where is the code for this?

3. Is the Mazatl(?) civic where they get extra production and food from trade hardcoded to dll?

Thanks!
 
2. How do the Khazad instantly have a dwarven vault in their cities? Can I adopt this to other civs - where is the code for this?

CustomFunctions.py - doTurnKhazad
 
You can alter values for civics via the TradeYieldModifer" in CivicInfos. But the guts are in the dll and I'm not sure exactly what goes on. (Sort of like the spleen, minus the dll part.)
 
3. Is the Mazatl(?) civic where they get extra production and food from trade hardcoded to dll?
Thanks!

The Civic is defined in XML, but it just uses features from Civ4 that so far as I'm aware aren't used in Civ4, BtS or FfH. I think it used to be part of Communism at an early stage (internal trade only, food and production rather than commerce).

The way it works is that trade routes all have an integer value based on several factors. The default implementation means that 100% of that value is provided as commerce, whilst 0% is provided as food or production.

The CivicInfos allow for those percentages to change, so Lost Lands increases the percentage of Food/Production. Since those are no longer 0%, they start to appear as a result of trade routes.
 
Ahhh. Got it. I thought it was native to Fall Further dll...

What about the Elohim's ability to get Traits from Uniquee Features (Patria, Sirona, etc.) What files (python or XML) should I change if I want to add another?

And who originally made the "Broad Alignments" modmod? Can't find it where it is - maybe it's for Fall Further only?
 
I believe that the Elohim get traits from unique features the same way the Illians do. That would mean adding a call in the <PythonOnMove> field of CIV4ImprovementInfos.xml, which would be defined in CvSpellInterface.py, which would trigger an event trigger in CIV4EventTriggerInfos.xml with choices defined in CIV4EventInfos.xml, the civ specific one of which triggers a <PythonCallback> in CvRandomEventInterface.py


If you don't care about the popup, you could just check for the proper civ in the <PythonOnMove> call in CvSpellInterface.py and add the traits there instead of dealing with adding events.

Edit: I just remembered FF also uses the Feat system, but I don't think it is really needed.


Broader Alignments was made by Grey Fox, after many forum members (including myself) had been requesting such a system for a long time. He eventually abandoned the project though, after Vehem and Xienwolf took it up as part of FF. There hasn't been a standalone version of Broader Alignments in quite a while, and the old one is certainly not compatible with newer versions of FfH. For some reason Grey Fix only has internet access for a few weeks every few months, so we haven't heard from him in a while.
 
Hmm... hadn't thought of that.

What I did was edit the <PythonOnMove>, the CvSpellInterface.py and the CIV4EventTrigger.xml and Civ4Events.xml, and the <PythonCallback> but the alert "Your unit had arrived at Unique Feature" is not showing.

I will now just avoid having a popup and just directly add the Trait...

What I was having a headache was the checker if the Civ have already visited the Unique Feature IsCivilizationBlahBlah (FEAT_SOMETHING_SOMETHING) on the onMove python I think.


Sorry if I'm too bothersome... I was also curious how the Adaptive Trait is coded. How does it choose which of the Leader's Traits should be changeable (adaptable)?
 
Hmm... hadn't thought of that.

What I did was edit the <PythonOnMove>, the CvSpellInterface.py and the CIV4EventTrigger.xml and Civ4Events.xml, and the <PythonCallback> but the alert "Your unit had arrived at Unique Feature" is not showing.

I will now just avoid having a popup and just directly add the Trait...

What I was having a headache was the checker if the Civ have already visited the Unique Feature IsCivilizationBlahBlah (FEAT_SOMETHING_SOMETHING) on the onMove python I think.



I'm thinking that FF uses feats (which work differently in FF than FfH, as Xienwolf moves some that is hardcoded in vanilla/BtS/FfH to xml) while normal FfH just uses pPlot.setPythonActive(False). I think the difference is that the FfH way would prevent the python call from running again for any civ, while the FF way would just prevent it from running for that one civ. In general this shouldn't matter unless you have multiple players in the game that could trigger something by finding the improvement.

You could ignore the whole feat system/deactivating python entirely if you wish. It could slow the game down slightly if it runs every time a unit enters the tile, but if you aren't using an event/popup that could get distracting then the effect should be minimal.


Sorry if I'm too bothersome... I was also curious how the Adaptive Trait is coded. How does it choose which of the Leader's Traits should be changeable (adaptable)?

It doesn't choose which trait is changable, it chooses whcih one isn't. Adaptive leaders have a trait found in the <PermanentTrait> field in their CIV4LeaderHeadInfos.xml define. The event that lets an adaptive leader change traits removes all traits but the one found here and the adaptive trait itself. If you give a leader adptive but not a permanent trait he will loose all the traits but adaptive itself when he chooses a new one.
 
Regarding Lost Lands, is it possible to enable it for 2 or more civs (eyeing Cualli), but not all of them?

As for adaptive, I was hoping (before I found out) that it was an extra trait I could choose at will.
 
Regarding Lost Lands, is it possible to enable it for 2 or more civs (eyeing Cualli), but not all of them?

As for adaptive, I was hoping (before I found out) that it was an extra trait I could choose at will.

It looks like you can only allow it for one civ in the xml. You can probably do it via python, but I wouldn't know how.

I'd be tempted to drop PrereqCiv and add PrereqTech Swamp Dwelling in this specific instance - but then you'd need to rework it elsewhere...
 
If you locked it off in Python only it would work just fine, though.

I know the code exists to lock off civics because AIs aren't allowed to go into Slavery if they're Scions. So it's completely doable, if a little dirty.
 
Back
Top Bottom