[Modding] Want to add a Starbase module that bonuses a Shipyard

Bonus doesn't work.

I've been trying my hand at modding even back in the earlier Betas. Today, I had the idea of making a starbase module that would increase the manufacturing output of any shipyard in its range. The bonus, however, does not apply.


  <StarbaseModule>
    <InternalName>SpaceFactoryModule</InternalName>
    <DisplayName>Space_Factory</DisplayName>
    <Description>SpaceFactory_Desc</Description>
    <Icon>GC3_Production_Spending_Stat_Icon.png</Icon>
    <SpecializationType>Economic</SpecializationType>
 
    <Stats>
      <EffectType>ModuleConstructionPoints</EffectType>
      <Scope>Queue</Scope>
      <Target>
        <TargetType>StarbaseModule</TargetType>
      </Target>
      <BonusType>Flat</BonusType>
      <Value>1</Value>
    </Stats>
 
    <Stats>
      <EffectType>MaxManufacturing</EffectType>
      <Target>
        <TargetType>Shipyard</TargetType>
      </Target>
      <BonusType>Flat</BonusType>
      <Value>5</Value>
    </Stats>

 
    <Prerequ>     
      <StarbaseModule>EconomicRingModule</StarbaseModule>
    </Prerequ>
 
  </StarbaseModule>


The tooltip will display "Manufacturing +5", but there is no effect to the shipyard itself. Even in the "Effects" tab on the starbase, there's no entry for the bonus to the shipyard.


Sidenote: It is possible to give certain other bonuses to shipyards from starbases. I experimented adding a bonus to shipyard point defense, like so:


    <Stats>
      <EffectType>PointDefense</EffectType>
      <Scope>AreaEffect</Scope>
      <Target>
        <TargetType>Shipyard</TargetType>
      </Target>
      <BonusType>Flat</BonusType>
      <Value>10</Value>
    </Stats>

And it worked.


Maybe I'm using the wrong <EffectType>, but I also tried "Manufacturing" and "Military", and couldn't find anything else that could be the proper type.
I think we need a lot more of modding resources (as in documentation for the XMLs and general guides). GC3, as Brad put it on the dev stream, is more than a game, it's a platform to build upon. But please give teach us to build upon this platform.

35,580 views 5 replies
Reply #1 Top

Try using this:

<EffectType>Military</EffectType>

<Scope>AreaEffect</Scope>

<Target>

<TargetType>Colony</TargetType>

</Target>

<BonusType>Flat</BonusType>

<Value>5</Value>

instead of targeting the shipyard. This is more or less what the 'Helpful Dust' event uses, and I'm fairly certain that you're trying to do essentially the same thing as that event does.

I'm not sure it'll work as I haven't tried it, but this is my guess at what would work.

Reply #2 Top

you could just give a military-manufacturing bonus to the colony,

it will add to the manufacturing send from the colony to the shipyard.

(not sure what happens when you use a flat bonus)

Reply #3 Top

Pirates use:


      <EffectType>Military</EffectType>
      <Scope>Global</Scope>
      <Target>
        <TargetType>Shipyard</TargetType>
      <TargetRelation>Self</TargetRelation>
      </Target>
      <BonusType>Flat</BonusType>
      <Value>5</Value>

So I'd suggest

      <EffectType>Military</EffectType>
      <Scope>AreaEffect</Scope>
      <Target>
        <TargetType>Shipyard</TargetType>
      </Target>
      <BonusType>Flat</BonusType>
      <Value>5</Value>

 

EDIT: I can confirm that this works.

+1 Loading…
Reply #4 Top

Thanks, Niedz! I was missing the AreaEffect scope, then!

Thanks everyone for your suggestions too, but I specifically want to give the bonus to the Shipyard, not the colony.

Reply #5 Top

Maybe it has something to do with the fact that there are offworld starbases now which can be created by a constructor, but also still the possibility to build a shipyard in the planet building list? (something that confuses me still)