What script do you use for adding companions?

what script do you use for adding companions?
how to add npc to your group as a companion?
As example of an original nvn2 campaign.
here is what i use
I use script
this way use authors(Shrouded Sun)
then i create conservation and add script

what other ways you know?
what scripts do you use and why?
Thank you very much in advance!

1 Like

I don’t remember where I found this, but I’ve always used a script called ga_roster_companion looking like this, when recruiting companions:

Adds a Companion NPC and sets their XP equal to the PC's if they
are below. This script merges four scripts together so that you
don't have to setup all four script calls in a conversation.

This script also has a convention: the RosterName is the same as
the creature's TAG, resref, etc. They should all be named
the same.
#include "ginc_param_const"
#include "ginc_debug"
#include "ginc_misc"

void main(string sCompanionTag)
//FROM: ga_roster_add_object
//Adds a NPC to the global roster of NPCs available to be added to
//a player's party. Roster Name is a 10-character name used to
//reference that NPC in other Roster related functions.
//The NPC will be left in the game world, but will now exist
//in the roster as well.

object oCompanion = GetObjectByTag(sCompanionTag);
int bResult = AddRosterMemberByCharacter(sCompanionTag, oCompanion);

//FROM: ga_roster_selectable
SetIsRosterMemberSelectable(sCompanionTag, 1);

//FROM: ga_roster_party_add
object oPC = GetFirstPC();
AddRosterMemberToParty(sCompanionTag, oPC);

int nXP = GetPCAverageXP();
SetXP(oCompanion, nXP);

And then I of course use all the gb scripts you showed here on the companions themselves.

Edit: The thing that is good with this script is that you don’t need three separate scripts like you showed in your screenshot, only one.


Many thanks!
It will help everyone a lot!

1 Like