• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days (this includes any time you see the message "account suspended"). For more updates please see here.

Template narrative story mod

adarel

Chieftain
Joined
Nov 12, 2001
Messages
12
Location
Traverse City, Michigan, USA
Hi everyone, this is a simple template for a narrative pop-up.


1739062016859.png


As in the other templates here, I declare the files to import to update the database in the .modinfo file:

Code:
<?xml version="1.0" encoding="utf-8"?>
<Mod id="ada-narrative-test" version="1"
    xmlns="ModInfo">
    <Properties>
        <Name>Ada's Civ7 Narrative Test</Name>
        <Description>This is a simple narrative pop-up mod</Description>
        <Authors>Adarel</Authors>
        <Package>AdaMods</Package>
    </Properties>
    <Dependencies>
        <Mod id="age-antiquity" title="LOC_MODULE_AGE_ANTIQUITY_NAME"/>
    </Dependencies>
    <ActionCriteria>
        <Criteria id="antiquity-age-current">
            <AgeInUse>AGE_ANTIQUITY</AgeInUse>
        </Criteria>
        <Criteria id="always">
            <AlwaysMet></AlwaysMet>
        </Criteria>
    </ActionCriteria>
    <ActionGroups>
        <ActionGroup id="ada-narrative-test-actions" scope="game" criteria="antiquity-age-current">
            <Actions>
                <UpdateDatabase>
                    <Item>data/ada-narrative-stories.xml</Item>
                    <Item>data/ada-narrative-stories-gameeffects.xml</Item>
                </UpdateDatabase>
                <UpdateText>
                    <Item>text/en_us/ada-test.xml</Item>
                </UpdateText>
            </Actions>
        </ActionGroup>
    </ActionGroups>
    <LocalizedText>
    </LocalizedText>
</Mod>



This particular narrative is only active in Antiquity, and requires the player to be playing Catherine and have one chariot. It pops on that initial chariot acquisition.

Code:
<?xml version="1.0" encoding="utf-8"?>
<GameEffects xmlns="GameEffects">
    <RequirementSet id="REQSET_ADA001_NARRATIVE_REQUISITE">
        <Requirement xref="REQ_STORY_LEADER_CATHERINE"/>
    </RequirementSet>
    <RequirementSet id="REQSET_ADA001_NARRATIVE">
        <Requirement xref="REQ_STORY_LEADER_CATHERINE"/>
        <Requirement type="REQUIREMENT_PLAYER_HAS_AT_LEAST_NUM_UNIT_TYPE">
            <Argument name="UnitType">UNIT_CHARIOT</Argument>
            <Argument name="Amount">1</Argument>
        </Requirement>
    </RequirementSet>
</GameEffects>

Events with options are set as "linked" and require each option to be defined as types along with the parent story.


Code:
    <Types>
        <Row Type="ADA001" Kind="KIND_NARRATIVE_STORY"/>
        <Row Type="ADA001A" Kind="KIND_NARRATIVE_STORY"/>
        <Row Type="ADA001B" Kind="KIND_NARRATIVE_STORY"/>
    </Types>

Text fields for Name/Description/Completion seem to be required (or at least standard) even when the fields are empty. For options, Description = Tooltip and will display a LOC code if no text is available.


Code:
<NarrativeStories>
        <Row NarrativeStoryType="ADA001" Name="LOC_ADA001_NAME" Description="LOC_ADA001_DESCRIPTION" Completion="LOC_ADA001_COMPLETION" StoryTitle="LOC_ADA001_STORYTITLE" Age="AGE_ANTIQUITY" Activation="REQUISITE" RequirementSetId="REQSET_ADA001_NARRATIVE" ActivationRequirementSetId="REQSET_ADA001_NARRATIVE_REQUISITE" UIActivation="STANDARD"/>
        <Row NarrativeStoryType="ADA001A" Name="LOC_ADA001A_NAME" Description="LOC_ADA001A_DESCRIPTION" Completion="LOC_ADA001A_COMPLETION" Age="AGE_ANTIQUITY" Activation="LINKED" Hidden="TRUE" RequirementSetId="Met" UIActivation="STANDARD"/>
        <Row NarrativeStoryType="ADA001B" Name="LOC_ADA001B_NAME" Description="LOC_ADA001B_DESCRIPTION" Completion="LOC_ADA001B_COMPLETION" Age="AGE_ANTIQUITY" Activation="LINKED" Hidden="TRUE" RequirementSetId="Met" UIActivation="STANDARD"/>
    </NarrativeStories>

I did not include rewards here, but examples can be found in the various narrative-stories files within the game's modules/.../data directories.

Have fun!
 

Attachments

Last edited:
Hey, new to modding, is it possible to add images to these pop-ups?

Hi Grandy, you can add the little icons before the options if that's what you mean? See below. You can't add custom images, though maybe this is something we'll get later with mod tools. In the image below, they're the production and gold symbols.

1748020707405.png


The option icons are called RewardIcons and they're declared in the *stories.xml file like below. There are many options for these icons, and you can just browse through the game files or database to see the extent.

Hope that helps!


Code:
    <NarrativeRewardIcons>
        <Row NarrativeStoryType="ADA_CATH_001A" RewardIconType="YIELD_DIPLOMACY"/>       
        <Row NarrativeStoryType="ADA_CATH_001B" RewardIconType="YIELD_PRODUCTION"/>       
        <Row NarrativeStoryType="ADA_CATH_002A" RewardIconType="QUEST"/>
        <Row NarrativeStoryType="ADA_CATH_002B" RewardIconType="QUEST"/>
        <Row NarrativeStoryType="ADA_CATH_003A" RewardIconType="PROMOTION"/>
        <Row NarrativeStoryType="ADA_CATH_003B" RewardIconType="UNIT"/>
        <Row NarrativeStoryType="ADA_CATH_004A" RewardIconType="YIELD_CULTURE"/>
        <Row NarrativeStoryType="ADA_CATH_004B" RewardIconType="YIELD_HAPPINESS"/>
        <Row NarrativeStoryType="ADA_CATH_005A" RewardIconType="YIELD_CULTURE"/>
        <Row NarrativeStoryType="ADA_CATH_005B" RewardIconType="YIELD_PRODUCTION"/>                     
    </NarrativeRewardIcons>
 
Back
Top Bottom