[TUTORIAL] Video Tutorials on Modding Civ4

Not sure though... I will keep looking.

I'm not really sure how to change prereqs for techs. For example I want to change the armor to being able to be produced with only 'turret design' and an coal or oil.
 

Attachments

  • CIV4UnitInfos.xml
    1.2 MB · Views: 22
Anyone good with Modular Civs? I'm trying to combine the Legends of Rev mod with my personally added Units & the fine modular civs on the forums. They show up but show up wrong and unplayable. Yes I loaded the Civs as a new mod first. Yes I changed the Modular =0 to 1.

Clearly I'm missing something tho :(
All the New Civs (Poland, Austria, Australia, North Korea, Lithuania, Swiss) fail to load properly with the Error code on the 'Modern Armor'.
I also tried to insert them in:
Mods/"The Mod"/Assets/Modular
or
Mods/"The Mod"/Assets/Modular/Custom Civilizations
 

Attachments

  • Modular - Modern Armor.png
    Modular - Modern Armor.png
    19.9 KB · Views: 24
  • Modular Civs 2.png
    Modular Civs 2.png
    1.4 MB · Views: 22
  • Modular Civs.png
    Modular Civs.png
    1.3 MB · Views: 22
I'm not really sure how to change prereqs for techs. For example I want to change the armor to being able to be produced with only 'turret design' and an coal or oil.
In the UnitInfos file, you change these XML tags:
Code:
            <PrereqTech>TECH_INDUSTRIALISM</PrereqTech>
            <TechTypes>
                <PrereqTech>TECH_TURRET_DESIGN</PrereqTech>
                <PrereqTech>TECH_ARTILLERY</PrereqTech>
                <PrereqTech>NONE</PrereqTech>
            </TechTypes>

For resources, you use these:
Code:
            <BonusType>BONUS_OIL</BonusType>
            <PrereqBonuses>
                 <PrereqBonus>TECH_COAL</PrereqBonus>
            </PrereqBonuses>
 
I Will recheck.
]I'm also having an issue where the game crashes about 10 turns in. I have pinpointed the issue to when I create a new class unit (like a tank destroyer or Light Tank). The class looks good. It shows up on the civilpedia. The art for my unit looks good. And I created a unit (Tank Destroyer) that looks like it works too. The only thing I notice is sometimes it says that the Tank Destroyer can upgrade to both a Mech Infantry & a Heavy Footman. Would this be the source of the crash or a random coincidence?
This still an issue?
 
Okay, so I used 2.0.0 Pre-Alpha 6 to do the Nifswap, and while it works fine in-game, now textures don't show up at all in NIFSkope, even if I try checking the "Show Textures" option in the Render menu (it doesn't work; nothing gets checked and nothing changes if I click on it):
@Midnight-Blue766
Just fyi, I'm still using NifSkope 1.2.0 afaik, which is probably why things function different. I had too many issues with later versions, this may be a source of part of your problems.
 
Anyone good with Modular Civs? I'm trying to combine the Legends of Rev mod with my personally added Units & the fine modular civs on the forums. They show up but show up wrong and unplayable. Yes I loaded the Civs as a new mod first. Yes I changed the Modular =0 to 1.

Clearly I'm missing something tho :(
All the New Civs (Poland, Austria, Australia, North Korea, Lithuania, Swiss) fail to load properly with the Error code on the 'Modern Armor'.
I also tried to insert them in:
Mods/"The Mod"/Assets/Modular
or
Mods/"The Mod"/Assets/Modular/Custom Civilizations
I can help you with this, actually.

Legends of Revolution changes the Modern Armor entry to Main Battle Tank. Look it up - it's called UNITCLASS_MAIN_BATTLE_TANK in the files. This is why I personally don't use modular civs with other mods that change a lot - the mods often change small details and modular civs have to have everything adjusted to fit with the mod.

But if you want to try it, you have to make sure you follow the error and switch
Code:
UNITCLASS_MODERN_ARMOR

to:
Code:
UNITCLASS_MAIN_BATTLE_TANK

or else it won't work. Make sure you do it in the modular XML file the error links you to go to.

As for the art not appearing, I'm not sure. Pink means the link is broken, so verify the art paths.
 
Line by Line

Line by Line is a tutorial series where we take an in-depth look at the XML Files used for Civ4 modding. I convey the nitty-gritty details of each tag and ramble on. :D

Line by Line: Intro Video

Expertise Required:
How to Create a Mod (Recommended)

Relevant Files and Programs
Notepad++
 
Yes, I took the new unit (tank destroyer) out because it deff crashes the game early in play through.
OK try to add it again if you want and see if it happens again. If it does post the code for me. :)
 
I can help you with this, actually.

Legends of Revolution changes the Modern Armor entry to Main Battle Tank. Look it up - it's called UNITCLASS_MAIN_BATTLE_TANK in the files. This is why I personally don't use modular civs with other mods that change a lot - the mods often change small details and modular civs have to have everything adjusted to fit with the mod.

But if you want to try it, you have to make sure you follow the error and switch
Code:
UNITCLASS_MODERN_ARMOR

to:
Code:
UNITCLASS_MAIN_BATTLE_TANK

or else it won't work. Make sure you do it in the modular XML file the error links you to go to.

As for the art not appearing, I'm not sure. Pink means the link is broken, so verify the art paths.
I'm trying to find the Unit_Class file in these modulars but i can't find it. I can see where everything else is like the art and the civs and units but not the class.
 

Attachments

  • Austria.png
    Austria.png
    112 KB · Views: 22
I'm trying to find the Unit_Class file in these modulars but i can't find it. I can see where everything else is like the art and the civs and units but not the class.
It actually doesn't need the UnitClass file, Modulars work different. They just tack stuff on instead of needing every file.

You just need to find the file that the error was linking to, which is UnitInfos, and make the changes I described.
 
So find MODERN_ARMOR in there and change it to MAIN_BATTLE_TANK (I think, you can check the main UnitInfos to make sure)
 
OK try to add it again if you want and see if it happens again. If it does post the code for me. :)
Happened again. This is my first clue to a crash error... The upgrade is off.
 

Attachments

  • Tank Destroyer.png
    Tank Destroyer.png
    1.3 MB · Views: 24
  • CIV4UnitClassInfos.xml
    50.6 KB · Views: 21
  • CIV4UnitInfos.xml
    1.5 MB · Views: 21
I think I found the problem:

Check the UnitInfos file, where you have the Tank Destroyer:

Code:
        <UnitInfo>
            <Type>UNITCLASS_TANK_DESTROYER</Type>
            <Type>UNIT_TANK_DESTROYER</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_ARMOR</Combat>
            <Domain>DOMAIN_LAND</Domain>

Notice anything weird? That's right, there's two Type tags. Change it to this:
Code:
        <UnitInfo>
            <Class>UNITCLASS_TANK_DESTROYER</Class>
            <Type>UNIT_TANK_DESTROYER</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_ARMOR</Combat>
            <Domain>DOMAIN_LAND</Domain>

And see if it works.
 
I think I found the problem:

Check the UnitInfos file, where you have the Tank Destroyer:

Code:
        <UnitInfo>
            <Type>UNITCLASS_TANK_DESTROYER</Type>
            <Type>UNIT_TANK_DESTROYER</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_ARMOR</Combat>
            <Domain>DOMAIN_LAND</Domain>

Notice anything weird? That's right, there's two Type tags. Change it to this:
Code:
        <UnitInfo>
            <Class>UNITCLASS_TANK_DESTROYER</Class>
            <Type>UNIT_TANK_DESTROYER</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_ARMOR</Combat>
            <Domain>DOMAIN_LAND</Domain>

And see if it works.
Wowwww. That did it Haha! Yup never noticed that. The upgrade issue went away and the game did not crash like it did before. Thank you! How would i change the unit to single unit graphics. it has 3 tanks instead of 1. the rest of the game is still single unit with that option check box on.
 
So find MODERN_ARMOR in there and change it to MAIN_BATTLE_TANK (I think, you can check the main UnitInfos to make sure)
So what's your best advice for adding new civs into a mod like legends? I've never created a civ before or successfully ported a civ into a game but it would be nice to add some civs to the game. sounds like a lot of work tho.
 
In the UnitInfos file, you change these XML tags:
Code:
            <PrereqTech>TECH_INDUSTRIALISM</PrereqTech>
            <TechTypes>
                <PrereqTech>TECH_TURRET_DESIGN</PrereqTech>
                <PrereqTech>TECH_ARTILLERY</PrereqTech>
                <PrereqTech>NONE</PrereqTech>
            </TechTypes>

For resources, you use these:
Code:
            <BonusType>BONUS_OIL</BonusType>
            <PrereqBonuses>
                 <PrereqBonus>TECH_COAL</PrereqBonus>
            </PrereqBonuses>
So I must be editing it wrong...
Still hasn't changed.
 

Attachments

  • Armor.png
    Armor.png
    23.2 KB · Views: 29
  • Armor2.png
    Armor2.png
    590.8 KB · Views: 29
Top Bottom