Jump to content

Home

Help Giveing NPCs Presige Classes


Keiko

Recommended Posts

Hello world, I am having some difficultty adding NPCs Presige Classes, I have been looking at a_pc_jedi.nss, and it shows this:

 

void main()

{

// Grab the Parameter.

int nScriptNumber = GetScriptParameter( 1 );

 

Shortend for length

 

 

Ok so now we have that, but how do I get my NPCs to Prestige Classes?

 

Say I wanted to have my NPC to be a Jedi Master, would i COPY AND PASTE this:

 

// If Param = 2, then make him a Jedi Master.

if ( nScriptNumber == 2 ) {

AddMultiClass (CLASS_TYPE_JEDIMASTER, GetFirstPC () );

}

 

Please help me out!:mad: :mad:

Link to comment
Share on other sites

Originally posted by DarthSmallz

Hello world, I am having some difficultty adding NPCs Presige Classes, I have been looking at a_pc_jedi.nss, and it shows this:

 

void main()

{

// Grab the Parameter.

int nScriptNumber = GetScriptParameter( 1 );

 

Shortend for length

 

 

Ok so now we have that, but how do I get my NPCs to Prestige Classes?

 

Say I wanted to have my NPC to be a Jedi Master, would i COPY AND PASTE this:

 

// If Param = 2, then make him a Jedi Master.

if ( nScriptNumber == 2 ) {

AddMultiClass (CLASS_TYPE_JEDIMASTER, GetFirstPC () );

}

 

Please help me out!:mad: :mad:

 

The getFirstPC i marked in italics specify that the class should be giving to the PC. try making a script like this

(this is only gonna work for one npc. not all)

 

object oNPC=GetObjectByTag("Atton")

if ( nScriptNumber == 2 ) {

AddMultiClass (CLASS_TYPE_JEDIMASTER, oNPC() );

}

Link to comment
Share on other sites

Originally posted by DarthSmallz

Hello world, I am having some difficultty adding NPCs Presige Classes, I have been looking at a_pc_jedi.nss, and it shows this:

(snip)

 

Assuming you intend to use the script from a dialog, this would probably work:

 

#include "k_inc_glob_party"

void main() {
   int nNPC = GetScriptParameter(1);
   int nClass = GetScriptParameter(2);

   object oNPC = GetObjectByTag(GetNPCTag(nNPC));
   if (GetIsObjectValid(oNPC) 
       && (nClass >= CLASS_TYPE_SOLDIER) 
       && (nClass <= CLASS_TYPE_SITHASSASSIN)
       && (GetClassByPosition(1, oNPC) != nClass)
       && (GetClassByPosition(2, oNPC) == CLASS_TYPE_INVALID))
   {
       AddMultiClass(nClass, oNPC);   
   }
}

 

Set the first parameter (P1) on the dialog node to the number of the party slot the NPC in question occupies, valid values are:

 

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

 

Then set the second parameter (P2) on the dialog node to the number representing the class you wish to grant the NPC, valid values are:

 

CLASS_TYPE_SOLDIER           = 0
CLASS_TYPE_SCOUT             = 1
CLASS_TYPE_SCOUNDREL         = 2
CLASS_TYPE_JEDIGUARDIAN      = 3
CLASS_TYPE_JEDICONSULAR      = 4
CLASS_TYPE_JEDISENTINEL      = 5
CLASS_TYPE_COMBATDROID       = 6
CLASS_TYPE_EXPERTDROID       = 7
CLASS_TYPE_TECHSPECIALIST    = 9
CLASS_TYPE_JEDIWEAPONMASTER  = 11
CLASS_TYPE_JEDIMASTER        = 12
CLASS_TYPE_JEDIWATCHMAN      = 13
CLASS_TYPE_SITHMARAUDER      = 14
CLASS_TYPE_SITHLORD          = 15
CLASS_TYPE_SITHASSASSIN      = 16

 

So, for example, if you want the creature occupying G0T0s party slot to become a Jedi Weapon Master, you'd set P1 to 3 and P2 to 11.

 

(Disclaimer: I just wrote this, so while it compiles it is untested in-game. Can't see why it shouldn't work though.)

Link to comment
Share on other sites

FYI I have a mod for making the Jedi trainable characters Prestige classes (though my site is down right now). The point is this: when I was makin this mod I tried making it so that you can get Visas and Kreia up to Prestige classes as well and there are a lot of crash bugs surrounding this. The game can (for some reason) handle making Bao Dur a Jedi Guardian, then a Jedi Weapon Master, then a Jedi Watchman, then a Consular, then a Weapon Master, but if you go back and make him any one of those classes again it crashes. Likewise if you just try making Visas a Watchman or Assassin in game you may encounter an immediate crash.

 

Also, despite what the comments in the code says, KotOR 2 *can't* handle 3 classes per character - only two.

Link to comment
Share on other sites

Originally posted by SuperSquall

The game can (for some reason) handle making Bao Dur a Jedi Guardian, then a Jedi Weapon Master, then a Jedi Watchman, then a Consular, then a Weapon Master, but if you go back and make him any one of those classes again it crashes.

 

In the same game? Ie you assign a multiclass and then replace it into another? I'm surprised it even works that well, concidering that Bioware or Obsidian never replace an existing class, they only add on a new one.

 

(Thus in the code example in the post above I check if a second class has already been assigned and make the script do nothing if that is the case.)

 

 

Originally posted by SuperSquall

Likewise if you just try making Visas a Watchman or Assassin in game you may encounter an immediate crash.

 

Odd, never had any problems with that. Visas automatically becomes a Jedi Watchman when she reaches level 15 in my game, and I've never noticed any crashes or problems with that so far, and I did that modification a month ago.

 

 

Originally posted by SuperSquall

Also, despite what the comments in the code says, KotOR 2 *can't* handle 3 classes per character - only two.

 

That comment is likely some leftover junk in the code from Neverwinter Nights, where you could have 3 classes in a multiclass. Only class index 1 and 2 are used/valid in the KotOR games. The GUI has no room to show any more in any case. :)

Link to comment
Share on other sites

Originally posted by stoffe -mkb-

In the same game? Ie you assign a multiclass and then replace it into another? I'm surprised it even works that well, concidering that Bioware or Obsidian never replace an existing class, they only add on a new one.

Yeah it looks like the addMultiClass method just sets a new class to class slot "2" and so you can change it as long as you don't double up.

 

Odd, never had any problems with that. Visas automatically becomes a Jedi Watchman when she reaches level 15 in my game, and I've never noticed any crashes or problems with that so far, and I did that modification a month ago.
Might be the method you called, how did you code it?

 

That comment is likely some leftover junk in the code from Neverwinter Nights, where you could have 3 classes in a multiclass. Only class index 1 and 2 are used/valid in the KotOR games. The GUI has no room to show any more in any case. :)
Yeah that's my reasoning as well - though I thought the game might still support three classes even if the GUI couldn't show it. Turns out it isn't quite like that :p
Link to comment
Share on other sites

Originally posted by SuperSquall

(...multiclassing visas to watchman...)

Might be the method you called, how did you code it?

(snip)

 

Nothing special, this is the relevant part that multiclass her. Haven't caused any trouble yet:

 

object oVisas = GetObjectByTag(GetNPCTag(NPC_VISAS));
if (GetIsObjectValid(oVisas) 
   && (GetHitDice(oVisas) > 14) 
   && (GetClassByPosition(2, oVisas) == CLASS_TYPE_INVALID )) 
{
   AddMultiClass( CLASS_TYPE_JEDIWATCHMAN, oVisas );
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...