Jump to content

Home

Altering NPC weapons?


Prime

Recommended Posts

Originally posted by Darth333

Read the stickies

:xp::D

 

http://lucasforums.com/showthread.php?s=&threadid=143412

 

 

 

more classes for TSL:

CLASS_TYPE_TECHSPECIALIST

CLASS_TYPE_JEDIWEAPONMASTER

CLASS_TYPE_JEDIMASTER

CLASS_TYPE_JEDIWATCHMAN

CLASS_TYPE_SITHMARAUDER

CLASS_TYPE_SITHASSASSIN

CLASS_TYPE_SITHLORD

Thanks :) I had seen that when I did read the stickies, but I was under the impression that it only worked with the PC and party NPCs... :D

 

Originally posted by stoffe -mkb-

It would probably help to change their AI style to make them use force powers, and set them to use the Boss AI to make them use them more often:

 

SetNPCAIStyle(oCreature, NPC_AISTYLE_JEDI_SUPPORT);

SetLocalBoolean(oCreature, SW_FLAG_BOSS_AI, TRUE);

 

(The SW_FLAG_BOSS_AI global is set in k_inc_generic so you'd either need to include that file, or just copy its value from there instead.)

Cool. I'll give that a try as well...
Link to comment
Share on other sites

Originally posted by Darth333


void main ()
{
object oTarget = GetFirstObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oTarget))
    {
if(GetAppearanceType(oTarget) == "insert_appearance_here")
        {

//insert the corresponding row number from appearance.2da
ChangeObjectAppearance( oTarget, [i]int nAppearance[/i] );
        }
oTarget = GetNextObjectInArea(GetArea(OBJECT_SELF), OBJECT_TYPE_CREATURE);
    }
ExecuteScript("old_on_enter_script", GetModule()); 
}

 

I tried to use this and got and error this error:

Error: Operator (==) not valid for specified types

for this line

 if(GetAppearanceType(oTarget) == "insert_appearance_here")

 

When you say insert_appearance_here do you mean the label for the npc thats in appearance.2da

Link to comment
Share on other sites

Originally posted by T7nowhere

I tried to use this and got and error this error:

for this line

 if(GetAppearanceType(oTarget) == "insert_appearance_here")

 

When you say insert_appearance_here do you mean the label for the npc thats in appearance.2da

 

GetAppearanceType() returns an integer value, more specifically the line number of the row in appearances.2da that defines the creatures appearance.

 

Remove the "" and use a number for comparison and it should work.

 

Here's an example of it in use...

void ST_FixMalachorAppearance() {
   if ((GetModuleName() == "905MAL") || (GetModuleName() == "906MAL")) {
       switch (GetAppearanceType(OBJECT_SELF)) {
           case 405: // (Sith Lord)
               ST_FixNPCAppearance(563, "NULL");
               break; 
           case 400: // (Male Marauder)
               ST_FixNPCAppearance(162, "a_robe_09");
               break; 
           case 409: // (Female Marauder 1)
               ST_FixNPCAppearance(108, "a_robe_09");
               break; 
           case 393: // (Female Marauder 2)
               ST_FixNPCAppearance(111, "a_robe_09");
               break;                              
       }
   }
}

Link to comment
Share on other sites

Ah crap...this is what happens when I post while I don't have the files with me...

 

this should do it:

 if(GetAppearanceType(oTarget) == [i]int nAppearance[/i])

in other words, simply put the row number from appearance.2da :) like

if(GetAppearanceType(oTarget) == 600)

 

edit: stoffe -mkb- beats me :D

Link to comment
Share on other sites

Originally posted by T7nowhere

Thanks you two. :)

Indeed. I appreciate the help as well. :)

 

I now have some KOTOR 1 Dark Jedi running around Malakor with red lightsabers. I'll start playing with some force powers next...

Link to comment
Share on other sites

OK, things are coming together very nicely, but I'm still having a minor issue. I can get the baddies to use force powers, but they only seem to use either horror or insanity (less so). Do we know how they determine which force powers to? Is there a way to alter or configure this?

 

Oh, and is there a way to change the name that appears when you select a target through a script command? Not a biggy, just wondering...

Link to comment
Share on other sites

Yet another question. Does EffectDisguise do anything other than alter the appearance of the creature it is applied to? If not, would that be a better way to go than using ChangeObjectAppearance()? If it does affect the behavior, how so? Would there be any ill effects from causing some assassins to use a different disguise? I'm not completely clear about what a disguise effect really is.

Link to comment
Share on other sites

You probably already knew this....

 

In the original post you mentioned just making SOME of them have lightsabers.

 

Use the random function.

 

I think it'd be cool to give have a chance for double bladed or double weilding too.

 

To avoid lightsabers too early, you could make it dependent on character level too.

 

i.e.

 

// stuff i learned from reading beancounters hardcore code

int PC_Level = GetHitDice(GetFirstPC());

 

int nRandom = Random(100);

// must be level 10 before Lightsaber Assassins show up

if (PC_Level > 10)

{

if (n >= 10 && n < 30)

{

// 20% chance for one blade

GiveOneLightsaber();

}

else if (n > 5)

{

// 5% chance for dbl lightsaber

GiveDoubleBladedLightsaber();

}

else if (n >= 0)

{

// 5% chance for two lightsabers

GiveTwoLightsabers();

}

}

Link to comment
Share on other sites

I'll start a new thread about this mod soon since it has grown a lot from what I originally intended...

 

Originally posted by DarthSilius

You probably already knew this....

 

In the original post you mentioned just making SOME of them have lightsabers.

 

Use the random function.

Like you say, I now have it set up so that you can configure haw many of the assassins are changed.

 

Originally posted by DarthSilius

I think it'd be cool to give have a chance for double bladed or double weilding too.

I have it so that you can configure the colour and the ratio of singles to doubles and duals.

 

Originally posted by DarthSilius

To avoid lightsabers too early, you could make it dependent on character level too.

I have a check to determine whether the player has a lightsaber in their possession.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...