[Modding] Allowing construction of shipyards when a specific improvement has been built?

Right now, I only allow specific races to build the default shipyard. I have added another shipyards with different prerequisites. Having the improvement as the prerequisite immediately deems that it has been met. Probably because it is colony specific or that the improvement simply exists within the ImprovementDefs.xml

I have tried having the improvement add a Stat or RaceTrait, but even setting those as prerequisites does not help . Too bad it can't give a specific free tech, then I would have an alternative.

Connected Github issue

4,464 views 2 replies
Reply #1 Top

I think the problem is that Shipyards are kind of hard-coded. The constructor module allows you to build them and there's nothing we can do about that, unless the devs change it.

I'd try another thing before knocking it, though: Add a new strategic resource (like Durantium, Antimatter, etc.) to the game, that can only be obtained by building the improvement. Make that resource a requirement for your shipyards. Hopefully that one works.

Reply #2 Top

A Stat can be a prerequisite, but they are defined in StatTypes.xml, so I'm not sure if I can add a new one...

Constructors worry me less, since without shipyards and outside help, the faction without the shipyards cannot obtain a constructor. Though I do have to block Ideology from creating any ship for that race.

I also set the initial Shipyard to not appear by having a custom ship style where I left the Default shipyard tag empty.