Jump to content

Home

KotOR II Party NPCs


Recommended Posts

So I was looking through the Ebon Hawk onenter script, figuring out how everything was set up just because. And I noticed a conditional like this:

 

        &&  GetIsAvailable(NPC_BAO_DUR)
       &&  GetIsAvailable(NPC_CANDEROUS)
       &&  (GetInfluence(NPC_BAO_DUR) > 85)

 

Now what I was wondering is this: Where are the party members defined in as NPC_BAO_DUR and such. Is it NPC.2da or some other file? (I've looked through NPC.2da and it has no reference of NPC_BAO_DUR so I don't think that's right, but, I could be wrong.)

Link to comment
Share on other sites

k_inc_glob_party.nss (If I get your question right);

 

// Will return the tag of the party member constant passed in.
// Will return 'ERROR' if an invalid constant is passed in.
string GetNPCTag( int nNPC )
{
   switch( nNPC )
   {
       case  NPC_ATTON:
       {
           return "atton";
       }break;
       case  NPC_BAO_DUR:
       {
           return "baodur";
       }break;
       case  NPC_CANDEROUS:
       {
           return "mand";
       }break;
       case  NPC_DISCIPLE:
       {
           return "disciple";
       }break;
       case  NPC_G0T0:
       {
           return "g0t0";
       }break;
       case  NPC_HANDMAIDEN:
       {
           return "handmaiden";
       }break;
       case  NPC_HANHARR:
       {
           return "hanharr";
       }break;
       case  NPC_HK_47:
       {
           return "hk47";
       }break;
       case  NPC_KREIA:
       {
           return "kreia";
       }break;
       case  NPC_MIRA:
       {
           return "mira";
       }break;
       case  NPC_T3_M4:
       {
           return "t3m4";
       }break;
       case  NPC_VISAS:
       {
           return "visasmarr";
       }break;
   }
   return "ERROR";
}

Link to comment
Share on other sites

It's in NWScript:

int NPC_PLAYER          =-1;
int NPC_ATTON           = 0;
int NPC_BAO_DUR         = 1;
int NPC_CANDEROUS       = 2;
int NPC_G0T0            = 3;
int NPC_HANDMAIDEN      = 4;
int NPC_HK_47           = 5;
int NPC_KREIA           = 6;
int NPC_MIRA            = 7;
int NPC_T3_M4           = 8;
int NPC_VISAS           = 9;
int NPC_HANHARR          = 10;
int NPC_DISCIPLE        = 11;

int PUP_SENSORBALL      = 0;
int PUP_OTHER1          = 1;
int PUP_OTHER2          = 2;

 

You can't change the name but you can use the integers rather than typing out the name.

Link to comment
Share on other sites

k_inc_glob_party.nss (If I get your question right);

 

// Will return the tag of the party member constant passed in.
// Will return 'ERROR' if an invalid constant is passed in.
string GetNPCTag( int nNPC )
{
   switch( nNPC )
   {
       case  NPC_ATTON:
       {
           return "atton";
       }break;
       case  NPC_BAO_DUR:
       {
           return "baodur";
       }break;
       case  NPC_CANDEROUS:
       {
           return "mand";
       }break;
       case  NPC_DISCIPLE:
       {
           return "disciple";
       }break;
       case  NPC_G0T0:
       {
           return "g0t0";
       }break;
       case  NPC_HANDMAIDEN:
       {
           return "handmaiden";
       }break;
       case  NPC_HANHARR:
       {
           return "hanharr";
       }break;
       case  NPC_HK_47:
       {
           return "hk47";
       }break;
       case  NPC_KREIA:
       {
           return "kreia";
       }break;
       case  NPC_MIRA:
       {
           return "mira";
       }break;
       case  NPC_T3_M4:
       {
           return "t3m4";
       }break;
       case  NPC_VISAS:
       {
           return "visasmarr";
       }break;
   }
   return "ERROR";
}

 

It's in NWScript:

int NPC_PLAYER          =-1;
int NPC_ATTON           = 0;
int NPC_BAO_DUR         = 1;
int NPC_CANDEROUS       = 2;
int NPC_G0T0            = 3;
int NPC_HANDMAIDEN      = 4;
int NPC_HK_47           = 5;
int NPC_KREIA           = 6;
int NPC_MIRA            = 7;
int NPC_T3_M4           = 8;
int NPC_VISAS           = 9;
int NPC_HANHARR          = 10;
int NPC_DISCIPLE        = 11;

int PUP_SENSORBALL      = 0;
int PUP_OTHER1          = 1;
int PUP_OTHER2          = 2;

 

You can't change the name but you can use the integers rather than typing out the name.

 

Huh, okay. So if I were to add a party member would I be able to add a custom NPC_(CHARACTERNAME) thing, or would I check if he/she was in the party through some other means?

Link to comment
Share on other sites

Huh, okay. So if I were to add a party member would I be able to add a custom NPC_(CHARACTERNAME) thing, or would I check if he/she was in the party through some other means?

In theory, if you defined something like

int NPC_FALLEN_GUARDIAN = 3;

at the top of your script, you could keep referring to them as such, yes. You'd have to put it in every script, though. I prefer to just remember the numbers, but that's just what it is - a matter of preference. The integers are what matter; they're hard coded into the game. That's why we can't add new party members, only replace them. It's possible to have the player, all twelve party members, and all three puppets, all at the same time... things might be a little screwy, but it is possible because they're all individually defined in NWScript. If Mira and Hannharr or the Disciple and the Handmaiden shared integers, you wouldn't be able to do that.

 

Actually a thought occurs... as far as I know the GUI isn't entirely hard coded, so it's possible the issues I mentioned could be resolved. Not really my area... but I might look into it.

 

You can read more here about my silly exploits into the matter.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...