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

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    322


    I meant the damage to units and pop, but that's useful to know too. Thanks.
     
  2. VCrakeV

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    322
    So, I've been working on a general modmod(hence all the questions), and I'm trying to make later era units much stronger. It just irkes me that a maceman can take out a machine gun... But even upping the strength didn't help. Should I just increase the strength by an order of magnitude? Or is there a better way to do this?
     
  3. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,676
    Location:
    UK
    you could up the strength and give modern units some first strikes, that way they should be able to kill early units before they can strike back.
     
  4. Merkava120

    Merkava120 Oberleutnant

    Joined:
    Feb 2, 2013
    Messages:
    312
    Location:
    Not Turkey
    Is there a way to change the number of trees shown in a 'forest'? I want to change it so there's just one tree displayed. I tried removing a bunch of the nifs listed in the Feature ArtDefines, but all that did was make the trees look weird and shove them to the NW end of the tile.
     
  5. vincentz

    vincentz Programmer

    Joined:
    Feb 4, 2009
    Messages:
    3,550
    Gender:
    Male
    Location:
    Denmark
    You need a new nif with a single tree in it, and then replacing it with those entries you found above.
     
  6. MatteM

    MatteM Warlord

    Joined:
    Sep 7, 2015
    Messages:
    158
    Gender:
    Male
    Location:
    Stockholm
    Hello!

    For the huge mod I'm working on, I would like to add a few flavors in order to make the Stalin Leader choose to build Politburo and Communist Party HQ etc, which obviously Roosevelt does not want to build. So for the specific ideological building have FLAVOR_COMMUNIST, FLAVOR_FASCIST, and so on.

    In globaltypes.xml, most entries have the <!--Changes must be reflected in CvEnums.h--> line above them, but for <FlavorTypes> this is not so.

    My question thus is, will adding FLAVOR entries to steer the A.I leaders to choose buildings and units work in the intended way? Does it require SDK-work (as far as I can tell it shouldn't)?
     
  7. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,116
    Gender:
    Male
    Location:
    Leblanc
    As far as I can recall, I did not have to modify the DLL after adding a new flavor type.
     
  8. VCrakeV

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    322
    I've been doing modifications to make SoD more manageable. Testing to the extreme (collateral damage many times larger than defender's combat), and I took off the limits to see how it would work. It now kills units, but takes forever. It only maxes out at about 10%-20% of the defender's combat, regardless of what it is. The attacker's combat and collateral max were many times larger. Is there some sort of hard limit outside of xml?
     
  9. MatteM

    MatteM Warlord

    Joined:
    Sep 7, 2015
    Messages:
    158
    Gender:
    Male
    Location:
    Stockholm
    Thanks, I hope it will work, I have been trying to put incentives for the A.I leaders to choose certains civics and build certain buildings and improvements, playtesting will show how it works out :)
     
  10. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,676
    Location:
    UK
    For the collateral damage, I think if I remember rightly there is some weird math in the SDK/DLL code.

    It basically makes the damage really small or really large, in a weird mathy way.

    There is a setting in the glabaldefines.xml I think.

    <Define>
    <DefineName>RANGE_COMBAT_DAMAGE</DefineName>
    <iDefineIntVal>30</iDefineIntVal>
    </Define>
    <Define>
    <DefineName>COLLATERAL_COMBAT_DAMAGE</DefineName>
    <iDefineIntVal>10</iDefineIntVal>
    </Define>

    I think it was these two, but I found that changing them either did nothing or everything until we changed the underlying math in the DLL.
     
  11. Mudokon Pop

    Mudokon Pop Chieftain

    Joined:
    Oct 31, 2015
    Messages:
    45
    Location:
    Ireland
    Quick question! I tried to add a new city style so I copied the Asian city nif (and textures) as a template and then renamed it to a native american style.

    Before adding custom graphics, I decided to test this change in game - so I loaded up the game. Unfortunately the mod only partly works -- the default asian buildings appear now instead of the european ones for this civ only the textures are distorted - not just Asian textures but greco-roman ones too.

    I'm not sure what caused this?? I deleted it and tried again but got the same result. Any help appreciated.
     
  12. VCrakeV

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    322
    I'm looking to add some buildings in my mod. Is it as simple as copy and pasting a similar building's xml info, changing it slightly, and adding the text for it the text xml? Or are there more files I would have to edit?
     
  13. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,322
    Gender:
    Male
    Location:
    Canberra, Australia
    BuildingInfos, BuildingClassInfos in the XML\Buildings folder and CIV4ArtDefines_Building in the XML\Art folder is enough for most buildings. Of course there is the art files that need copying as well.
     
  14. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,055
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    Thank you very much! It works flawlessly. :)

    Does anyone know if there's something special to the <Flavors> tag in CIV4UnitInfos.xml? I'd assume all units default to the flavour MILITARY, unless they get another flavour assigned to them (Spies get ESPIONAGE, Great Prophets get RELIGION, and so on).

    Thus, if I want to add a few flavours - say, CAVALRY, SIEGE... - I should give units both the flavour MILITARY and my own flavour, I suspect. Would that break anything, if anyone knows? Because I don't want leaders with flavour MILITARY to never build any units anymore because they all have a different flavour.
     
  15. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    33,116
    Gender:
    Male
    Location:
    Leblanc
    Think of flavors as leader-specific positive bias. Everyone will still evaluates stuff in the game based on their usefulness. But a military leader will prefer military flavored techs even above that.

    Flavors also have other effects, for example a great person associated with a flavor will prefer techs with similar flavors on their discovery list.

    But in general you cannot break anything by adding a new flavor. The worst thing that can happen is that it does nothing.
     
  16. VCrakeV

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    322
    Is it possible to give a building defence that works against gunpowder units?
     
  17. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,055
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    I know that. But that would imply that the flavour MILITARY actually doesn't do anything when it comes to building units - that only iBuildUnitProb influences how many units are made. So I wondered if the flavour MILITARY perhaps did influence that, in such a way that every single unit without a flavour automatically got the flavour MILITARY attached to it. But alright, thank you. :)

    And no, VCrakeV, I don't believe you can do that using only the XML files (now, with the SDK, for example, it would be possible, of course).
     
  18. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,676
    Location:
    UK
    @Crake

    If you wanted to explore the problem further, this is the actual tag in the unitinfos that makes a unit 'gunpowder' in terms of building defence.
    <bIgnoreBuildingDefense>1</bIgnoreBuildingDefense>
     
  19. VCrakeV

    VCrakeV Prince

    Joined:
    Aug 22, 2014
    Messages:
    322


    Well, :) :) :) :):) :) :) :):) :) :) :):) :) :) :)... Thanks! I was just half-way through changing all gunpowder units to a new combat class that I made... Since I'm already pretty much done, do you think that would work too?
     
  20. need my speed

    need my speed Rex Omnium Imperarium

    Joined:
    Oct 3, 2009
    Messages:
    2,055
    Gender:
    Male
    Location:
    European Union (Magna Batavia)
    No. ARMOR, for example, also ignores it, so it's not part of one unitclass (it's simply bIgnoreBuildingDefense). Besides, if you do ever want to add a new unitclass, you'd also have to carefully change all the instances where this unitclass is used; combat modifiers, promotions, events...
     

Share This Page