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. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Yes :( It's a copy of town improvement.
     
  2. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Hi,

    Can someone give me a few pointers on how to include a cityset within a mod. For background, I'm basing my mod off of the original FFH but I want to bring in a cityset from MoM (once I can manage one, more will follow).
    The only tutorial I can find on this is https://forums.civfanatics.com/threads/how-to-add-new-city-art.189687/.

    My first trial run was to try and bring across the ancient Khazad cityset from MoM.
    I created a new ARTSTYLE in GlobalTypes.xml.
    I copied across the entries from MoM into my CIV4CityLSystem.xml, relating to ARTSTYLE_KHAZAD, and renamed them to the new ARTSTYLE_DEEPMINING. (Note: The entries relating to ARTSTYLE_KHAZAD in FFH and MoM were identical.)
    There were 18 references to an_khazad.nif among the lines in CIV4CityLSystem.xml that I'm adding.

    I think I need to rename the an_khazad.nif and the an_khazad.dds files that I'm importing from MoM and putting in Art/structures/cities, as otherwise they clash with the existing names. I was going with an_deepmining. So I would need to update those 18 entries in the xml but I need to get the nif aligned with this?
    If changing the names of the nif file, how do I update the all of the NiNode references from "an_khazad.nif" within the "an_deepmining.nif" and how do I update the texture so that it points to "an_deepmining.dds"?
    If I click on one of the "an_khazad.dds" texture file references and select "an_deepmining.dds" as the new texture, it uses the full file address, rather than just "an_deepmining.dds". How do I change it so it will refer to the dds file in the same folder as the nif?

    thanks
     
  3. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,777
    Location:
    The city of the original vlaai
    You don't need to rename the nif and dds files. If you have the art files from both city styles in the seperate folders (even if the models are exactly the same), the game will use them as seperate models. Changing the dds file in one folder will change doesn't change the texture of the other city set because those are in a different folder. Even if the files have exactly the same names.

    But if you for whatever reason want to rename all nif and texture files, you can use Nifskope to change the NiNode references to the renamed dds file.
     
  4. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Thanks @merijn_v1,
    I’ll try to stay away from Nifskope for the time being then.

    How do I reference the different folders using the suggested approach?
    All of the cityset art seems to be in the Art/Structures/Cities folder.
    If I put a new folder, Deepmining, in here with the MoM an_khazad.nif and an_khazad.dds files, how is this to be referenced in CIV4CityLSystem.xml?
    Typically, where the Artref nif is referenced, it looks like
    <ArtRef Name =“generic:an_khazad.nif::1x1_01”>
    Am I correct in thinking the “generic” is pointing to the Art/Structures/Cities folder? If it is, what’s the edit to point to a different folder?
     
  5. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Okay, I found the answer:

    I added IMPROVEMENT_SUBURB after every IMPROVEMENT_TOWN with Find+Replace function but I did not notice that there are some !IMPROVEMENT_TOWN parts too. Adding the ! to the remaining parts solved the problem.

    Thanks for every answer :)
     
    Leoreth likes this.
  6. VCrakeV

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    448
    I'm looking to make a modmod (of C2C), and I need to know if I have file placement correct (I don't have the exact words right, because I'm recalling from memory on mobile):
    ...-> Civ 4 -> Beyond The Sword -> mods -> C2C -> data -> mods-> My Mod

    And if, for example, I want to edit xml files, I should copy and paste them into My Mod, and edit them there? It would be like:

    ...-> C2C -> data -> mods -> My Mod -> xml -> (xml files)
     
  7. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,519
    Gender:
    Male
    Location:
    Canberra, Australia
    That is almost correct for mods of Caveman2Cosmos.
    ...-> C2C -> assets-> modules -> My_Mods -> (your mod name here) -> (xml files)
    Because of the BULL mod used by C2C it is best practice not to have any white space in your mod name, hence the underscore in the My_Mods name. It causes (caused?) problems when displaying small icons of buildings in some places.
     
    VCrakeV likes this.
  8. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    I just built the Moai Statues. Didn't it have a wonder movie?!?!
    In my memories it had... but... maybe I just mix it with Stonehenge :rolleyes:

    EDIT:

    Never mind. I made my own :D
    Moai Statues (26sec)
     
    Last edited: May 21, 2020
  9. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Hi,

    So I found my problem with importing over citysets from MoM,
    The ARTSTYLE entries between FFH and MoM are not identical, so I was obviously copying the Artref information from the wrong mod. In case my previous post might have steered anyone wrong...

    To import a cityset from another mod it does appear to be as simple as;
    • Add your new ArtStyleType into the ArtStyleTypes in GlobalTypes.xml, e.g. <ArtStyleType>ARTSTYLE_DEEPMINING</ArtStyleType>
    • Copy the cityset files (nif, dds) into a folder in Art/structures/cities.
    • Copy over the relevant Artref from the CIV4CityLSystem.xml in the mod your importing from.
    • Amend the Artref to use the name of your folder between "generic:" and the name of the nif file for the Artref you've copied over, e.g. where deepmining is the name of the folder, it looks like <ArtRef Name="generic:deepmining/an_khazad.nif::1x2x2_01">
    • Change the ARTSTYLE in the Artref you've copied over to refer to your new ARTSTYLE, e.g. <Attribute Class="Artstyle">ARTSTYLE_DEEPMINING</Attribute>
     
    Zeta Nexus likes this.
  10. Vokarya

    Vokarya Deity

    Joined:
    Mar 25, 2011
    Messages:
    6,168
    If you're interested, Legends of Revolution does have movies for all the core National Wonders.
     
    Zeta Nexus likes this.
  11. Geomec

    Geomec Chieftain

    Joined:
    Oct 19, 2015
    Messages:
    2
    Hi everyone! Is there a way to change how much culture is required to take a plot from another civ? I'm trying to make a work around similar to fixed borders with minimal territory change on crowed parts of a map barring war or massive differences in cultural pressure. I would appreciate any help I can get!
     
  12. Hutma

    Hutma Chieftain

    Joined:
    Apr 21, 2020
    Messages:
    21
    Gender:
    Male
    Location:
    France
    I know that in Civ4CultureLevelInfo.xml you can change the iThreshold to the number you want. So that with XX culture the city gains a culture level. Maybe you can come up with an idea to use this to get the result you want. (cf : http://modiki.civfanatics.com/index.php?title=Civ4CultureLevelInfo )

    If you want to do something more precise I think you will have to look for Python or SDK solutions.
    Hope this can help you a little :)
     
    Geomec likes this.
  13. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Hi,

    I’ve a further query on citysets.
    In BtS, when a city is captured, it acquires the art style of the conquering civ. In FFH, when a city is captured it retains the art style of the original civ.

    Where is this defined and what do I edit in order to change it? I’m basing my mod off FFH, but I want the art style of the new civ, rather than the original civ to be used.
     
  14. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,055
    Gender:
    Male
    Location:
    Leblanc
    I am not familiar with FFH but most likely it is implemented in the DLL, as the original Civ4 DLL has a direct relationship between the owner civ's city art style and the art style of the city itself.
     
  15. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    It may be part of Assimilation modcomp. I'm just guessing but I would start searching for that key word.
     
  16. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    735
    Location:
    Germany
    @LPlate2: I've once given cities the art style of their cultural owner through CvCity::getArtStyleType in CvCity.cpp. (I didn't keep that change in the end because, apparently, there is no way to give Cottages, Hamlets etc. the same treatment.)
     
  17. LPlate2

    LPlate2 Warlord

    Joined:
    Dec 27, 2018
    Messages:
    112
    Hi,

    Thanks, CvCity::getArtStyleType in CvCity.cpp is the spot I needed, neatly commented by Xienwolf to make sure I didn't miss it. The commented out line is as it appears in the BtS CvCity.cpp.

    FFH
    Code:
    ArtStyleTypes CvCity::getArtStyleType() const
    {
    
    //FfH: Modified by Xienwolf (Maintains City ArtStyle of base Civilization)
    //   return GET_PLAYER(getOwnerINLINE()).getArtStyleType();
        return ((ArtStyleTypes)(GC.getCivilizationInfo((CivilizationTypes)getTrueCivilizationType()).getArtStyleType()));
    //FfH: End Modify
    
    }
     
    f1rpo likes this.
  18. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,818
    Gender:
    Male
    Location:
    In a constant brainstorm...
    I may misunderstand what you are saying but I think you are wrong. Just check AND2.
    In the pic bellow you can see Roman cottages and the other artstyles also have their own:
    Spoiler :
    upload_2020-5-24_13-59-43.png
     
  19. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    735
    Location:
    Germany
    I'd like to show e.g. a European-style Cottage – instead of Greco-Roman – when the tile culture is 80% Celtic. I don't think that's possible. As far I can tell, the EXE picks the art style for that Cottage by calling getArtStyleType on the player who owns the tile politically.
     
  20. Mouthwash

    Mouthwash Escaped Lunatic

    Joined:
    Sep 26, 2011
    Messages:
    9,346
    Location:
    Hiding
    I have a WBsave from a very old version of Magister Modmod for FfH2, and I'm not sure which version. I'm trying to open it in the version I have installed (not the latest one), and every time it simply crashes to desktop in the initial loading phase. My approach now is to try to copy-paste the details into another WBfile using Notepad++, but the exact same thing happens. It even occurs when I simply bring over the plot info - is that possible to do in general, even?

    @MagisterCultuum, have any input here?
     

Share This Page