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. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,850
    I think it is hit by the same limit as with all other xml files, meaning max 32768 entries (non negative values for a signed 2 byte int). You will run out of memory long before hitting this limit. That is unless most styles points to the same graphics, but then what is the point?

    I'm not aware of any limits other than this and memory limitations. I would pay attention to memory usage if you want to go all out on this though. No graphics are good enough to allow a mod to become unstable due to running out of memory.
     
  2. Leoreth

    Leoreth Friend Next Door Moderator

    Joined:
    Aug 23, 2009
    Messages:
    35,049
    Gender:
    Male
    Location:
    Faraway
    I would like to run some Python code after XML is loaded (and I can call something like gc.getBuildingInfo successfully) but before actually starting a game. That is, when still in the main menu / scenario selection screen. Is that possible? Is there an event being fired after XML loading is complete, or is it possible to create and fire such an event?
     
  3. lfgr

    lfgr King

    Joined:
    Feb 6, 2010
    Messages:
    931
    You could try adding a call to python at the end of CvXMLLoadUtility::LoadPreMenuGlobals in CvXMLLoadUtilitySet.cpp.
     
    Leoreth likes this.
  4. Leoreth

    Leoreth Friend Next Door Moderator

    Joined:
    Aug 23, 2009
    Messages:
    35,049
    Gender:
    Male
    Location:
    Faraway
    Oh, good idea. That may be worth a shot.
     
  5. Leoreth

    Leoreth Friend Next Door Moderator

    Joined:
    Aug 23, 2009
    Messages:
    35,049
    Gender:
    Male
    Location:
    Faraway
    I am still tinkering with doing stuff with Python before the main menu is loaded.

    Unfortunately, I run into a NPE when trying to use the CyTranslator / CvDllTranslator class, in particular it seems that it is impossible to call getSymbolID as is happening when this class is instantiated. Is it possible at all to use this class before the main menu is loaded (and I am just a bit too early), or should I give up trying to get this to work?
     
  6. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,850
    I'm not quite sure what you are trying to accomplish as I see no reason to use python at this point of starting the game, but if your goal is to do something once symbols have been loaded, maybe put it in the end of CvGameTextMgr::assignFontIds.
     
  7. Leoreth

    Leoreth Friend Next Door Moderator

    Joined:
    Aug 23, 2009
    Messages:
    35,049
    Gender:
    Male
    Location:
    Faraway
    Essentially I would like to rely on a Python function to render part of the menu screen, in particular the civ description in the civ selection dialog. I'll give assignFontIds a try, thanks!

    Edit: that seems to do it, thanks again.
     
    Last edited: May 16, 2021
  8. The Snug

    The Snug The Civ Heretic

    Joined:
    Dec 5, 2003
    Messages:
    969
    Gender:
    Male
    Location:
    Seattle
    Hopefully I can find some assistance for two problems with DCM (Revdcm).

    First, how would one go about adding a new unitcombat for Mounted_Archers that would possess the same bombard capabilities as the unitcombat for archers?

    Second, how would one go about enabling the ability for archer bombard inside the borders of other civs? For example, I like to reinforce my vassals with my own units, but my archers are unable to bombard enemies inside my vassal’s culture border. Another example would be if I’m fighting Japan and we meet inside Babylonian territory, my archers are unable to bombard the Japanese units.

    Unfortunately I don’t possess any sdk or python abilities.
     
  9. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    4,320
    Gender:
    Male
    Location:
    In a constant brainstorm...
    IIRC you need to enable Friendly Pillaging to bombard inside friendly culture. Or something similar option I think.
     
  10. The Snug

    The Snug The Civ Heretic

    Joined:
    Dec 5, 2003
    Messages:
    969
    Gender:
    Male
    Location:
    Seattle
    Unfortunately, no such option exists in either the in-game mod options interface or the xml.
     
  11. Aquila SPQR

    Aquila SPQR Prince

    Joined:
    Jan 7, 2009
    Messages:
    517
    Location:
    Central Europe
    I'd like to turn off the tile yields visible on map when settler is active - to make settler act as any other unit in this matter. I don't see anything related to it in the xml files.
     
  12. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    972
    Location:
    Germany
    I've only managed to change this through the DLL. The EXE decides whether to show the Yield Display by calling CvUnit::shouldShowFoundBorders. Returning false there also disables the founding borders around the settler iirc. Well, highlighting adjacent tiles isn't helpful anyway, and founding borders covering the whole city radius can be (re-)implemented in the DLL.
     
  13. Darkator

    Darkator Chieftain

    Joined:
    Sep 18, 2020
    Messages:
    98
    Gender:
    Male
    Location:
    Poland,EU
    I can't uploud file!
     
  14. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    210
    Hi,

    How would you change the leaderhead art that's displayed for a given civilization during the game? I'm using 2D images for the leaderheads, if that makes a difference.
    Specifically, it's when the negotiations that I want to have artwork that changes over the game.
     
  15. Aquila SPQR

    Aquila SPQR Prince

    Joined:
    Jan 7, 2009
    Messages:
    517
    Location:
    Central Europe
    Oh, then it's beyond my skills.
     
    f1rpo likes this.

Share This Page