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

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. Herostratus

    Herostratus Grim Harbinger of Things to Come

    Joined:
    Jul 24, 2009
    Messages:
    116
    Is it possible to block a unit from being able to do an order that it ordinarily should be able to?

    Specifically, I have a unit that I don't want the player to be able to airlift. Is there some way to "suppress" the relevant order button for just that unit? (A way that *doesn't* involve modding the SDK?)
     
  2. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,561
    Speaking of airlift specifically, then the answer is no. It looks fairly easy to do in the DLL, but there aren't any xml tags or python callbacks related to this feature.
     
  3. Absolution

    Absolution Prince

    Joined:
    Mar 6, 2010
    Messages:
    591
    Gender:
    Male
    Location:
    Israel
    How do I find Vanilla and Colonization art files?
    Assests/Art/LeaderHeads - their folders are empty but for some eyeshadow files.
    In BtS and Warlords, as well as in Vanilla built-in mods, I can see the whole folder, including NIF and KFM files.

    How is it even possible that the Vanilla game works when these files are not found at my computer at all?
    The XML/Art directs to a specific location (e.g. Art/Interface/TeamColor/FlagDECAL_FleurDeLis.dds), which does not exist at all!

    1. How do I get those art pieces? I want to use them in mods.
    2. How does my game function when these are not found where they are directed to be?

    I am reviving an old question about this, the answer there wasn't really helpful to me - https://forums.civfanatics.com/threads/civ4vanilla-resources-cant-find-them.267977/
     
  4. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,561
    While it's not a lengthy answer, it's likely the right one. If the files aren't in Assets, they are packed inside fpk files, in which case you need PakBuild to extract them. Do note that while fpk files are faster to load, I strongly recommend against using them because they tend to cause weird memory related issues, like crashing on startup on some computers, but not others.

    If you load a file, it will search for the file in the following order:
    1. Mod
    2. BTS
    3. Warlords
    4. Vanilla
    Obviously 2&3 is skipped depending on which version you play. Colonization has just 1&4. This mean even if you make a vanilla mod, the file you are looking for could be in Vanilla. If you are using an unmodified file from 2-4, do not add it to your mod. Adding the filepath should make it work and adding it will only make your mod bigger and slower to load. It might also use more memory.
     
  5. Absolution

    Absolution Prince

    Joined:
    Mar 6, 2010
    Messages:
    591
    Gender:
    Male
    Location:
    Israel
    Sorry, but I couldn't follow it.
    Possibly my language or technical obstacle, or maybe you refer to options inside the PakBuild, which I haven't downloaded yet.

    Anyway, does your phrasing "If the files aren't in Assets" mean that they could be in the Assets in some other scenario?
    If I reinstall the game, is there a chance to find them in Assets, or is it the general case for Vanilla?
     
  6. clanky4

    clanky4 Emperor

    Joined:
    Jul 11, 2012
    Messages:
    1,262
    Location:
    USA
    As stated by nightingale art assets are stored in one of the following locations depending on your installation:

    C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Beyond the Sword\Assets\Art
    C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Warlords\Assets\Art
    C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Assets\Art

    If the art asset you are seeking is not in one of these locations, which is almost always the case for vanilla assets, then you will need to use PakBuild:
    https://forums.civfanatics.com/resources/pakbuild.2384/


    To extract the "Paked" art files which are located here depending on your installation:

    C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization IV Beyond the Sword\Assets\Art0.FPK
     
  7. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,544
    Gender:
    Male
    Location:
    Canberra, Australia
    One minor thing to remember when using PakBuild - the progress bar fills up much faster that it should. It often shows the extraction has finished long before it has actually finished.
     
    Absolution likes this.
  8. BlitzCon

    BlitzCon Chieftain

    Joined:
    Oct 25, 2014
    Messages:
    20
    Hello, I have a bit of a dilemma.

    I tried to create a new Quest. Nothing too hard, I managed to make it work, since I copied most stuff from other Quests (yes, I am lazy).

    However, one aspect fails to work, and I am at loss where it is even located:
    How do I make a Quest fail if a rival civilization fulfills the conditions first? And where is that even located on the other quests? Just about only the Master Blacksmith has an Expire check, and that has to do with the loss of the city, not other Players having built forges. Despite that, just about every Quest fails if a rival has the required amount of Buildings/Units first. Except mine.

    So, where should I find those fail conditions, so I can copy and edit them properly.

    (For those interested, the quest was to Train 11+ Spies, and the quest to fail if a rival gets 11+ spies first).
     
  9. BlitzCon

    BlitzCon Chieftain

    Joined:
    Oct 25, 2014
    Messages:
    20
    Well, went around the issue by recreating the condition as an expire check, like this:

    def expireSpymaster1(argsList):
    iEvent = argsList[0]
    kTriggeredData = argsList[1]
    iSpy = CvUtil.findInfoTypeNum(gc.getUnitClassInfo, gc.getNumUnitClassInfos(), 'UNITCLASS_SPY')
    iSpiesRequired = gc.getWorldInfo(gc.getMap().getWorldSize()).getDefaultPlayers()
    for iPlayer in range(gc.getMAX_CIV_PLAYERS()):
    loopPlayer = gc.getPlayer(iPlayer)
    if loopPlayer.isAlive() and iPlayer != kTriggeredData.ePlayer:
    if loopPlayer.getUnitClassCount(iSpy) > (iSpiesRequired - 1):
    return true

    return false


    This worked just fine.
    Though I still would like to know where the original Quests have that specific condition saved.
     
  10. Imp. Knoedel

    Imp. Knoedel Simperator Knoedel

    Joined:
    Nov 11, 2011
    Messages:
    8,791
    Location:
    The cooler Germany
    How do I get the Hammer Cost of a unit to appear when hovering over it in the Pedia?

    As you can see in the attached screenshot, when I hover over a unit I get this popup telling me a number of things about it, such as Strength, Movement and other stuff, but not the Production cost, which bothers me to no end.
     

    Attached Files:

  11. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,207
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Isn't that to appear only during a game? Since Hammer Cost varies depending on gamespeed.
     
  12. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,884
    Location:
    The city of the original vlaai
    You have to edit the help text for units. The help text can be found in CvGameTextMgr.cpp, @CvGameTextMgr::setUnitHelp().
     
    Imp. Knoedel likes this.
  13. Imp. Knoedel

    Imp. Knoedel Simperator Knoedel

    Joined:
    Nov 11, 2011
    Messages:
    8,791
    Location:
    The cooler Germany
    Okay, so. Turns out Hammer Cost was displayed in that popup in the pedia all along, but only when you open it from inside a game, not the main menu.

    I did go ahead and added the following bit of code anyway just to see what happens:

    Code:
    if (pUnit->getUnitInfo().getProductionCost() > 0)
    {
     szString.append(gDLL->getText("TXT_KEY_blub", pUnit->getUnitInfo().getProductionCost()));
    }
    The result: The pop-up in the Pedia shows no change whatsoever, independent of whether it's opened from inside the game or the main menu, but the popup from hovering over an actual unit on the map itself does now show "TXT_KEY_blub" after the number of moves, but not the production cost.

    Hm, curious.

    Ah well, just wanted to report my findings here. :)
     
  14. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,179
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    Perhaps because it is dependent on game speed, which the Civlopedia would know nothing about, if no game has been launched?
     
    Imp. Knoedel likes this.
  15. Imp. Knoedel

    Imp. Knoedel Simperator Knoedel

    Joined:
    Nov 11, 2011
    Messages:
    8,791
    Location:
    The cooler Germany
    Why then does it show 120 Hammer Cost for the Cavalry I have open in the screenshot I attached above then?
     
  16. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,179
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    That is a good point. Maybe the data is pulled from a different place? Maybe the tooltip inherently looks at the game speed, finds no speed, and thus doesn't display it? I have no idea.
     
  17. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,884
    Location:
    The city of the original vlaai
    The TXT_KEY_blob you created is trying to find a text key, but apperantly doesn't find it. You either create that key in a text file.
    Code:
        <TEXT>
            <Tag>TXT_KEY_blob</Tag>
            <English>%d [ICON_PRODUCTION]</English>
        </TEXT>
    Or change your code to:
    Code:
    if (pUnit->getUnitInfo().getProductionCost() > 0)
    {
        szTempBuffer.Format(L"%d%c, ", pUnit->getUnitInfo().getProductionCost(), GC.getYieldInfo(YIELD_PRODUCTION).getChar());
    }
    szString.append(szTempBuffer);
     
    Imp. Knoedel likes this.
  18. Imp. Knoedel

    Imp. Knoedel Simperator Knoedel

    Joined:
    Nov 11, 2011
    Messages:
    8,791
    Location:
    The cooler Germany
    I tried both of these to no effect. :dunno:
     
  19. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,207
    Gender:
    Male
    Location:
    In a constant brainstorm...
    So here's something I tried to do:

    I made a barbarian UU 'Tribe', a Settler replacement. It cannot found cities; all it can do is to build a Goody Hut by consuming the unit. I have set up Buildinfos and Improvementinfos properly, so I can turn the unit into a Goody Hut; that part works. The problem is that I don't know hove to "encourage" the AI to use the unit as I want that is: when spawned in some empty area it creates more Goody Huts.
    I tried both UnitAI_Settle and UnitAI_Worker but no deference.
    I also tried to give Goody Hut a +10% defense bonus and place a barbarian military unit to the same tile but still nothing.

    Any idea ho to make it work purely with XML modifications? (It's a modular modmod so I don't want to touch any python files or else)
     
  20. 6K Man

    6K Man Bureaucrat

    Joined:
    Jul 17, 2007
    Messages:
    2,321
    Location:
    in a Gadda Da Vida
    Couple of related questions:
    How do I set up a permanent alliance in an existing saved game or scenario?
    Can a permanent alliance involve more than 2 Civs?

    I figured out that I couldn't do this in Worldbuilder, but a forum search has me stumped. Thanks.
     

Share This Page