Page 1 of 1

Dev assistance request- GameEvents.xml

Posted: Sat Mar 25, 2023 1:26 am
by iancmtaylor
Trying to create an event that fires when a tech is researched, would popup as a choice event, unlocking one of two techs.

Tried just using the pdf guide for modding events, helpful.

Tried for several hours, all sorts of minor variations and different axioms to approach the syntax, but I just couldn't crack it. I can just keep running in circles forever so I'm just going to ask for assistance.

Code: Select all

  <GameEvent>
    <Name>teste</Name>
    <GroupName />
    <Title>hi</Title>
    <Description>bye</Description>
    <ImageFilepath />
    <MusicFilepath />
    <TriggerType>ResearchBreakthrough</TriggerType>
    <TriggerResearchProjectId>0</TriggerResearchProjectId>
    <TriggerPriority>0</TriggerPriority>
    <TriggerRaceId>-1</TriggerRaceId>
    <AllConditionsMustBeMet>true</AllConditionsMustBeMet>
    <PlacementAtGameStart>false</PlacementAtGameStart>
    <PlacementRaceId>-1</PlacementRaceId>
    <PlacementActions />
    <TriggerActionsAreChoices>true</TriggerActionsAreChoices>
    <SuppressTriggerDescriptions>true</SuppressTriggerDescriptions>
    <TriggerActions>
      <GameEventAction>
        <Type>ResearchBreakthrough</Type>
        <Id1>2</Id1>
        <MessageTitle />
        <Description />
        <ImageFilepath />
        <MusicFilepath />
        <ActionLocationHint>SameLocationAsEvent</ActionLocationHint>
        <ActionLocationShouldBeFuelSource>false</ActionLocationShouldBeFuelSource>
        <ActionLocationItemName />
        <Value1>-1</Value1>
        <Value2>-1</Value2>
        <ChoiceButtonText>Obtain Tech Breakthrough</ChoiceButtonText>
        <GeneratedItemName />
        <AllConditionsMustBeMet>true</AllConditionsMustBeMet>
        <DelaySecondsMinimum>0</DelaySecondsMinimum>
        <DelaySecondsMaximum>0</DelaySecondsMaximum>
        <ActionObjectId>0</ActionObjectId>
      </GameEventAction>
      <GameEventAction>
        <Type>ResearchBreakthrough</Type>
        <Id1>3</Id1>
        <MessageTitle />
        <Description />
        <ImageFilepath />
        <MusicFilepath />
        <ActionLocationHint>SameLocationAsEvent</ActionLocationHint>
        <ActionLocationShouldBeFuelSource>false</ActionLocationShouldBeFuelSource>
        <ActionLocationItemName />
        <Value1>-1</Value1>
        <Value2>-1</Value2>
        <ChoiceButtonText>Obtain Tech Breakthrough</ChoiceButtonText>
        <GeneratedItemName />
        <AllConditionsMustBeMet>true</AllConditionsMustBeMet>
        <DelaySecondsMinimum>0</DelaySecondsMinimum>
        <DelaySecondsMaximum>0</DelaySecondsMaximum>
        <ActionObjectId>0</ActionObjectId>
      </GameEventAction>
    </TriggerActions>
  </GameEvent>
This was the last attempt I made.

Re: Dev assistance request- GameEvents.xml

Posted: Sat Mar 25, 2023 8:45 am
by frankycl
iancmtaylor wrote: Sat Mar 25, 2023 1:26 am Trying to create an event that fires when a tech is researched, would popup as a choice event, unlocking one of two techs.

Tried just using the pdf guide for modding events, helpful.

Tried for several hours, all sorts of minor variations and different axioms to approach the syntax, but I just couldn't crack it. I can just keep running in circles forever so I'm just going to ask for assistance.

Code: Select all

  <GameEvent>
    <Name>teste</Name>
    <GroupName />
    <Title>hi</Title>
    <Description>bye</Description>
    <ImageFilepath />
    <MusicFilepath />
    <TriggerType>ResearchBreakthrough</TriggerType>
    <TriggerResearchProjectId>0</TriggerResearchProjectId>
    <TriggerPriority>0</TriggerPriority>
    <TriggerRaceId>-1</TriggerRaceId>
    <AllConditionsMustBeMet>true</AllConditionsMustBeMet>
    <PlacementAtGameStart>false</PlacementAtGameStart>
    <PlacementRaceId>-1</PlacementRaceId>
    <PlacementActions />
    <TriggerActionsAreChoices>true</TriggerActionsAreChoices>
    <SuppressTriggerDescriptions>true</SuppressTriggerDescriptions>
    <TriggerActions>
      <GameEventAction>
        <Type>ResearchBreakthrough</Type>
        <Id1>2</Id1>
        <MessageTitle />
        <Description />
        <ImageFilepath />
        <MusicFilepath />
        <ActionLocationHint>SameLocationAsEvent</ActionLocationHint>
        <ActionLocationShouldBeFuelSource>false</ActionLocationShouldBeFuelSource>
        <ActionLocationItemName />
        <Value1>-1</Value1>
        <Value2>-1</Value2>
        <ChoiceButtonText>Obtain Tech Breakthrough</ChoiceButtonText>
        <GeneratedItemName />
        <AllConditionsMustBeMet>true</AllConditionsMustBeMet>
        <DelaySecondsMinimum>0</DelaySecondsMinimum>
        <DelaySecondsMaximum>0</DelaySecondsMaximum>
        <ActionObjectId>0</ActionObjectId>
      </GameEventAction>
      <GameEventAction>
        <Type>ResearchBreakthrough</Type>
        <Id1>3</Id1>
        <MessageTitle />
        <Description />
        <ImageFilepath />
        <MusicFilepath />
        <ActionLocationHint>SameLocationAsEvent</ActionLocationHint>
        <ActionLocationShouldBeFuelSource>false</ActionLocationShouldBeFuelSource>
        <ActionLocationItemName />
        <Value1>-1</Value1>
        <Value2>-1</Value2>
        <ChoiceButtonText>Obtain Tech Breakthrough</ChoiceButtonText>
        <GeneratedItemName />
        <AllConditionsMustBeMet>true</AllConditionsMustBeMet>
        <DelaySecondsMinimum>0</DelaySecondsMinimum>
        <DelaySecondsMaximum>0</DelaySecondsMaximum>
        <ActionObjectId>0</ActionObjectId>
      </GameEventAction>
    </TriggerActions>
  </GameEvent>
This was the last attempt I made.
Haven't gone through all of this yet, but on first sight I'd say you need "<PlacementAtGameStart>TRUE, or another (placement-) event that is activated/placed at game-start (= placement-actions defined) and that is linked to your event. (at least that's how the events in the GameEvents.xml work) ;)