Compatible Companion Mod Creation/At The Gates

From Dragon Age Toolset Wiki
Jump to: navigation, search

The At The Gates step explains how to make your custom companion available for the final assault on Denerim and the Archdemon.

Valeria at the gates in the climax

In the climax, you get a last chance to switch your party, where everyone parades in front of you. Well... the right behavior is to first talk to Riordan, he opens the partypicker, you may choose whom you want and then the parade begins.

Once you close the partypicker, Valeria will speak before/or after everyone else is done, so it runs smoothly. Now since many mods might mess up the partypicker (by not including certain chars), you might have Valeria not showing up. At this stage you won't be allowed to use the dialog option any more, to get her to join.

You could be intrusive here and force her in the partypicker, but if everyone does it we're in trouble. So I don't recommend it (I did finally implement it this way recently). But, it is best to handle partypicker compatibility by including all waypoints for all NPC's in the char_stage.

What we need

The plot clipt_main contains the important flag CLI_MAIN_PC_FINISHED_SETTING_FINAL_PARTY, and as it says, it becomes true when the PC is done setting the final party. So, create in the VALERIA_NPC_HIRE plot the flag VALERIA_CLI_MAIN_PC_FINISHED_SETTING_FINAL_PARTY, so we do this only once.

To implement

In includes, add:

#include "plt_clipt_main"

In the function check_plot_changed() add:

    //valeria at the gates
    if   (WR_GetPlotFlag(PLT_CLIPT_MAIN,CLI_MAIN_PC_FINISHED_SETTING_FINAL_PARTY)  &&  !WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_CLI_MAIN_PC_FINISHED_SETTING_FINAL_PARTY))
    {
        //the next 4 lines takes care of her, regardless of whether you added 
        //her to the party. this way she will show up when your companions
        //defend the gate, choose another location of course
        location ValeriaLoc;
        object curArea=GetArea(oPC);
        ValeriaLoc=Location(curArea, Vector(123.24, 717.48, 0.0), -64.92);
        AddCommand(oVal, CommandJumpToLocation(ValeriaLoc));
 
        WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_CLI_MAIN_PC_FINISHED_SETTING_FINAL_PARTY,TRUE);
        if(WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE, PARTY_VALERIA_IN_PARTY))
        {
            //this flag is important for the slideshow at the end
            WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_FIGHTING_ARCHDEMON,TRUE);
            WR_SetFollowerState(oVal, FOLLOWER_STATE_ACTIVE);
            SetLocalInt(oVal, CREATURE_REWARD_FLAGS, 0);  //Allows the follower to gain XP
        }
 
        if(!WR_GetPlotFlag(PLT_VALERIA_NPC_HIRE, PARTY_VALERIA_IN_PARTY))
        {
            WR_SetPlotFlag(PLT_VALERIA_NPC_HIRE,VALERIA_FIGHTING_ARCHDEMON,FALSE);
            WR_SetFollowerState(oVal, FOLLOWER_STATE_AVAILABLE);
        }
 
        SetObjectActive(oVal,1);
        UT_Talk(oVal,oPC);
    }

Changing the Valeria dialog appropriately: valeria_npc.dlg

Use the flag here, and depending on whether the PC added Valeria to the party, follow a different path.

Gates1.JPG

She complains if she wasn't selected to fight the archdemon, and she has every right.

Gates2.JPG

End Game Slideshow Compatible Companion Mod Creation Companion Initiated Conversation