Disable unit.

Shoobs

Prince
Joined
Mar 31, 2010
Messages
498
I am well aware of the ability to disable a unit for the entire game.
This is not what I wish to do.

I want to disable a unit for one specific civilization, and only that civilization and not disable techs to do so.

Is this possible without using DLL, LUA, or other techniques than XML?
 
Would I need to do this for every single unit I wish to disable for a civilization?

Answer: No, I figured it out. Once I used a template for the UU to set two units to the same "nobuild" unit, neither unit could be built anymore. Its not elegant but it works.
 
You can use civilization overrides (XML only) to make it so a specific civilization can't build a specific unit class (this method is used to prevent minor civs from building many things).
 
Code:
<!-- No scouts, nukes or carriers for the City States -->
<Civilization_UnitClassOverrides>
  <Row>
    <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
    <UnitClassType>UNITCLASS_SCOUT</UnitClassType>
    <UnitType/>
  </Row>
  <Row>
    <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
    <UnitClassType>UNITCLASS_ATOMIC_BOMB</UnitClassType>
    <UnitType/>
  </Row>
  <Row>
    <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
    <UnitClassType>UNITCLASS_NUCLEAR_MISSILE</UnitClassType>
    <UnitType/>
  </Row>
  <Row>
    <CivilizationType>CIVILIZATION_MINOR</CivilizationType>
    <UnitClassType>UNITCLASS_CARRIER</UnitClassType>
    <UnitType/>
  </Row>
</Civilization_UnitClassOverrides>
 
I see that can be done for minor civilizations, but can it be done with a specific major civilization and only that one?
 
As stated ...

You can use civilization overrides (XML only) to make it so a specific civilization can't build a specific unit class
 
I'm going to give that a try now that I've looked at the code. I was thrown off by Civilization_Minor. EDIT: This Failed, utterly, in that the civilization no longer shows up as selectable.

As an aside, can you make it so said civilization can purchase their unique unit via faith but no other civilization can do so?
I can't seem to find an example to work off of.
 
As far as the failure, if you want help you should upload your built mod.

For your faith question, in the Units table, just set a "FaithCost" if you haven't already, and set "RequiresFaithPurchaseEnabled" to false.
 
The faith part makes it available, as far as I know, to other civilizations doesn't it?
 
I am cautious to using faithcost/faithrequirement false because I've seen many a mod use both and then find out I can build them via faith in the religion menu. Amazon and Chimor being the two prime candidates.

Name of a utility that actually can help check to see if my mod is simply compiling wrong in civ5?
 
Or, why not just add a <Trait_NoTrain> clause to the civ's trait?
Code:
<Trait_NoTrain>
	<Row>
		<TraitType>TRAIT_YOUR_CIV_TRAIT</TraitType>
		<UnitClassType>UNITCLASS_UNDESIRABLE_UNIT</UnitClassType>
	</Row>
</Trait_NoTrain>
This will require BNW, just as a note.
 
Name of a utility that actually can help check to see if my mod is simply compiling wrong in civ5?

You read the logs and look at the database [or ask someone to help you do so if you can't figure it out].

There's this utility, but it's still in development.
 
C:\Users\*your username*\Documents\My Games\Sid Meier's Civilization 5\Logs
(for windows)
But they don't do anything useful until you enable logging in the config.ini.

EDIT: Ninja'd :ninja:
 
Aha!

Seems It WAS loading properly but I didn't check the civ leader tree well enough.

Text errors...... I'm going to go into a corner and cry because text errors. - Fixed.

Going to try that other solution again real fast. - It works. Seems the issue was not the mod or the changes but that I mistakenly ripped the text file up and the game went "nope." <UnitType/> does indeed work and allows disabling of multiple units for a civilization. Sorry Whoward.

Still inquiring about the faithcost/faith req thing being single civilization.
 
Good, glad you worked it out.

Still inquiring about the faithcost/faith req thing being single civilization.
You could always try it and find out. [No, it looks like it won't work.] If you're OK with a BNW-only solution, then go with AgressiveWimp's suggestion. [Never mind, I see that's not going to work, unless Trait_NoTrain prevents faith purchasing.] Otherwise, I think Lua is the only way.

See the first post [and post #12]of this thread. [No, they never get it quite right...]
 
Top Bottom