Here's what I did to solve this:
First, I went to Orders/orbits.lua where I modified the absorb_major_empire function:
Code: Select all
function absorb_major_empire(new_empire,empire)
order.absorb_fleets(new_empire,empire)
order.absorb_empire(new_empire,empire)
if not new_empire.absorbed
new_empire.absorbed={empire}
else
new_empire.absorbed[1+#new_empire.absorbed]=empire
end
--special hardcoded weirdness
if empire.species=='tinker'
new_empire.got_dzibix = true
print('got dzibix!')
end
--coin and ore
new_empire.metal += empire.metal
empire.metal = 0
new_empire.credits += empire.credits
empire.credits = 0
@Technologies/tech_queries.lua:
Code: Select all
Empire.possible_improvements = weak_memoizeNN | function(empire,planet)
-- always show these basic improvement types.
local rval = set('Factory','Lab','Planetary Defenses','Farm','Mine')
local mt = getmetatable(empire.tech_info)
-- add additional improvements if we appear to have tech for
-- them.
for t,info in pairs | empire.tech_info
local unlocks_improvement in info
if unlocks_improvement
rval[unlocks_improvement]=true
end
end
if empire.species=='tinker' or (empire.got_dzibix and (planet.pop_and_habs['tinker'] or planet.pop_and_habs['tinker_harmonized']))
rval.Factory=nil
rval['Machine Altar']=true
end
return rval
end
Galaxy\apply_morale_effects.lua:
Code: Select all
function wont_become_unhappy(planet,race)
local suffix = get_race_suffix(race)
if suffix=='slave'
return true
end
if suffix=='harmonized'
if (planet.empire.species=='tinker' or planet.empire.got_dzibix) and planet.machine_altars>0
return true
end
end
end
GUI\~GalaxyMap\@PlanetPopInfoBoxes.lua, in the planet_race_info_text function:
Code: Select all
-- tinkers always get a harmonize button, though it may be
-- greyed out.
if (planet.empire.species=='tinker' or planet.empire.got_dzibix) and (get_race_suffix(race)~='harmonized') and (get_race_suffix(race)~='harmonized_unhappy')
local cant_harmonize = planet:cant_harmonize(race)
Orders\activities.lua:
Code: Select all
function Empire.cant_use_activity(empire,activity)
if empire.species=='tinker' and not empire.absorbed
return activity=='City Planning'
elseif not empire.got_dzibix
return activity == 'Manufacture Population'
end
end
1. A Tinker empire that annexed another species get access to City Planning.
2. A Non-Tinker empire that annexed the Tinkers get access to Manufacture Population.
Note that these activities are also constrained by planet-level checks, this one is merely the empire-level check. Basically you'll get ManuPop on planets with cyborgized populations, and CitPlan on planets with regularly-biological populations, and if both pop types are present you do get both activities.
Orders\harmonize_mechanics.lua:
Code: Select all
Planet.cant_harmonize = weak_memoizeNN | function(planet,race)
local vanilla = remove_race_suffix(race)
if not planet.empire return 'no_empire' end
if not RACE_INFO[race].harmonizable
return 'not_harmonizable'
end
if get_race_suffix(race)=='harmonized' or get_race_suffix(race)=='harmonized_unhappy'
return 'already_harmonized'
end
local empire in planet
if not empire:known 'Cybernetic Organisms'
return 'tech_not_known'
end
if empire.species~='tinker' and not empire.got_dzibix
return 'not_tinker'
end
if planet.machine_altars < 1
return 'no_altars'
end
Code: Select all
-- implicitly deharmonize if we have harmonized tinkers that
-- are, indeed, disconnected.
if planet.pop?.tinker_harmonized
if (planet.empire?.species~='tinker' and not planet.empire.got_dzibix) or (planet.machine_altars < 1)
local race ='tinker_harmonized'
local vanilla = 'tinker'
local n=planet.pop[race]
planet.pop[vanilla] =n + (planet.pop[vanilla] or 0)
planet.pop[race] = nil
end
end
-- implicitly make happy any unhappy harmonized aliens
if (planet.empire?.species=='tinker' or planet.empire?.got_dzibix) and (planet.machine_altars > 0)
for r, n in pairs | shallow_copy | planet.pop?
if get_race_suffix(r)=='harmonized_unhappy'
order.convert_to_removed_suffix(planet,r,'unhappy',n)
end
end
end
The last in this file is this:
Code: Select all
function Planet.isnt_harmonized(planet,race)
if get_race_suffix(race)~='harmonized' and get_race_suffix(race)~='harmonized_unhappy'
return 'not_harmonized'
end
local empire in planet
if empire.species~='tinker' and not empire.got_dzibix
return 'non_tinker_empire'
end
if planet.machine_altars<=0
return 'no_altar'
end
end
And that's it.