Can anyone help me?

Voyhkah

Undead
Joined
Apr 25, 2009
Messages
1,444
Location
Earth
After a week of playing a new game and trying to forget the civ 5 modding system, I return to modding in an attempt to make a simple unit mod as an exersize. However, it seems that the mistake I keep making is apperent even there. Could anyone please take a few minutes to look over the attached file and see what the problem is? I'm sure it must be something simple.
 
I have not tried changing units myself (just buildins, techs and specialists so far), but the thing that stands out for me is the description and help tags on the unit promotion.

<Description>Anti-Mech</Description>
<Help>+250% vs. Giant Death Robot</Help>

I'd try replacing those with a reference to a string key. e.g.

<GameData>
<Language_en_US>
<Row Tag="TXT_KEY_ANTI_MECH_DESC">
<Text>Anti-Mech</Text>
</Row>
<Row Tag="TXT_KEY_ANTI_MECH_HELP">
<Text>+250% vs. Giant Death Robot</Text>
</Row>
<Language_en_US>
</GameData>
 
Yes, text references are missing. <description>, <Civilopedia>, <Strategy>, <Help> should point to data in a language file. Look at Kael's guide for an example. I'm not sure that's why it doesn't load, though.

Also, here:

Code:
<Unit_Flavors>
	<Row>
		<UnitType>UNIT_GREEK_HOPLITE</UnitType>
		<FlavorType>FLAVOR_OFFENSE</FlavorType>
		<Flavor>4</Flavor>
	</Row>
	<Row>
		<UnitType>UNIT_GREEK_HOPLITE</UnitType>
		<FlavorType>FLAVOR_DEFENSE</FlavorType>
		<Flavor>8</Flavor>
	</Row>
</Unit_Flavors>

I guess you forgot to replace the UNIT_GREEK_HOPLITE by UNIT_ANTIMECH


And, why this?
Code:
<Requirements>TXT_KEY_NO_ACTION_SETTLER_SIZE_LIMIT_HARDCODED</Requirements>

It's only used for settlers, and i'm not sure it's correct to use it for units.


Edit: Oops, that's not all. About the promotion:

Code:
    <UnitPromotions_UnitClasses>
        <Row>
            <PromotionType>PROMOTION_ANTIMECH</PromotionType>
            <UnitClassType>UNITCLASS_MECH</UnitClassType>
            <Modifier>250</Modifier>
        </Row>
    </UnitPromotions_UnitClasses>

You used UNITCLASS_MECH instead of UNITCLASS_ANTIMECH so it can't work.

And by the way, the AllowEmbark, is probably unnecessary.


Edit2: UnitClasses references are also missing. You *need* this reference for the mod to load anything at all, here's the correct one for your unit:

Code:
<GameData>
	<UnitClasses>
		<Row>
			<Type>UNITCLASS_ANTIMECH</Type>
			<Description>TXT_KEY_UNIT_ANTIMECH</Description>
			<DefaultUnit>UNIT_ANTIMECH</DefaultUnit>
		</Row>
	</UnitClasses>
</GameData>


There's probably other things wrong there and there. I'd strongly suggest you to use Kael's guide as a reference and to look at other people's modifications. You should use separate files for units, classes, promotions, and texts. It's not mandatory, but it's good practice and allows easier debugging as one error in one file won't break a whole project.

Also, start small, add a basic unit first, check if it loads correctly. If it does, then add the promotions, and so on. It makes it easier to spot where the issue belongs.
 
:blush::blush::blush::blush::blush::blush:

I am actually a veteran of Civ4, but here my modding skills mean nothing. I have read Kael's guide, I just forgot some stuff. Careless errors. I fixed them all.


BTW, why are there no error messages on loading a mod? That was one of my favorite things about Civ4. Now how am I supposed to correct errors.

Still isn't there.

BTW, it Civ4, you could just wright the name in the <Description> tag.
 
you can still write in the name of the description tags, most of the language stuff is unnecessary, but some of it isn't. Like I found out that just re-naming the era's isn't good enough, they still show up as standard in the tech screen unless you use the language tags and change those instead. You just have to kind of experiment and see what works and what doesn't.
 
Mod Buddy is nothing more than a bloated XML parser, you can do basically the same thing with notepad. All it does is checking your files for unclosed tags and other mostly useless things like this. It doesn't check for game related errors sadly. Running Civ5 in debug mode may drop a log once you've loaded a game, but i've not checked. Someone else can probably confirm this.

Also i gave you a wrong advice about the promotion, it was kinda late and i misread the file, the
Code:
<Row>
    <PromotionType>PROMOTION_ANTIMECH</PromotionType>
    <UnitClassType>UNITCLASS_MECH</UnitClassType>
    <Modifier>250</Modifier>
</Row>

was correct.

I do know that you can put text directly in the <desc> tags in Civ4 and it's probably still the case, this said it's not good practice (like the "goto" command still exists in VB, but no one use it :p).

I'll give a look at your modification later (or if someone else want to, feel free).
I'm not at home right now.
 
Top Bottom