1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Modders Guide to FfH2

Discussion in 'Civ4 - Fall from Heaven' started by Kael, Aug 14, 2007.

  1. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
  2. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    Just make them the same buildingclass.

    *edit*
    Actually, there's a bug in BtS related to world wonders that is limited by civ: AIs can still rush it with units, even if their civ isn't supposed to be able to build it. Might be easier to just allow the Kuriotates to build CoaTS in settlements but not hubs.
     
  3. Blakmane

    Blakmane Prince

    Joined:
    Feb 17, 2007
    Messages:
    447
    I'm currently trying to make the barb-trait AI incapable of declaring war on barbarians, as a fix until they can better decide when it would be applicable (although mind you, it basically never will be a good idea). The two best ideas i've had so far are:

    A) To literally block the AI from making this decision, which would be the best fix

    I'm thinking a ninja edit in CvTeamAI/CvPlayerAI? Anyone know a good place to simply add another clause? (IE check if civ is barbarian during the declare war decision, and, if true, return false). This would presumably only effect barb trait civs as no other civ has to consider declaring war on the barbs.

    B) Create an event that activates (and re-peaces) every time they declare war (but this would be a dodgy fix at best.)

    Shouldn't be too hard, but not sure if it's possible to have AI-only events?
     
  4. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,153
    Location:
    Kael's head
    Is it possible to use a python call instead of an integer in the <iImmobileTurns>0</iImmobileTurns> tag of a spell. I was hoping it was (and that I coulddefine this amount in the same file as the python calls for spells and spell requirements), but it doesn't seem like it is :(

    Since I noticed that the immobility caused by the Entangle spell (nature III divine) wears off before it is your your rivals turn to move, and is thus useless, I was trying to correct this. I didn't want it to be just like the Sun II sorcery spell, so I wrote a a little piece of python code that made the length of the immobility be dependent on the amount of nature mans the caster's civ controls and on the type of terrain.


    @ Blakmane: if you would have the event that "re-peaces" the civ with the barbs happen whenever they declare war, then I'd definitely say A was better. However, I would much rather see a random event (or more than one) added that made barb trait leaders able to make peace with the barbs whenever they are at war (possibly with a high price, and other options) and not currently the "too civilized" (i.e., when their score isn't high enough to trigger war again)
     
  5. Blakmane

    Blakmane Prince

    Joined:
    Feb 17, 2007
    Messages:
    447
    It's a good idea but, at the moment i'm more interested in primarily stopping the AI from declaring war for no reason. Adding an event like that wouldn't stop them from simply declaring war again right after making peace.
     
  6. MrPopov

    MrPopov King

    Joined:
    Jul 25, 2006
    Messages:
    985
    Forgive if this is the wrong place to ask, but I was wondering if it would be possible to add +2 :gold: from state religion buildings under Theocracy civic?

    I have tried adding

    Code:
                <iStateReligionCommerce>
    	    	<StateReligionCommerces>
    			<iCommerce>2</iCommerce>
    			<iCommerce>0</iCommerce>
                	</StateReligionCommerces>
                </iStateReligionCommerce>
    
    to the civicinfos.xml file under Theocracy, but the game crashes on loading:

    Spoiler :
    Failed Loading XML file xml\gameInfo\CIV4CivicInfos.xml...
    Reason: Element content is invalid according to the DTD/Schema.
    Expecting: {x-schema:CIV4GameInfoSchema.xml}-SpecialistValids.

    Line: 456, 30
    Source: <iStateReligionCommerce>


    Is what I propose not possible via xml editing? Thanks in advance :D
     
  7. MrPopov

    MrPopov King

    Joined:
    Jul 25, 2006
    Messages:
    985
    double post
     
  8. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    XML tags in themselves don't do anything. It's the SDK which handles the "doing" with them. If you want new XML tags you must add them in the SDK, so the game know how to deal with them. So yes, what you propose is not possible via XML editing alone.
     
  9. Blakmane

    Blakmane Prince

    Joined:
    Feb 17, 2007
    Messages:
    447
    Can anyone tell me what this piece of code does? Changing the value from false to true seems to make no observable difference.

    Spoiler :
    void CvGame::initDiplomacy()
    {
    PROFILE_FUNC();

    int iI, iJ;

    for (iI = 0; iI < MAX_TEAMS; iI++)
    {
    GET_TEAM((TeamTypes)iI).meet(((TeamTypes)iI), false);

    if (GET_TEAM((TeamTypes)iI).isBarbarian() || GET_TEAM((TeamTypes)iI).isMinorCiv())
    {
    for (iJ = 0; iJ < MAX_CIV_TEAMS; iJ++)
    {
    if (iI != iJ)
    {
     
  10. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    That false is if you should get a diplomacy popup with a greeting. In this case changing it won't do anything. The code is making you meet yourself. You do not get automatic greetings from humans, even with it set to true. You are human, so you do not get a greeting.
     
  11. Blakmane

    Blakmane Prince

    Joined:
    Feb 17, 2007
    Messages:
    447
    Can anyone tell me why this piece of code wouldn't prevent barbarian trait civs from declaring war on the barbs? It's added right after kael's barbarian trait edit

    Spoiler :
    //FfH: minimod Traits: Modified by Blakmane 13/01/2008
    if (!GET_TEAM((TeamTypes)iJ).isBarbarianAlly())
    {
    GET_TEAM((TeamTypes)iJ).declareWar(((TeamTypes)iI), false, NO_WARPLAN);
    }
    //Ffh: minimod End add


    Where (TeamTypes)iI is the barbarians.
     
  12. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    In initDiplomacy? Pretty sure that's only called at the start of the game. It certainly has nothing to do with civs declaring war on eachother in the normal gameplay.
     
  13. Mailbox

    Mailbox King

    Joined:
    Oct 6, 2007
    Messages:
    873
    Has anyone tried merging the Revolution Mod or the JFort Mod with FFH? I'd assume not, since I haven't seen anything for it.
     
  14. Blakmane

    Blakmane Prince

    Joined:
    Feb 17, 2007
    Messages:
    447
    Must be because barbarians can't normally declare war through diplomacy? This call is enough to prevent them from going to war with barb trait civs. Looks like it's not going to work the other way round though =/
     
  15. Moos

    Moos Chieftain

    Joined:
    Nov 3, 2007
    Messages:
    44
    If I wanted to give a unit the possibility to spawn another unit upon victorious combat, much like the Baron does. Would it be enough to edit CIV4UnitInfos.xml or must I go looking in other places as well?
    And do I need to change both units or only the one of them and if so which?
     
  16. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,153
    Location:
    Kael's head
    I believe that editing the CIV4UnitInfos.xml for the victorious unit would be enough.
     
  17. Aradiel

    Aradiel Warlord

    Joined:
    May 27, 2006
    Messages:
    105
    Im just fed up with runes, its always founded first and keeps spreading way to fast resulting in 2/3 of the world following it and besides everyones neutral and loves each other it doesnt make any sense for everyone to worship the earthmother.

    So my question is which is the easiest way to prevent clan or balseraph to accept runes ? My knowledge to scripting is rather limited but good enough to edit stuff here and there.

    i found this in kaels explanation, and it seems the easiest way to limit acess to religions. Any suggestions what could be done exept that ?

    ReligionWeightModifiers- Modification the leader gives to any configured religion. Setting a valus to -100 or lower will make the leader unable to adopt the religion.
     
  18. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    16,153
    Location:
    Kael's head
    Where do you put the python defines for the <PyPerTurn> tag in CIV4PromotionInfos.xml?

    Edit: Never mind, I just found that its in the CvSpellInterface.py file, just like the python requirements/effects/miscast effects for casting spells.
     
  19. Blakmane

    Blakmane Prince

    Joined:
    Feb 17, 2007
    Messages:
    447
    this IS the way you do it. In civ4leaderheadinfos.xml
     
  20. Aradiel

    Aradiel Warlord

    Joined:
    May 27, 2006
    Messages:
    105
    Already changed the values according to kaels map and personal thoughts. Thanks now ill have to try it out :)
     

Share This Page