Compatible Companion Mod Creation/Companion Initiated Conversation

From Dragon Age Toolset Wiki
Jump to: navigation, search

The Companion Initiated Conversation step covers how to make it possible for custom companion to initiate a conversation at any point.

For example Valeria initiates a conversation if/when Wynne is killed (NOOO!!!). I love Wynne and no one should ever kill her, but if they do the char should lose approval unless it is that b... Morrigan or Zevran or etc.

What we need

Wynne could die in two places in the Circle: when you first pick her up or at Cullen.

The plot CIR000PT_MAIN contains the two important flags for this: WYNNE_KILLED and WYNNE_KILLED_AT_CULLEN. So, create in the VALERIA_NPC_HIRE plot the flags VALERIA_WYNNE_KILLED and VALERIA_WYNNE_KILLED_AT_CULLEN, so we do this only once.

To implement

In includes, add:

#include "plt_cir000pt_main"

In the function check_plot_changed() add:

    //fighting wynne
    if (WR_GetPlotFlag(PLT_CIR000PT_MAIN,WYNNE_KILLED) && !WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_WYNNE_KILLED))
    {
        if(WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE, PARTY_VALERIA_IN_PARTY))
        {
            WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_RESPONSE_TO_BAD,TRUE);
            AdjustFollowerApproval(oVal,-10,TRUE);
            UT_Talk(oVal,oPC);
            valeria_approval();
        }
        WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_WYNNE_KILLED,TRUE);
    }
    //fighting wynne
    if (WR_GetPlotFlag(PLT_CIR000PT_MAIN,WYNNE_KILLED_AT_CULLEN) && !WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_WYNNE_KILLED_AT_CULLEN))
    {
        if(WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE, PARTY_VALERIA_IN_PARTY))
        {
            WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_RESPONSE_TO_BAD,TRUE);
            AdjustFollowerApproval(oVal,-10,TRUE);
            UT_Talk(oVal,oPC);
            valeria_approval();
        }
        WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_WYNNE_KILLED_AT_CULLEN,TRUE);
    }

The flag: VALERIA_RESPONSE_TO_BAD can be used in valeria_npc.dlg as shown below. The function valeria_approval() is explained in the gift handling section.

Changes in valeria_npc.dlg

Use the flag VALERIA_RESPONSE_TO_BAD, first to enter the bad reaction node in the dialog.

Wynne1.JPG

Reset the flag

Wynne2.JPG

Depending on which situation we're in display the appropriate node (once per game). Showing what happens when Wynne is killed when first meeting her. But you should never do that...

Wynne3.JPG

At The Gates Compatible Companion Mod Creation Fort Drakon