Logo Platform
logo amplifiers simplified

How to add anomalies to a planet

Reply
Copied to clipboard!
7 years ago
Oct 6, 2018, 6:52:31 AM

I am looking for a way to add an anomaly to a planet.  I found this older thread that mentions adding one through a quest (and says it's simple), but never actually shows how to do it.  Could anyone show a simple example of how this would work?  Or perhaps another way to do this?


0Send private message
7 years ago
Oct 6, 2018, 7:22:10 AM

I suggest you look at the quest ExplorationQuest27Ter (Found in QuestDefinitions[Exploration].xml Line 2702) which adds the Dust Halo Anomaly to planets.


The main part being it’s <Steps>


<Steps>
    <!--============ STEP 1 ============-->
    <Step 
Name="Step1">
        <ObjectiveSet>
            <StartActions>
                <Action_SpawnAnomaly>
                    <Input_Planets 
VarName="$AllPlanets"/>
                    <Input_AnomalyDefinition 
VarName="$SpecialAnomalyDefinition"/>
                    <Input_Count 
VarName="$NeededAmount"/>
                    <Output_Planets 
VarName="$SelectedPlanet"/>
                </Action_SpawnAnomaly>

            </StartActions>
            <Objective 
Name="Step1_Objective1">
                <Sequence>
                    <Decorator_BeginTurn></Decorator_BeginTurn>
                </Sequence>
            </Objective>
        </ObjectiveSet>
    </Step>
</Steps>

0Send private message
7 years ago
Oct 6, 2018, 3:53:51 PM

Thanks for this.  I started playing around with the anomaly in the debug console, and I noticed that, as expected, it can choose any existing planet.  Is there any way to limit planet selection, so that it only occurs on a colonized planet, or only sterile planets, or only in a selected constellation?


0Send private message
7 years ago
Oct 6, 2018, 4:24:51 PM

Yes, As you can see in the code it uses $AllPlanets as it's list of planets. which is set a few lines before:


<Var VarName="$AllPlanets">
    <From 
Source="$ConstellationsSystems.$AnyPlanet">
        <Where>
            <PathPrerequisite 
Flags="Prerequisite" Inverted="true">ClassPlanet,IsUniquePlanet</PathPrerequisite>
        </Where>
        <OrderBy>
            <SortRemovePlanetsOfSameSystem/>
        </OrderBy>
    </From>
</Var>

As you can see it has prerequisites (which in this case are if it is not a unique planet) 


Now you could have something like this (I just altered some existing code so no guarantee it will work)


<Var VarName="$HomeStarSystems">
    <From 
Source="$Constellations.$StarSystems">
        <Where>
            <PathPrerequisite 
Flags="Prerequisite">MajorHomeSystem</PathPrerequisite>
        </Where>
    </From>
</Var>

<!-- Among those Systems, take at least 1 Planet-->

<Var 
VarName="$SpawnPlanets">
    <From 
Source="$HomeStarSystems.$AnyPlanet"/>
</Var>

Which should in theory be filled with planets that are in an original capital system.

Other things are possible but if you want a specific example you will need to say what it is you want first.


0Send private message
7 years ago
Oct 6, 2018, 8:55:58 PM

OK, great.  So it looks to me like the 'Var' defines the criteria for the planet selection.  Now let's say I want to restrict that selection to a constellation type (maybe the anomaly will compliment or counteract the constellation bonus).  Could I limit it to constellations with a food bonus?  I tried adding this:



<Var VarName="$Constellations">
        <Randomize>
          <From Source="$Constellations">
            <Where>
              <PathPrerequisite Flags="Prerequisite" Inverted="true">ClassConstellation,ClassConstellationBonusTest1</PathPrerequisite>
            </Where>
          </From>
        </Randomize>
      </Var>


Which doesn't work.  Is there a way to do this?


0Send private message
0Send private message
7 years ago
Oct 8, 2018, 10:47:50 AM

Hey folks,


This kind of prerequisite is unfortunately impossible:

Constellations are no Simulation objects, and thus cannot be used in PathPrerequisites, and their use is very limited in an InterpreterPrerequisite.

Also, I don't think the quest system has access to Constellation bonuses at all, since we don't need/use it in the vanilla version of the game.

0Send private message
0Send private message
7 years ago
Nov 13, 2018, 7:40:03 AM

Hey guys,
i recently started mooding endless space myself and i was following this conversation.

I am trying to write a mod myself to create a specific anomaly on the startplanet  (custom race). So far nothing worked so maybe you can help me out.

1. How do i have to define the var to make the quest pick the homestar of the human player only?
2. What would be a good condition to have the quest start right away at the begin of a game?


bonus question: ok since we are using quest to mod things that are otherwise not changeable,
do you think it is possible to create a quest which would repair the destroyed Harrow Planet of the Academy? it always bugged me that you can not repair it.
Since its unique and the startype is set to destroyed i think i had the idea to change it via a quest after reading this? Do you think this would be possible?

0Send private message
7 years ago
Nov 13, 2018, 9:06:11 AM

Hey,


I'm not a mod-person, but quests are my thing!


To get anyone's Home System, you should use these variables (or merge them into one, but having both of them is often useful):

        <Var VarName="$CurrentEmpire">

                <From Source="$Empire"/>

        </Var>

        <Var VarName="$MyHomeSystem">

                <From Source="$CurrentEmpire.$HomeColonizedStarSystem"/>

        </Var>

Then if you want to be sure the AI will never execute your quest (so it's only done for human players), add a line between the <Objective Name="YourName"> and <Sequence> lines:

        <AIHint Category="Minimal" AutoResolutionProbability="0"/>


To have the quest start right when the game starts, make sure you have MinimumTurn="1" added in the QuestDefinition line, as well as using the BeginTurn tag. Bonus, considering the way you plan to use your quest, I suggest you add both tags <Tags>Hidden,BeginTurn</Tags>.

0Send private message
0Send private message
7 years ago
Nov 17, 2018, 1:24:46 AM

Hey Oriolie,


Thanks for the info.

Slightly related to the topic, say I wanted to spawn an Anomaly on Auriga, how would I get the right var (I'm totally not familiar with the quest scripting language).

Would it be something like :



<Var VarName="$Auriga">
    <From Source="$ConstellationsSystems.$AnyPlanet">
        <Where>
            <PathPrerequisite Flags="Prerequisite" Inverted="true">UniquePlanetAuriga</PathPrerequisite>
        </Where>
    </From>
</Var>

0Send private message
6 years ago
Nov 19, 2018, 10:56:28 AM

Careful with Inverted="true", here you're basically asking to get every planet except from Auriga :p


I would reword it as follows:

            <Var VarName="$Auriga">

                  <From Source="$Constellations.$StarSystems.$Planets">

                        <Where>

                            <PathPrerequisite Flags="Prerequisite">UniquePlanetAuriga</PathPrerequisite>

                        </Where>

                  </From>

            </Var>


Basically, it reads:

- I want a variable named $Auriga

- Which could be any Planet, in any Star System, in any Constellation (yep, we write backwards)

- Provided it has the "UniquePlanetAuriga" tag


Edit: This also means that, if you have multiple Auriga spawned in your galaxy (not happening in the game, but it is possible with a custom quest), the variable $Auriga will contain all of them. If you want to be sure the variable contains only one planet, you can add <Any> between the first and second line, just before the <From[...]> (and close it after the </From>).

Updated 6 years ago.
0Send private message
6 years ago
Nov 19, 2018, 7:40:50 PM

Oops, copy pasted something else and didn't see the inverted flag.

Thanks for the answer!


By the way, is there any resource about quest making you could share with the modding community? I'm assuming you guys at least have some documentation internally, could this be made available for modders?

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

Hey Kuma,


As much as we'd love to share our internal documentation with you, the long and short of it is simply that quest-making is taught through a fairly long onboarding process involving Amplitude's best and brightest. In other words, it's transmitted from designer to designer and there's little in the way of actual documentation. If you do have a specific question, though, I'd be happy to help!

0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message