Logo Platform
logo amplifiers simplified

Unexpected End of File

Reply
Copied to clipboard!
4 years ago
May 3, 2021, 4:43:53 PM

Greetings, gentlemen. I come here out of utter desperation, and humbly beg for your help.


Making an attempt at testing my first quest, I crash on the game refusing to load the quest definition file. It keeps CTDing and telling about "Unexpected End of File", "current depth is 1 line 99 position 20". Such line, in Notepad++, happens to be where "</QuestDefinition>" is.


I've checked every one and single line, to no avail. Also, external file checking has not found any errors. Here's the alleged culprit:


<Datatable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="../Schemas/QuestDefinition.xsd">


<!--A FAITH IN CRISIS, POPULATION TYPE-->

    

    <!--Category: appears in GUI in Narrative Screen-->

    <!--ChanceOfTriggering: Random on Quest triggering-->

    <!--MinimumTurn: Minimum turn of appearence-->

    <QuestDefinition Name="FaithInCrisis01" Category="PopulationQuest" SubCategory="Population" MinimumTurn="50" ChanceOfTriggering="0.25">

    <!--Categories seem arbitrary, perhaps can be checked as conditions somehow-->

    <!--ChanceOfTriggering seems to apply every turn from minimum on-->

    <!--There's a "CheckRandom" boolean, seems to indicate a random event, along with a "TriggeringProbability" float-->

    

        <!--TAGS-->

    

        <Tags>BeginTurn</Tags>

        <!--Tags seem arbitrary, perhaps can be checked as conditions-->

    

        <QuestContextSolo/>

        <RepetitionRules NumberOfOccurrencesPerGame="0" NumberOfOccurrencesPerEmpire="1" NumberOfConcurrentInstances="0"></RepetitionRules>

    

        <!--VARIABLES-->

    

        <!--Variables are not just declared, are initilialized according to given arguments if desired-->

        <!--can they work as triggers if no suitable candidate for a var is found?-->

        

        <Vars>

            <!--empire-->

            <Var VarName="$TargetEmpire">

                <From Source="$Empire"/>

            </Var>

            <!--system-->

            <Var VarName="$ReligiousSystem01">

                <Any>

                    <From Source="$TargetEmpire.$ColonizedStarSystems">

                        <Where>

                            <InterpreterPrerequisite Flags="Prerequisite">Property(Context,@'ClassColonizedStarSystem',Happiness) lt 50</InterpreterPrerequisite><!--not happy-->

                            <InterpreterPrerequisite Flags="Prerequisite">Property(Context,@'//ClassPopulation,ClassPopulationStarSystem',PoliticsTrend05) ge 1</InterpreterPrerequisite><!--any pop there is religious-->

                        </Where>

                    </From>

                </Any>

            </Var>

            <Var VarName="$HappinessTarget" IntValue="75"/><!--happiness to reach-->

            <!--time for completion-->

            <Var VarName="$Timer"/>

            <InterpretedVar VarName="$Duration" Target="$(Empire)">

                <Expression>Property(Context, @../ClassEmpire, GameSpeedMultiplier, true)*8</Expression>

            </InterpretedVar>

            <!--localization-->

            <LocalizationVar LocalizationKey="$SystemName" Source="$ReligiousSystem01"/>

            <LocalizationVar LocalizationKey="$HappinessAmount" Source="$HappinessTarget"/>

        </Vars>

        

        <!--PREREQUISITES-->

        <!--simulation descriptors are checked through path, properties as interpreted-->

        

        <Prerequisites Target="$(Empire)">

            <InterpreterPrerequisite Flags="Prerequisite">Count(Context, @'ClassEmpire/ColonizedStarSystemStateColony') ge 1</InterpreterPrerequisite>

        </Prerequisites>

        

        <!--ACTIONS-->

        

        <Steps>

            <Step Name="Step1">

                <ObjectiveSet>

                <!--timer started-->

                    <StartActions>

                        <Action_StartTimer>

                            <Input_Duration VarName="$Duration"/>

                            <Output_Timer VarName="$Timer"/>

                        </Action_StartTimer>

                    </StartActions>

                    <Objective Name="Step1Objective1">

                        <!--if happiness in system is already 75-->

                        <Sequence>

                            <Decorator_BeginTurn>

                                <Condition_HasHappiness>

                                    <Input_Empire VarName="$TargetEmpire"/>

                                    <Input_System VarName="$ReligiousSystem01"/>

                                    <Input_MinimumAmount VarName="$HappinessTarget"/>

                                </Condition_HasHappiness>

                            </Decorator_BeginTurn>

                        </Sequence>

                        <!--time is out or not-->

                        <Sequence>

                            <Decorator_BeginTurn>

                                <Condition_TimerEnded>

                                    <Input_Timer VarName="$Timer"/>

                                </Condition_TimerEnded>

                            </Decorator_BeginTurn>

                            <Action_Fail/>

                        </Sequence> 

                    </Objective>

                </ObjectiveSet>

                <!--reward for completion-->

                <Reward Droplist="DroplistMinorRewards" Picks="1"/>

            </Step>

        </Steps>

    </QuestDefinition>

</Datatable>

0Send private message
4 years ago
May 4, 2021, 3:22:47 AM

"ChanceOfTriggering" isn't a valid attribute, try "TriggeringProbability" instead (assuming I spelt that correctly)


Also, add this to your line 1 (above the datatable)

<?xml version="1.0" encoding="utf-8"?>

0Send private message
4 years ago
May 4, 2021, 5:18:58 PM

It indeed was the header thing, it always is the most stupid thing you happen not to check. Many thanks.


May I abuse a little bit more of your knowledge? It's about checking if any population unit in a planet has a certain political alignment. I tried by checking the "PoliticsTrend" property in ClassPopulation, but doesn't seem to be the way. Perhaps the only way is checking for individual population races (for example, if you look for Militarist population, check directly if there are Yuushos or any other Militarist race)?


Many thanks again.

0Send private message
4 years ago
May 4, 2021, 10:40:12 PM

As far as I know, there's no way to check a specific race's political leaning, but you could do this for the entire system:

                                <Condition_HasPoliticsScore>

                                    <Input_Empire VarName="$CurrentEmpire"/>

                                    <Input_PoliticsName VarName="$PoliticsName"/>

                                    <Input_MinimumPercentage VarName="$MinimumPercentage"/>

                                    <Input_MinimumSystemAmount VarName="$MinimumSystemAmount"/>

                                </Condition_HasPoliticsScore>

Check out MinorFactionQuest16 in QuestDefinitions[MinorFaction].xml for more info.


I do know that ClassPopulationStarSystem has a "PoliticsTrend01" and such, so you could check at "ClassColonizedStarSystem/ClassPopulationStarSystem,ClassPopulationStarSystemAffinityHisshos"

Updated 4 years ago.
0Send private message
?

Click here to login

Reply
Comment