Logo Platform
logo amplifiers simplified

Unique Improvements

Reply
Copied to clipboard!
7 years ago
Jun 12, 2018, 8:20:40 AM

I can't get "may only be built once per empire" to work.


I can limit construction to only one item per empire just fine. But if I scrap a unique improvement, I get a warning that it can't be built again, but this is not true. Once scrapped, it appears as an available building again.


I'm trying to copy the form used in the base game, but it's not working.

Then I noticed the base game unique improvements have the same problems too. Is this feature broken?


For now, I'm resorting to:
<Tags>Indestructible, Eternal, NoBailiff</Tags>

This, at least, prevents scrapping. Though I suspect they won't help if a system with the improvement gets captured.


I'm also including:

<SimulationDescriptorReference Name="StarSystemImprovementOncePerEmpire"/>
<SimulationDescriptorReference Name="StarSystemImprovementOncePerGalaxy"/>
I'm eniterely sure what these do since the corresponding SimulationDescriptors appear to be empty, but I figure they can't hurt.

EDIT: Oh, I'm guessing they apply the proper tooltip.




Updated 7 years ago.
0Send private message
7 years ago
Jun 12, 2018, 1:01:29 PM

Hey there!


Here's a colored example of what's important:

<StarSystemImprovementDefinition Name="StarSystemImprovementUniqueFood1"    Category="CategoryStarSystemImprovementUnique" SubCategory="SubCategoryFood" ScoreProvider="StarSystemImprovementBuilt">
   <SupervisorGain Name="Food" />

   <QueuedSimulationDescriptorReference Name="BuildingStarSystemImprovementUniqueFood1"/>

   <Cost ResourceName="SystemProduction">780</Cost>
   <PathPrerequisite Inverted="false"    Flags="Prerequisite,Discard">ColonizedStarSystemStateColony</PathPrerequisite>
   <PathPrerequisite Inverted="true"     Flags="Prerequisite,Discard">ClassColonizedStarSystem/StarSystemImprovementUniqueFood1,!FastForwardedImprovement</PathPrerequisite>
   <PathPrerequisite Inverted="true"     Flags="Prerequisite,Discard">../ClassEmpire/Uniques,StarSystemImprovementUniqueFood1</PathPrerequisite>
   <InterpreterPrerequisite Inverted="true"    Flags="Prerequisite,Discard">Path(Context,@'../ClassEmpire/ClassStarSystem,BuildingStarSystemImprovementUniqueFood1') and not(Path(Context,@'ClassStarSystem,BuildingStarSystemImprovementUniqueFood1'))</InterpreterPrerequisite>
   <TechnologyPrerequisite Flags="Prerequisite,Discard,Technology">TechnologyUniqueFood1</TechnologyPrerequisite>
   <SimulationDescriptorReference Name="StarSystemImprovementUniqueFood1" />
   <SimulationDescriptorReference Name="StarSystemImprovementUpkeepStage1High" />
   <SimulationDescriptorReference Name="StarSystemImprovementOncePerEmpire" />
   <PopulationEvent Name="PopulationPoliticalEventBuildingConstructionUniqueFood1"/>
   <UniqueTags>StarSystemImprovementUniqueFood1</UniqueTags>
</StarSystemImprovementDefinition>

These lines make sure it's not possible to queue several of them at once:

The QueuedSimulationDescriptorReference's descriptor is applied on the system whenever the improvement is queued.

The prerequisite checks if any other system has this descriptor, and causes the improvement to be invalid if it does.

<QueuedSimulationDescriptorReference Name="BuildingStarSystemImprovementUniqueFood1"/>
<InterpreterPrerequisite Inverted="true"    Flags="Prerequisite,Discard">Path(Context,@'../ClassEmpire/ClassStarSystem,BuildingStarSystemImprovementUniqueFood1') and not(Path(Context,@'ClassStarSystem,BuildingStarSystemImprovementUniqueFood1'))</InterpreterPrerequisite>

This part's SimulationDescriptorReference applies the effect.

Its prerequisite makes sure the improvement can be built only once per system by making sure the effect isn't already applied (except if it's applied via Riftborn Singularity).

The prerequisite is important and not redundant with the purple one because this situation can happen:

- Empire B builds the improvement on a system

- Empire A steals the system. Empire A hasn't built the improvement but still owns it.

- Empire A wants to build the improvement here: it should be able, since it hasn't built it itself

- This prerequisite fails, since the improvement is already built, and it is thus not redundant with the purple prerequisite.

<PathPrerequisite       Inverted="true"     Flags="Prerequisite,Discard">ClassColonizedStarSystem/StarSystemImprovementUniqueFood1,!FastForwardedImprovement</PathPrerequisite>
<SimulationDescriptorReference Name="StarSystemImprovementUniqueFood1" />

The UniqueTags block says "when an empire builds this, add the tag 'StarSystemImprovementUniqueFood1' on the Empire's Uniques simulation object.

The prerequisite says "if it's been already built" (unique tag already present), this improvement is unavailable and hidden.

<PathPrerequisite       Inverted="true"     Flags="Prerequisite,Discard">../ClassEmpire/Uniques,StarSystemImprovementUniqueFood1</PathPrerequisite>
<UniqueTags>StarSystemImprovementUniqueFood1</UniqueTags>

Finally, this descriptor just says "one per empire" in the tooltip:

<SimulationDescriptorReference Name="StarSystemImprovementOncePerEmpire" />


Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message