1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Modders Guide to FfH2

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

  1. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    Any chance that the xml schema changes I requested in the .31 change log will be added?

    I'm also still hoping that buildings can grant any amount of any number of resources (instead of the same number of no more than 3), that civics grant xp based on unitcombat, and all the other xml suggestions I mad in the past. My most recent requests do seem like they would be simpler ways to make modmoding easier though.
     
  2. Kael

    Kael Chieftain

    Joined:
    May 6, 2002
    Messages:
    17,400
    Location:
    Ohio
    Probably not. Every check I add slows down the game so unless we are going to use it I don't want to put it in. Remember you don't just want a schema change, you want a change to the source code to make the check work.

    So, for example, if I added block alignment to the spell definition then it would be called thousands of time per turn. Every unit evaluates every spell every turn, so in a game with 300 units (which is a pretty low number) they each check to see if they should use each of the 200 spells. Which is 60,000 checks against the block alignment each turn.

    Thats a pretty big simplification, a lot can be done with the ordering of the checks to try to optomize. But it gives a good feeling for why we don't add checks unless we really think we can use them. It slows everyone down.
     
  3. Arilian

    Arilian Chieftain

    Joined:
    Jan 18, 2008
    Messages:
    597
    Location:
    Hungary
    I am not a modder at all, but I tried to change the trait of a leader.
    I found an xml what contained the leader names and the traits, but even if i changed any of it, in the game it remained the original. (sorry i cant remember the xml name, i was looking for it 30 min and forgot it in one day:))
    i only wanted to change the trait not add one, and i copied the trait string from another leader, so it was set up well.

    i used total commander for browsing the mod, it was able to extract the xml and copy back after the modification, if it counts.

    my question is, how may file i need to modifiy for this simple change and what are they?

    Thank you for any of your answer in advance.
     
  4. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    :( too bad. I guess I'll just have to keep copying and pasting the same little snippets of python code then.

    Still, some of my other requests don't involve so many checks, do they? For instance, whats the problem with the way I suggested making buildings provide resources:
    Code:
    <FreeBonuses>
        <FreeBonus>
            <FreeBonusType>BONUS_MANA_SPIRIT</FreeBonusType>
            <iNumBonus>2</iNumBonus>
        </FreeBonus>
        <FreeBonus>
            <FreeBonusType>BONUS_MANA_LIFE</FreeBonusType>
            <iNumBonus>1</iNumBonus>
        </FreeBonus>
        <FreeBonus>
            <FreeBonusType>BONUS_MANA_WATER</FreeBonusType>
            <iNumBonus>1</iNumBonus>
        </FreeBonus>
    </FreeBonuses>
    
    or, a little less importantly, adding:
    Code:
    <UnitCombatFreeExperiences>
        <UnitCombatFreeExperience>
            <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
            <iExperience>2</iExperience>
        </UnitCombatFreeExperience>
        <UnitCombatFreeExperience>
            <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
            <iExperience>2</iExperience>
        </UnitCombatFreeExperience>
    </UnitCombatFreeExperiences>
    
    to CIV4CivicInfos.xml and maybe CIV4SpecialistInfos.xml.



    Also, I think that adding prerequisite techs to the code that applies the weapons promotions is really necessary, even if it does add an extra check per unit per turn. (And even though I'm thinking about just setting WEAPON_PROMOTION_TIER1, WEAPON_PROMOTION_TIER2, and WEAPON_PROMOTION_TIER3 to none and instead granting the weapons through spells that require techs, resources, buildings and gold, maybe even making these weapons "quasi-equipment" with different strengths and weaknesses. In that case my modmod need this change, but I still think it is needed in the main mod)


    Edit: one simple change that I would find very helpful is to allow a promotion to grant a bonus vs multiple promotions, like:
    Code:
    <PromotionCombats>
        <PromotionCombat>
            <PromotionCombatType>PROMOTION_DARK_ELF</PromotionCombatType>
            <iPromotionCombatMod>50</iPromotionCombatMod>
        </PromotionCombat>
        <PromotionCombat>
            <PromotionCombatType>PROMOTION_ELF</PromotionCombatType>
            <iPromotionCombatMod>50</iPromotionCombatMod>
        </PromotionCombat>
    </PromotionCombats>
    
    And I think that civics and maybe specialists should have a <iCrime></iCrime> tag, and that possibly buildings and civics should be able to alter the crime rate from specialists (ex, smugglers ports and gambling houses give +1 crime from merchants, temples of order/empyrean/runes/leaves give -1 crime from priests, temples of overlords/ashen veil +1 from priests, theology -1 from priests/great prophets, sacrifice the weak +1 from sages, guardian of nature -1 from bards, etc)
     
  5. Farmer Bobathan

    Farmer Bobathan Sanity is for the weak

    Joined:
    Oct 6, 2007
    Messages:
    251
    Location:
    Michigan
    Is there a program someone could recommend for merging XML docs, preferably free? Thanks in advance.
     
  6. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    I had a free one I liked (well, didn't dislike) on my computer before my hard drive broke; I don't remember what it was called. I've downloaded 2 xml compare tools in the past 2 hours, but don't like them as much.

    I too would like advice on what to use.

    Edit: one that can also compare python files would be ideal.
     
  7. Farmer Bobathan

    Farmer Bobathan Sanity is for the weak

    Joined:
    Oct 6, 2007
    Messages:
    251
    Location:
    Michigan
    What files control/decide the XML tags?
     
  8. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    The various ___Schema.xml files set how the tags works and what types of values won't give error messages, but the actual functionality written in C++ in the .dll; changing the schema without changing the code that reads them (which requires more advanced coding skills than I have) won't work.
     
  9. Farmer Bobathan

    Farmer Bobathan Sanity is for the weak

    Joined:
    Oct 6, 2007
    Messages:
    251
    Location:
    Michigan
    So how come when I tried to merge patch G with your mod I got an error saying something about the tag <iplotradius> being incorrect and magic resistance being expected instead? I put in the new dll and building schemas and merged the different building infos and building class infos.
     
  10. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    I use a combination of Notepad2, and WinMerge, both are free. A bit busy now, but if you need help finding them, post something tomorrow and I should be able to search around for you. Though honestly I'll just search Altavista or Cnet.downloads.com for those two precise words, I know I got the spelling right :)

    WinMerge seems like it can automate things, and is overall REALLY nice, but I haven't felt like learning all of the features just yet, so for now I am sticking with Notepad2. But come to think of it... not sure if I have used Notepad2 to Merge anything.... Probably haven't.

    Anyway, WinMerge works for both Python and XML (as does Notepad2, if you are just editing. Beats Notepad because it color codes things automatically, and you can customize precisely how it does that. I think WinMerge also does that though...)

    My laptop's in the shop right now fixing the keyboard, so I can't play with them and be more accurate than that. If I install too much on my wife's laptop she'll kill me ;)
     
  11. Farmer Bobathan

    Farmer Bobathan Sanity is for the weak

    Joined:
    Oct 6, 2007
    Messages:
    251
    Location:
    Michigan
    Thanks:) I'll have to try both of them out tomorrow.
     
  12. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    Kael added the City of a thousand Slums wonder in this mod, and added a new tag for buildings that increase a cities radius too. I suspect that he may have changed the way the extra radius is applied (hopefully in such a was as to allow even larger radii :)) This new tag was placed just before <iResistMagic>, so the new schema tells make it expect to see <iPlotRadius> before <iResistMagic>. You need to add this tag to every building in the file. New tags is one reason why I'm not reusing the old files, but starting fresh (or with a compare tool). That, and it means it will be better documented.



    I mostly use notepad2 for the coding and Winmerge was the compare tool that I used before loosing everything on my harddrive. I couldn't remember what it was called, and while looking for it I first tried 2 other programs that I didn't like as much. I just downloaded Winmerge and am about to uninstall the other 2. Thanks for reminding what it was called, xienwolf!

    Winmerge still isn't perfect though. When you have made lots of changes between the documents (especially new spells, buildings, or units) then the two sides don't line up very well. Also, the grey spaces sometimes make it easy to remove half a tag. the .bak's it generates can be a little annoying too, but having backups is a god thing I guess.

    I typically look the come over in Notepad2 after merging, and if its Python I bug check it in IDLE for VPython (thats the program we used last semester in Physics when we were modelling subatomic particles in visual python. It has a decent bug checker (which Notepad2 lacks), but it lacks some basics like an easy way to differentiate between spaces and tabs (very important in Python). Also, you can't scroll left or right (you can use left/right arrows to move in the text, but not select a position or see how far over you are), and text that is too far right often is invisible. Following its advice for fixing a file almost always messes it up more (its suggested solution to mixing tabs and spaces: automatically turn everything to spaces, and require going through every line whole document by hand to change them back), so I use it to find the line with the bug and then change the cone in Notepad2.
     
  13. TheJopa

    TheJopa Šumar

    Joined:
    Dec 29, 2005
    Messages:
    2,008
    Location:
    Croatia
    Crosspost!

     
  14. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    Unitclasses must be added to the CIV4UnitClassInfos.xml file, you cannot just reference an undefined unitclass in CIV4UnitInfos.xml.

    Since you mentioned exporting, I assume you you are using the excel based editor, not modifying the xml directly; the editor doesn't have a tab whose macros change CIV4UnitClassInfos.xml, so you will have to make this change manually.
     
  15. Mailbox

    Mailbox Chieftain

    Joined:
    Oct 6, 2007
    Messages:
    873
    Awesome, I was looking for a program to do this work. This makes merging mod components between versions much easier.
     
  16. TheJopa

    TheJopa Šumar

    Joined:
    Dec 29, 2005
    Messages:
    2,008
    Location:
    Croatia
    Still not working. I probably haven't mentioned that I don't get errors on civ4 startup but when I export stuff. When I click export I get error in excel, and it never gets exported. With message : 'Compile Error: can't find project or library' and then debug window opens up.


    EDIT: Reinstalled the patch, so I have correct files, and then tried to export units 'as-is' and I still have the same error. Other sheets work fine (events, etc)
     
  17. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Just wondering what some tags are being used for in FfH's Unit Info:

    Does having the BSpy set to 0 invalidate being able to perform spy missions, or just being found by Counter Spy? Is there any point in Counter Spy (Is that what is used to see Hidden units?)? And why bother setting the mission values to 1? Are they stand-in flags for future use?
     
  18. MagisterCultuum

    MagisterCultuum Great Sage

    Joined:
    Feb 14, 2007
    Messages:
    15,586
    Location:
    Kael's head
    bSpy is for BtS espionage missions, which no unit in FfH can do (plus there are no active missions in BtS's espionage defines). Units with bSpy are sometimes randomly discovered and destroyed (I found this out the hard way a while back when I had added BtS espionage to .25 and let a few units act as spies; I lost Loki and a few shadows)

    bCounterSpy does not let you see hidden/invisible units. I know it helps against bSpy, and am not sure about against the other spy mission tags.

    The mission tags refer to vanilla type espionage, which still work in FfH and are not used in BtS.
     
  19. xienwolf

    xienwolf Chieftain

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
  20. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,399
    Location:
    The Matrix
    @Kael:
    Any chance you'll be making the source code for patch 'g' available for download anytime soon?
     

Share This Page