• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Hobbes__

Major
4 Badges
Sep 11, 2018
541
293
  • BATTLETECH
  • BATTLETECH: Flashpoint
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
Hello,
This is a specific question regarding usage of the new enums.

On the faction.json, for each entry there is a field called: "IsPirate" : false

DataDrivenEnumNotes further specifies that 'The notes on IsGreatHouse, IsClan, IsMercenary, IsPirate: Not really used by HBS, but it could be useful to modders who need to select a random Merc unit.'

So my question is, if I define a number of factions as 'isPirate': true, could I then replace this:

"RequirementComparisons" : [
{
"obj" : "Target.AuriganPirates",
"op" : "Equal",
"val" : 0,
"valueConstant" : null
},
{
"obj" : "Target.CapellanPirates",
"op" : "Equal",
"val" : 0,
"valueConstant" : null
},
{
"obj" : "Target.ClusterPirates",
"op" : "Equal",
"val" : 0,
"valueConstant" : null
}

]
With this?

RequirementComparisons" : [
{
"obj" : "Target.IsPirate",
"op" : "Equal",
"val" : 0,
"valueConstant" : null
}
]
If it's possible, this would really be useful because I currently have about 12 pirate factions :D
 
no i've found code - only faction ids is checked.
Code:
    private SimGameState.FilteredComparisonResults GetFilteredComparisons(IEnumerable<ComparisonDef> comparisons, Func<ComparisonDef, bool> ComparisonFunc)
    {
      IEnumerable<string> strings = comparisons.Where<ComparisonDef>((Func<ComparisonDef, bool>) (c => ComparisonFunc(c))).Select<ComparisonDef, string[]>((Func<ComparisonDef, string[]>) (c => c.obj.Split('.'))).Where<string[]>((Func<string[], bool>) (s => this.IsProperLength(s))).Select<string[], string>((Func<string[], string>) (s => s[1]));
      List<string> stringList1 = new List<string>();
      List<string> stringList2 = new List<string>();
      foreach (string factionID in strings)
      {
        stringList1.Add(factionID);
        if (factionID == "IsOwner")
          stringList2.Add(FactionEnumeration.GetInvalidUnsetFactionValue().Name);
        else
          stringList2.Add(this.GetFactionValueFromString(factionID).Name);
      }
      return new SimGameState.FilteredComparisonResults((IEnumerable<string>) stringList1, (IEnumerable<string>) stringList2);
    }
 
no i've found code - only faction ids is checked.

Thank you for the clarification - saves me the work of testing it and the frustration of not figuring out why it isn't working ;)