Way to modify unit (in play) of a player?

Syrkres

Chieftain
Joined
Mar 3, 2016
Messages
95
Location
Mass
For example if I research a new building or technology, it would be cool to give the active player's unit (who researched it) special ability.

For example, was thinking of add a late Techweb item which granted either all the players units or some of their units Invisibility.

Would want to do this just for the active player which researches it, not all of type units for all players?
 
You could do this using promotions and the <Technology_FreePromotions> table. (e.g. the same way PROMOTION_MIASMA_IMMUNE_WORKERS is granted by TECH_ALIEN_BIOLOGY in the vanilla game)

First, you'll need to create a promotion that gives the special ability you want (I'm not sure you can do invisibility with promotions in BE, but there are plenty of other effects in the UnitPromotions table that will work).

Then, add entries for your new promotion in the <UnitPromotions_UnitCombats> and/or <UnitPromotions_CivilianUnitType> tables, to control which units are capable of receiving it.

And finally, add an entry to <Technology_FreePromotions> to say which tech will grant that promotion. When a player researches that tech, all of their units that are capable of receiving that promotion will receive it.
 
Back
Top Bottom