News

Ship Blueprint Question

Posted on Tuesday, December 26, 2017

I'm trying to create an anomaly that awards a new type of ship to the player. For that I created the anomaly in my mod folder in a privately named anomaly file. Then I created another privately named file with the structure of "ShipBlueprintDefs.xml". But whatever I put in there, it is apparently not recognized, even if I take the body of an existing blueprint and put it in my definition so that only the name differs. Whenever my survey ships hit my new anomaly nothing gets awarded. If I award one of the existing blueprints, it works though, so my anomaly definition must be correct.

What am I missing here?

For reference here my anomaly definition (don't mind the weight, that's only for test purposes so that the anomaly takes precedence over all other anomaly definitions):

    <Anomaly>
      <InternalName>LCM-Special-4</InternalName>
      <DisplayName>Some text</DisplayName>
      <Description>Some description</Description>
      <ArtDefine>GraveyardAnomalyArt</ArtDefine>
      <Weight>900</Weight>
      <EncounterChance>0.5</EncounterChance>
      <EncounterTriggers>
        <OnEvent>OnCollideAtAnomaly</OnEvent>
        <Target>
          <TargetType>Fleet</TargetType>
        </Target>
        <Lifetime>Instant</Lifetime>
        <PerformAction>
          <Action>BattleEncounter</Action>
          <StringParam>PirateEncounter</StringParam>
        </PerformAction>
      </EncounterTriggers>
      <Triggers>
        <OnEvent>OnArriveAtAnomaly</OnEvent>
        <Target>
          <TargetType>Fleet</TargetType>
        </Target>
        <Lifetime>Instant</Lifetime>
        <PerformAction>
          <Action>AwardShipOfClass</Action>
          <StringParam>SwarmBlueprint2</StringParam>
        </PerformAction>
      </Triggers>
      <Triggers>
        <OnEvent>OnArriveAtAnomaly</OnEvent>
        <Target>
          <TargetType>Ship</TargetType>
          <TriggerGroupTargetType>AllShipsInFleet</TriggerGroupTargetType>
        </Target>
        <Lifetime>Instant</Lifetime>
        <Modifier>
          <EffectType>ExpPoints</EffectType>
          <BonusType>Flat</BonusType>
          <Value>5</Value>
        </Modifier>
      </Triggers>
    </Anomaly>

And here my blueprint definition:

  <ShipBlueprint>
    <InternalName>SwarmBlueprint2</InternalName>
    <ShipHullType>Small</ShipHullType>
    <Role>Assault</Role>
    <ShipGroup>Defender</ShipGroup>
    <CanBeBuilt>false</CanBeBuilt>
    <RequiredComponentType>MissileWeapon</RequiredComponentType>
    <RequiredComponentType>MissileWeapon</RequiredComponentType>
    <ComponentType>BestDefense</ComponentType>
    <ComponentType>LifeSupport</ComponentType>
    <ComponentType>MissileWeapon</ComponentType>
    <ComponentType>MissileWeapon</ComponentType>
    <ComponentType>BestDefense</ComponentType>
    <ComponentType>InterstellarDrive</ComponentType>
    <FillerComponentType>MissileWeapon</FillerComponentType>
    <FillerComponentType>MissileWeapon</FillerComponentType>
    <FillerComponentType>BestDefense</FillerComponentType>
    <FillerComponentType>LifeSupport</FillerComponentType>
  </ShipBlueprint>