How To Add Units

Bin101

Chieftain
Joined
Nov 1, 2014
Messages
4
Hi I am a new moder and have succeeded in adding a building by looking at other mods. if you cant help me with the code please link me to a mod that adds a unit.:help:

:scan::borg::assimilate:

:thanx:
Bin101

here is the code:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created by ModBuddy on 11/1/2014 7:22:04 PM -->
<GameData>
	<!--Dosent work :(-->
  <!-- TODO: Insert table creation example here. -->
 
  <!-- TODO: Insert table data example here.-->
  
  <!-- Enter your Game Data here. -->
	<UnitClasses>

		<!-- Generic Units-->



		<Row>

			<ID>0</ID>

			<Type>UNITCLASS_TEST</Type>

			<Description>TEST</Description>

			<DefaultUnit>UNIT_TEST</DefaultUnit>

		</Row>
		</UnitClasses>
	<Units>
		<Row>
			<Type>UNIT_TEST</Type>

			<Class>UNITCLASS_TEST</Class>

			<Combat>10</Combat>

			<RangedCombat>300</RangedCombat>

			<Cost>10</Cost>

			<PrereqTech>TECH_HABITATION</PrereqTech>

			<Description>TEST</Description>
			<Civilopedia>TXT_KEY_UNIT_RANGED_MARINE_PEDIA</Civilopedia>

			<Help>TEST</Help>

			<Moves>19</Moves>

			<Range>100</Range>
			<NumExpeditionCharges>100</NumExpeditionCharges>
			<CombatClass>UNITCOMBAT_ARCHER</CombatClass>

			<Domain>DOMAIN_LAND</Domain>

			<DefaultUnitAI>UNITAI_RANGED</DefaultUnitAI>

			<MilitarySupport>true</MilitarySupport>

			<MilitaryProduction>true</MilitaryProduction>

			<Pillage>true</Pillage>

			<IgnoreBuildingDefense>true</IgnoreBuildingDefense>

			<AdvancedStartCost>20</AdvancedStartCost>

			<XPValueAttack>10000</XPValueAttack>

			<XPValueDefense>100</XPValueDefense>

			<UnitArtInfo>ART_DEF_UNIT_RANGED_MARINE</UnitArtInfo>

			<MoveRate>WHEELED</MoveRate>
			
		</Row>
	</Units>
	
</GameData>
 
Just glancing at it, you need to remove the ID tag from your UnitClasses entry. You want it to assign the ID automatically.

Look at database.log, and you'll see an error saying that your ID is not unique (i.e., ID=0 already exists).
 
Back
Top Bottom