Aller au contenu

Photo

Adding companions to party


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Premier2k

Premier2k
  • Members
  • 17 messages
Hi all,

I'm trying to add a companion to my party. I have the following for scripts set up in the actions node of the conversation;

ga_roster_add_object
ga_roster_selectable
ga_roster_party_add
ga_reset_level

I got this from: http://www.nwn2tools.../companion.html

The companion gets added ok, but he won't follow my PC. If I switch and use him as the lead then my PC follows fine. He doesn't appear to attack either from what I can see. I've tried broadcasting commands to him but to no avail.

I have checked his default scripts and he has none listed which I'm pretty sure is the problem. How do I know which scripts go into which event?
I've had a look around for some tutorials on this but nothing seems to fit what I'm after.

Premier2k

#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
When you create a blueprint that you want to be a companion, you have to put the companion scripts in the event fields on the property tabs. The easy way to do this is to go to the top of the blueprints secion, choose import, and import the companion scripts. If you have troubles finding the right scripts, just look at neeshka or Khelgar's scripts to see what I mean.

#3
Premier2k

Premier2k
  • Members
  • 17 messages
OK, thanks again M. Rieder

#4
Morbane

Morbane
  • Members
  • 1 883 messages
If your companions dont have the behaviour scripts they wont really do much of anything with out player control.

#5
Morbane

Morbane
  • Members
  • 1 883 messages
//ga_super_add
#include "ginc_param_const"
#include "ginc_debug"
#include "ginc_misc"

void main(string sRoster_Name, int bSelectable = 1)
{
//ga_roster_add_object
object oCharacter = GetTarget(sRoster_Name, TARGET_OWNER);
int bResult = AddRosterMemberByCharacter(sRoster_Name, oCharacter);

//ga_roster_selectable
bResult = SetIsRosterMemberSelectable(sRoster_Name, bSelectable);

//ga_roster_party_add
object oPC = (GetPCSpeaker()==OBJECT_INVALID?OBJECT_SELF:GetPCSpeaker());
bResult = AddRosterMemberToParty(sRoster_Name, oPC);

//ga_reset_level
object oCreature = GetObjectByTag( sRoster_Name );

int nXP = GetPCAverageXP();
SetXP(oCharacter, nXP);
ForceRest( oCreature );

}

This will simplify the conversation ga_* scripts as this will be the only one you need