
Ideally devs would change GenerateColonistData? which for some reason doesn't set colonist.specialist for Androids and thus Colonist:GetSpecializationIcons fails (twice). Once for flat out returning "" for Androids
Code:
if traits.Child or traits.Android then
return ""
end
Code:
spec = ColonistClasses[self.specialist or "none"]
if spec == "" then
spec = "Colonist"
end
But if for whatever reason they don't, you need something like this:
Code:
local traits = DataInstances.Trait
for i = 1, #traits do
if traits[i].name == trait_id then
cat_id = traits[i].category
break
end
end
if cat_id == "Specialization" then
if colonist.traits.Android then
if trait_id ~= "none" then
local spec = ColonistClasses[trait_id]
if spec == "" then
spec = "Colonist"
end
colonist.ip_specialization_icon = string.format("UI/Icons/Colonists/IP/IP_%s_%s.tga", spec, colonist.entity_gender)
colonist.pin_specialization_icon = string.format("UI/Icons/Colonists/Pin/%s_%s.tga", spec, colonist.entity_gender)
end
end
end
Code is probably crap but I cba to learn somebody's pet project that for some inexplicable reason is now standard for game logic. It adds nothing but some convoluted syntax and stupid restrictions. Wth is Javascript missing that Lua has? Or better yet, full Java. Python for crying out loud.
Anyway, won't be releasing mod for this. First, there are no mod tools for Linux and second, /effort. Maybe poke Ampoliros to add it to his Biorobot Fix (which you should be using anyway).
Unrelated, I'm not getting OnMsg.ColonistBorn fired for human births. Fires for Android creation but not for humans. Can see ColonistAddTrait firing and adding traits to newborn (Age=Child for instance).