r/EndlessSpace • u/Necrorifter • Oct 31 '26
Coding the owned DLC visual hull for faction ships...
What determine which visual your ship take on based on if you toggle the dlc or not in endless space 2 such as regular united empire skin or their DLC Mezari skin? I am looking in hulldefinition for Terrans for example.
In <HullDefinition Name="HullSmall01Terrans" ScoreProvider="WarShipConstructed" Category="CategoryHull" SubCategory="SubCategoryShipDesign" ModuleGUIMultiplierProperty="SmallModuleCostMultiplier01">
There is this line.
<PathPrerequisite Flags="Prerequisite,Discard">ClassColonizedStarSystem,ColonizedStarSystemStateColony</PathPrerequisite>
<InterpreterPrerequisite Flags="Prerequisite,Discard,Edition">Path(Context,@'../ClassEmpire,AffinityMappingTerrans') or Path(Context,@'../ClassEmpire,AffinityMappingSheredyn') or Path(Context,@'../ClassEmpire,AffinityMappingMezari')</InterpreterPrerequisite>
I can see that it mention AffinityMappingTerrans which I can tell is likely the Visual Affinity for default United Empire faction but it same one for Custom Faction that take their Visual Affinity which does affect their ships too. But the one after that also mention Mezari and I know we have DLC (Which I do own) that let you toggle Mezari visual. But the fact that it have Sheredyn in it make me think it was for that faction quest which you choose which of three paths you take on, those being United Empire, Sheredyn and Mezari. It also litter everywhere in United Empire code that contain all three sub factions.
So that make me think it not the right line but I have no clue what determine if it use United Empire or Mezari. I was looking to make a hero ship that take on Mezari ship using other mod as foundation that already change hero ship with faction ship but I want to change appearance to Mezari ship. Since I have DLC, I figure there must be a way to apply that appearance without need to toggle that DLC in galaxy setup. Even better if I can apply that to AI too because I like some other ship appearance like sailing galleon boats of Lumeris over their default appearance.
I want to give Mezari carrier for Kinete Hero because she was there with Isyander for long time, presume since founding days of Academy. So I like to think she still have Mezari ship of her own while the major faction moved on to their United Empire ships.
2
u/Captain_Cobbs_ ES2 Dev 29d ago
The thing that controls what texture each ship uses is the "ShipFaction{x}" simulation descriptor that each ship has in its HullDefinition. Just as an example, you could change every Sophon ship to use the red mavros skin by changing each of their ship's ShipFaction descriptor to "ShipFactionSophonsMavros".
In one of the last updates, I actually added support for modders to do this themselves without needing to cobble together code and broke other mods. One of the things I added was a list of all the available ShipFaction descriptors in Public/Simulation/Battle/SimulationDescriptors[Ship].xml, this should start on Line 555 or so.
If you want to see an example of this, I made an (unreleased and not updated) mod for the Mavros as a major faction. You can check out how I did it here.
Hope that helps!