Quick Modding Questions Thread

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?)
 
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?)
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.
 
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/
 
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/
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.
 
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.

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?
 
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
 
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.
 
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).
 
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.
 
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.
 

Attachments

  • pediapopup.png
    pediapopup.png
    1.9 MB · Views: 109
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.

You have to edit the help text for units. The help text can be found in CvGameTextMgr.cpp, @CvGameTextMgr::setUnitHelp().
 
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. :)
 
Perhaps because it is dependent on game speed, which the Civlopedia would know nothing about, if no game has been launched?
 
Perhaps because it is dependent on game speed, which the Civlopedia would know nothing about, if no game has been launched?
Why then does it show 120 Hammer Cost for the Cavalry I have open in the screenshot I attached above then?
 
Why then does it show 120 Hammer Cost for the Cavalry I have open in the screenshot I attached above then?
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.
 
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);
 
I tried both of these to no effect. :dunno:
 
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)
 
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.
 
Back
Top Bottom