Logo Platform
logo amplifiers simplified

Quest Triggered by Anomaly?

Reply
Copied to clipboard!
7 years ago
Feb 15, 2018, 9:15:28 AM

I'd like to know if it's possible to trigger a quest if you own a planet with a particular anomaly. But I'm not sure if there's a term that exsists in the path instructions. I'm guessing you can count anomaly types like Positive, Negative, Mixed, Reduced, and Moon. But is there a way to specify a specific anomaly?


I've been looking through the quest examples, and I think it would be something like this:

<InterpreterPrerequisite Flags="Prerequisite">Count(Context, @'ClassEmpire/ColonizedStarSystem/ClassAnomaly ???, SubCategory... ????? ') ge 1</InterpreterPrerequisite>

(Where the ?? are the terms I'm not sure what should be. Perhaps: ClassAnomaly,SubCategory("AnomalyName")


And as long as I'm here, is there a resource that lists the full path hierarchy of game things, and the variables you can look at/modify?

The modding manual only gives an example of the structure. So far I've had to resort to finding path and variable possibilities by comming upon them by chance in the xml files, and this isn't really ideal.

0Send private message
7 years ago
Feb 15, 2018, 10:43:35 AM

Hey Tychonoir!


You can make your quest react to when a new turn begins, with a specific prerequisite which prevents it from starting until it is validated.

The tags of the quest must include BeginTurn, and it must have prerequisites that are checked on the empire: <Prerequisites Target="$(Empire)">.


If you want a prerequisite to check if the player owns a specific anomaly, a PathPrerequisite is enough (replace PlanetAnomalyDescriptorName with the name of any of the SimulationDescriptors applied by the anomaly):

<PathPrerequisite Flags="Prerequisite">ClassEmpire/ClassColonizedStarSystem/ClassColonizedPlanet,PlanetAnomalyDescriptorName</PathPrerequisite>

Note that currently, most anomalies give several descriptors which may not be enough, so you can override the AnomalyDefinitions to give more useful descriptors, like a category.


If you want to check if the player owns any anomaly anywhere, this one will do:

<PathPrerequisite Flags="Prerequisite">ClassEmpire/ClassColonizedStarSystem/ClassColonizedPlanet,PlanetAnomaly</PathPrerequisite>

And if you want to check for a number of any anomalies, you can use this prerequisite (where 5 is the minimum number of anomalies required):

<InterpreterPrerequisite Flags="Prerequisite">Count(Context, @'ClassEmpire/ClassColonizedStarSystem/ClassColonizedPlanet,PlanetAnomaly') ge 5</InterpreterPrerequisite>

If you want to see the structure of the game in terms of Path, Modifiers, Properties and other stuff, you can start the game with the modding tools enabled, press Shift+F1 and select the "Gameplay/Simulation" submenu. It will open a window which will let you see how everything works, what's active, where the value of each properties comes from, etc.

(to enable the modding tools, right-click on ES2 in steam, click on Properties, Set launch options, and type --enablemoddingtools)

0Send private message
7 years ago
Feb 15, 2018, 11:44:48 AM

Thanks!
Is there a setting in the modding tools that reloads xml files withoutout having to quit and restart the game every time I make a small change?

0Send private message
7 years ago
Feb 15, 2018, 5:10:00 PM

Unfortunately it is very complex to reload XML while the game is running.
This behaviour has to be manually coded for every data type (because everything has to be updated with the new values), so it's only available for quests (a button in the bottom-right corner of the Quests tool in the Shift+F1 menu, if I recall correctly).

0Send private message
7 years ago
Feb 17, 2018, 9:35:08 AM

I'm having a little trouble. In order to help me narrow it down to where the problem is, perhaps you can clarify this part:


If you want a prerequisite to check if the player owns a specific anomaly, a PathPrerequisite is enough (replace PlanetAnomalyDescriptorName with the name of any of the SimulationDescriptors applied by the anomaly):

The various SimulationDescriptors applied by an anomaly are defined in AnomalyDefinitions, and are the various SimulationDescriptorReferences. Right?
Since one of those SimulationDescriptorReferences is alwayays the unique name of the anomaly, I can use that as the quest prerequisite. Yes?

What concerns me, is that you then went on to say, that might not be enough. How can a unique name not be enough to identify a specific anomaly?
Have I misunderstood this part?

0Send private message
7 years ago
Feb 19, 2018, 12:42:42 PM

You are right about the SimulationDescriptorReferences thingy! You can use any of them for the quest prerequisites.


What I meant by "not enough" was that maybe you want the player to own one anomaly from a list, instead of any anomaly.

For example, you'll have to add a new SimulationDescriptorReference if you want the player to own "an atmosphere-related anomaly".

Updated 7 years ago.
0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message