Dev assistance request- GameEvents.xml

Please post here for questions and discussion about data, event, art and sound modding and the game editor for Distant Worlds.

Moderator: MOD_DW2

Post Reply
User avatar
iancmtaylor
Posts: 181
Joined: Wed May 09, 2012 6:38 pm

Dev assistance request- GameEvents.xml

Post 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.
I am /u/SharkMolester, moderator of /r/DistantWorlds and BFHKitteh, admin of https://dw2.fandom.com/wiki/Distant_Worlds_2_Wiki.
User avatar
frankycl
Posts: 402
Joined: Mon Mar 01, 2021 5:16 pm

Re: Dev assistance request- GameEvents.xml

Post 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) ;)
Post Reply

Return to “Design and Modding”