Logo Platform
logo amplifiers simplified

Checking for Curiosities & Paths

Reply
Copied to clipboard!
6 years ago
Nov 18, 2018, 5:54:16 PM

Hello everyone,


first post here, please be gentle :)




tl:dr  ->  How do I check if an undiscovered guardian curiosity is present on a planet?





long version:


I'm working on a mod build around guardians. The Idea is to add a some technologies and improvements to give guardians more meaning than just accidentially being present in a system. I also want to make guardians accessible to everyone - either by having the trait (guardians will provide full benefits) or after researching a 3rd. tier tech. I'm at a point where most things work like i want them to, however I'm struggling with the guardian curiosity: 


I want to add a feature that eventually allows you to "grow new guardians" on planets that don't have a guardian yet.

In order to do so, I've added a technologie that unlocks "guardian seedlings" as a new terraforming option (provided you have the guardian affinity).


the terraforming definition looks like this:


<PlanetTerraformationDefinition Name="PlanetTerraformationEndlessGuardiansCreate" SubCategory="PlanetTerraformationDust">

<Cost ResourceName="SystemProduction">560</Cost>


<TechnologyPrerequisite UnlockHidden="true" Flags="Technology,Prerequisite,Discard">EndlessGuardiansTraitTech1</TechnologyPrerequisite>

<PathPrerequisite Flags="Prerequisite,Discard">!PlanetAnomalyGuardian</PathPrerequisite>


 <SimulationDescriptorReference Name="PlanetAnomalyGuardian"/>

<RemovedType>PlanetAnomalyGuardian</RemovedType>


<PopulationEvent Name="PopulationPoliticalEventGuardianAwakened"/>

</PlanetTerraformationDefinition>


This works fine, however if there is an undiscovered guardian curiosity present on a planet it is possible to "terraform" first and discover the curiosity after - which leads to double guardians.

Therefore I would like to suppress the terraforming option if there is a guardian curiosity still present on the planet. I would like to check for "Curiosity_PlanetAnomalyGuardian", however doing something similar to  "<PathPrerequisite Flags="Prerequisite,Discard">!Curiosity_PlanetAnomalyGuardian</PathPrerequisite>" doesn't seem to work since there are no simulation descriptors for curiosities and I'm not even sure if they would be a child / member of "ClassPlanet".


Is there any way to do this?

Edit: also, is there an easy way to format xml code in forum posts, to improve readability?


Thanks in advance!

Updated 6 years ago.
0Send private message
6 years ago
Nov 20, 2018, 9:22:09 AM

Hey so.sad,


Unfortunately curiosities are not usable in any Prerequisite, so you cannot check for the presence or absence of a Curiosity in a Terraformation constructible.


There is an alternative solution (or at least a, uh... lead) however which would require the use of Quests, since they can do things with curiosities:

Create a quest which "listens" to the completion of this terraformation, and removes all Guardian curiosities on the planet if there are some.

Note that I am not sure if this is really possible and I suppose it's fairly complex, so it's just a lead for where to look at, sorry!


For the XML formatting, I usually quote it, that way it's nicely separated from the regular text!

0Send private message
6 years ago
Nov 20, 2018, 11:45:40 AM

If you're worried people might abuse the system and get more than 1 guardian on a planet, keep in mind you can move around guardians using a bug with the auto-governors, so you might want to think of another solution for your mod (for example you could make it so that stacking guardians is undesirable, by making their effects not stack).

Updated 6 years ago.
0Send private message
6 years ago
Nov 20, 2018, 9:26:11 PM

Hey,


thx for the replies!



MonAmiral wrote:


Unfortunately curiosities are not usable in any Prerequisite, so you cannot check for the presence or absence of a Curiosity in a Terraformation constructible.

Ok, I feared as much. Your remark on removing Guardian curiosities through a quest made me think though. Since it is possible to add a PathPrerequisite on the Curiosity itself, I first thought I could simply hide the curiosity.


<CuriosityDefinition Name="Curiosity_PlanetAnomalyGuardian" SubCategory="PlanetAnomaly" DisplayedType="CuriosityTypeGuardian" Difficulty="1" DiscoverOnColonization="false" ScoreProvider="CuriosityDiscovered" >

<VisibilityPrerequisites>            

<TechnologyPrerequisite Flags="Visibility">EndlessGuardiansTech1</TechnologyPrerequisite>

<InterpreterPrerequisite Flags="Visibility">Property(Context, DetectionLevel) ge 1</InterpreterPrerequisite>

<PathPrerequisite Flags="Visibility" Inverted="true">.../ClassEmpire/ClassColonizedStarSystem/ClassColonizedPlanet,PlanetAnomalyGuardian</PathPrerequisite>

</VisibilityPrerequisites>


<SimulationDescriptorReference Name="PlanetAnomalyGuardian"/>

<PopulationEvent Name="PopulationPoliticalEventGuardianAwakened"/>

</CuriosityDefinition>

However the highlighted line above would only work until the first guardian on a planet anywhere (in your empire) is discovered/build and then deactivate all the guardian curiosities.

What I would need to do is something like this:

<PathPrerequisite Flags="Visibility" Inverted="true">../ClassColonizedPlanet,PlanetAnomalyGuardian</PathPrerequisite>

but I do not believe the path to be accessible from wherever curiosities are stored, right?

(I'm unable to test this at the moment)



so i might have to look into quests after all :/



Kumas idea is interesting though - I could simply add negative effects for having multiple guardians on the same planet.

0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message