Units that always casue unhappiness

Lefty Scaevola

Illuminatus
Retired Moderator
Joined
Oct 24, 2000
Messages
9,799
Location
San Antonio TX USA
There are (4 I think) units that always casue unhappiness in the base game. When I was editing a scenario, I did not notice any flag for this or a way to change it with either the units editor, or directly in the rules.txt file. Is this hard coded and unalterable for certain unit slots?
 
This is not hardcoded.
By default, all bombers and missile units cause unhappiness. Fighters do not.
This is because fighters and stealth fighters are the only units in the game with role flag set as 3 - air superiority, as bolded below (excerpt from rules.txt):

Fighter, Sth, 1, 10.,1, 4a,3d, 2h,2f, 6,0, 3, Fli, 000000000010001
Bomber, Sth, 1, 8.,2, 12a,1d, 2h,2f, 12,0, 0, AFl, 000000000000001
Cruise Msl., nil, 1, 12.,1, 18a,0d, 1h,3f, 6,0, 0, Roc, 001000000000000

Bombers and missiles are flagged as attack units (same as chariots, tanks, cannons etc.) and will typically cause unhappiness when away from city.

Additionally, bombers/missiles are flagged as air units, hence they will also cause unhappiness while within the city or in an airbase.

Even though fighters also belong to air domain, apparently their nature as air units is superseded in game rules by their air superiority role, thus even as air units, they will never cause unhappiness, at least as long as their role flag is set to 3.
Technically you could zero the flag or give it to more units but the AI may find it hard to properly use them. This flag is typically meant for the AI to know how to treat any units added by the player.
 
So, it is the "1" (air) domain flag combined with the "0" (attack) role that always causes unhappiness, even when in a city.
 
Yes, it appears that land units which also have role set as '0' do not cause unhappiness inside cities or in fortresses. Too bad the same doesn't work for bombers in airbases, it could be a nice feature.
 
Back
Top Bottom