Adding a new unit

Draffin

Chieftain
Joined
Oct 28, 2015
Messages
21
Location
Amsterdam, Nederlands
Hi Everyone,

Dumb mod question 3.

I'm trying to add a completely new unit and have tried to do it via updating the following tables

Unitclasses
Units
LocalizedText (For definitions)

Now it builds fine and the game attempts to load with just these 3 tables but then it hangs and I have to hard reboot my computer to get out of it...which is a mildly frustrating issues. If anyone has some example code of everything you need to add a new unit it would be greatly appreciated.

Cheers
Draffin
 
To update on that, here's my code. I found another unit mod in the downloads folder of this site but it doesn't look any different to mine...

Code:
<GameData>
	<UnitClasses>
		<Row>
			<Type>UNITCLASS_BENNYMARINE</Type>
			<Description>TXT_KEY_UNIT_BENNYMARINE</Description>
			<DefaultUnit>UNIT_BENNYMARINE</DefaultUnit>
		</Row>
	</UnitClasses>

	<Units>
		<Row>
			<Type>UNIT_BENNYMARINE</Type>
			<Class>UNITCLASS_BENNYMARINE</Class>
			<Combat>10</Combat>
			<Cost>50</Cost>
			<PrereqTech>TECH_HABITATION</PrereqTech>
			<Description>TXT_KEY_UNIT_BENNYMARINE</Description>
			<Civilopedia>TXT_KEY_UNIT_BENNYMARINE_PEDIA</Civilopedia>
			<Help>TXT_KEY_UNIT_BENNYMARINE_HELP</Help>
			<Moves>2</Moves>
			<CombatClass>UNITCOMBAT_MELEE</CombatClass>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_ATTACK</DefaultUnitAI>
			<MilitarySupport>true</MilitarySupport>
			<MilitaryProduction>true</MilitaryProduction>
			<Pillage>true</Pillage>
			<AdvancedStartCost>10</AdvancedStartCost>
			<XPValueAttack>3</XPValueAttack>
			<XPValueDefense>3</XPValueDefense>
			<Conscription>1</Conscription>
			<UnitArtInfo>ART_DEF_UNIT_MARINE</UnitArtInfo>
			<UnitArtInfoUpgradeVariation>true</UnitArtInfoUpgradeVariation>
		</Row>
	</Units>

	<LocalizedText>
		<Row Language="en_US" Tag="TXT_KEY_UNIT_BENNYMARINE">
			<Text>Benny Marine</Text>
		</Row>

		<Row Language="en_US" Tag="TXT_KEY_UNIT_BENNYMARINE_PEDIA">
			<Text>Benny Marine, he shot me down</Text>
		</Row>

		<Row Language="en_US" Tag="TXT_KEY_UNIT_BENNYMARINE_HELP">
			<Text>Marine Unit. But more Benny</Text>
		</Row>
	</LocalizedText>
		
</GameData>
 
That code works just fine for me. Starting, constructing a unit and moving it did not cause any issues.
 
Back
Top Bottom