Scout / Explorer Upgrade Easy Question

smeagolheart

Monarch
Joined
Sep 4, 2007
Messages
924
Location
Phoenix, AZ
Hey,

I'm trying to make a new unit for my mod. I want a settler upgrade to another unit - a Colonist.

I want to make it like how the scout disapears and you can only build explorers after Tech Compass.

My settler and my colonist are appearing at the same time, I can't figure out how to make them dissapear like the scouts do.
It's probably easy, what am I missing?
 
There is a tag for units called "UnitClassUpgrades"

Look at the entry for the Scout, there should be a set of tags that looks something like this:

<UnitClassUpgrades>
<UnitClassUpgrade>
<UnitClass>UNITCLASS_EXPLORER</UnitClass>
<bUpgrade>1</bUpgrade> (not sure what this tag actually is)
</UnitClassUpgrade>
</UnitClassUpgrades>


The easiest thing to do, is copy the entire brackett of Tags (from Open to CLose) and just copy it over the same Tag for the Settler. The Settler's should look like

<UnitClassUpgrades/> (Because it doesnt upgrade to anything at the moment)

Anyway Replace the Settler one with the Scouts, and then just replace the UNITCLASS_EXPLORER with UNITCLASS_COLONIST
 
First create a mod or copy the files you'll need into my documents/my games in the same structure they are in the main folder. Never edit the original files. If you need help to do this part then read some tutorials for add a unit or other various XML tutorials. Copy the settler entry in the civ4unitinfos.xml and paste it right after the settler entry and rename it Colonist. it will look like so,

Code:
<UnitInfo>
			<Class>UNITCLASS_COLONIST</Class>
			<Type>UNIT_COLONIST</Type>
			<UniqueNames/>
			<Special>NONE</Special>
			<Capture>UNITCLASS_WORKER</Capture>
			<Combat>NONE</Combat>
			<Domain>DOMAIN_LAND</Domain>
			<DefaultUnitAI>UNITAI_SETTLE</DefaultUnitAI>
			<Invisible>NONE</Invisible>
			<SeeInvisible>NONE</SeeInvisible>
			<Description>TXT_KEY_UNIT_SETTLER</Description>
			<Civilopedia>TXT_KEY_UNIT_SETTLER_PEDIA</Civilopedia>
			<Strategy>TXT_KEY_UNIT_SETTLER_STRATEGY</Strategy>
			<Advisor>ADVISOR_GROWTH</Advisor>
			<bAnimal>0</bAnimal>
			<bFood>1</bFood>
			<bNoBadGoodies>0</bNoBadGoodies>

The description leads to the tag that actually shows the name in the game. Civlopedia and strategy text you should know about. If you change these you will need to create/copy and add to a text file for the mod (or custom assets).

then in the settler entry you'll want to change <UnitClassUpgrades/> to this;

Code:
<UnitClassUpgrades>
		<UnitClassUpgrade>
			<UnitClassUpgradeType>UNITCLASS_COLONIST</UnitClassUpgradeType>
			<bUnitClassUpgrade>1</bUnitClassUpgrade>
		</UnitClassUpgrade>
</UnitClassUpgrades>

if you want to make the colonist add free buildings or something then add to the tag <ForceBuildings/> in a similar manner. Also change <PrereqTech>NONE</PrereqTech> to <PrereqTech>TECH_COMPASS</PrereqTech>

Then you will need to add the the civ4unitclassinfos.xml the same way. Copy the settler entry and rename the stuff to fit your colonist unit.

oops beat to it
 
For an upgrade to make a unit vanish from the buildable items list, all units that it upgrades to must be buildable. So, if musketman upgrades to both rifleman and grenadier, then you get chemistry, musketman will still be there unitl you can also build rifleman.
 
For an upgrade to make a unit vanish from the buildable items list, all units that it upgrades to must be buildable. So, if musketman upgrades to both rifleman and grenadier, then you get chemistry, musketman will still be there unitl you can also build rifleman.

That clears it up finally.
 
Back
Top Bottom