Forbid Unit Training

Forcystus

Chieftain
Joined
Sep 22, 2007
Messages
62
Location
Everywhere
I’ve looked around a good bit and I need some help. Is there a way to prevent a civ from training one unit? I would like for them to still be purchasable with gold, but not produced
 
So long since I've done any modding ...

Don't think the PlayerCanTrain and/or CityCanTrain events indicate if this is a production or gold/faith purchase ...

So, you'll need to stop the civ being able to train/buy the unit in question (see how the base game stops barbies being able to build tanks, battleships, bombers, etc), and then create an identical unit that only that specific civ can train that can only be bought (like the Landsnechts (sp?))

HTH
 
That should work, but if you use the easy UU method to accomplish this, then you get that cosmetic issue where if the civ has a UB and a UU instead of 2 UU's you'll see the dummy unit instead of the UB on the setup, dawn of man, and civilopedia screens.

There are somewhat unsatisfying workarounds to the UU issue, but the best solution would be, as whoward69 says, using the CS and Barb technique of setting the UnitClassOverrides to blank rather than the dummy unit, preventing training/purchasing of the unit class, then use a dummy tech that you grant only to the specific civ with Lua that allows them to purchase the dummy unit that's set up like a Landsknecht as purchase-only.
 
Thank you both for your help in this matter. I tried what Nutty said and it seems to have worked.
 
Top Bottom