So I want to make a NCP join my party after a dialog and I'm trying to make the right script to do so. Looking through the story editor, I found several commands(?) that seems they should do the job, but none of them was accepted for a built.

I tried the following scripts.

IF
DialogEnded("NPC_Roylin",_)
THEN
CharacterAddToParty(e3366c01-766f-43a7-86a5-e2e877c1dfe5);

IF
DialogEnded("NPC_Roylin",_)
THEN
CharacterMakeCompanion(e3366c01-766f-43a7-86a5-e2e877c1dfe5)

I'm not sure what the PROC statement do, I'm guessing it means something like "Just do this, no IF's"
So the idea for the code below was to add a local flag to the 3 end nodes of the dialog that the NPC was (she is meant to join on all of them) and then all 3 nodes will force her to join my party.

PROC
DialogGetLocalFlag(9492ea15-ddab-4f4a-b255-03a362d60a5a,53fd350f-288d-4c43-92e6-81e8678df82b,53fd350f-288d-4c43-92e6-81e8678df82b(CharacterMakeCompanion(e3366c01-766f-43a7-86a5-e2e877c1dfe5))


Is this totally wrong or am I on the right track?