Jump to content

Home

question about feats (TSL)


Recommended Posts

Alright, I've been fooling around with my 2da files this past week to see just what I could do with the files.

 

I came across the feats given to the Jedi Master (Lightside Enlightenment, and Inspire Followers), as well as the feats given to the Sith Lord (Darkside Corruption, and Crush Opposition). Apparently, both of them say they can't be used by the opposite alignment, although I'm just curious: Does that mean a neutral character can't use either set?

 

 

And if there is no way for a neutral character to use them, is there a script or something that can be written (still a huge n00b when it comes to scripting) to ensure that these feats can be used by anyone?

 

 

What I was planning on doing was giving these feats to Kreia as she progresses through the game, in an effort to boost her usefullness (although she already is one of my favorite characters, it would just feel more believable, being that she is the master manipulator and all, that she is able to influence everyone around her through the force).

 

 

So, does anyone know if these feats can work with Kreia? If not, any way that they can be made to work?

Link to comment
Share on other sites

That's correct a neutral character by default can't use these feats. However if you want them usable by all there should be a option I imagine in feats.2da that you would change to make them usable by all players when it comes to alignment. I'm nowhere near my home PC right now so I have no way of confirming for you.

Link to comment
Share on other sites

hmm.. I just checked the feats.2da file again, and there doesn't seem to be anything that limits a feat by alignment (or at least none that I can see).

 

 

Could it be possible that this information is located in the spells.2da file instead? I remember coming across the two sets of feats when I was going through there..

 

Edit: no, just checked the spells file as well, doesn't seem to reference anything that would restrict them due to alignment.

 

I remember reading somewhere that most feats were hardcoded for some reason, could this be the case with these ones too?

Link to comment
Share on other sites

I came across the feats given to the Jedi Master (Lightside Enlightenment, and Inspire Followers), as well as the feats given to the Sith Lord (Darkside Corruption, and Crush Opposition). Apparently, both of them say they can't be used by the opposite alignment, although I'm just curious: Does that mean a neutral character can't use either set?

 

 

And if there is no way for a neutral character to use them, is there a script or something that can be written (still a huge n00b when it comes to scripting) to ensure that these feats can be used by anyone?

 

Unfortunately the alignment limitations of both those feats and force powers appear to be hardcoded into the game. They simply stop working when the alignment isn't within the allowed interval.

 

There's not much to do about the feats, but you can get around it with the force powers by making your own duplicates of them that use the same impact scripts as the original. Then you assign those "new" powers to Kreia instead. Since the hardcoding goes by the line numbers in spells.2da your copy should not suffer from any alignment blocks.

Link to comment
Share on other sites

ok, thanks stoffe for clearing that bit up. Just one quick question though about making them into new force powers: would I just copy and paste them at the bottom of the file, or is there something specific I have to edit (other than the line number) in order for the new ones to work?

Link to comment
Share on other sites

ok, thanks stoffe for clearing that bit up. Just one quick question though about making them into new force powers: would I just copy and paste them at the bottom of the file, or is there something specific I have to edit (other than the line number) in order for the new ones to work?

 

Copy their lines in spells.2da and paste them in at the end as new lines. Update the row label, give them a new, descriptive label, modify the forcehostile columns to have unique numbers and change the name of the impact script.

 

Open k_inc_force.nss and find the part of it that deals with the force powers in question. Copy&paste the relevant parts into a new script, compile it and set its name in the impactscript column for your new lines.

 

You could also modify the k_inc_force.nss include file directly to add your new line numbers directly to the conditional there so it uses the same code as the original powers. It's easier and less work, but since that'll introduce another possible incompatibility with other mods by modifying a shared file I wouldn't recommend it. It's safer to make your own, stand-alone script(s).

 

Unless I'm forgetting something that should be enough to make them work. You'd still need to assign them to Kreia somehow though, since they aren't handed out automatically like the originals are. Either by giving them to her in her template initially, or by granting them with a script at the proper levels.

Link to comment
Share on other sites

  • 1 month later...

Stoffe: Could you give an example of how to script giving a feat/power to a NPC at a specific level?

 

And then what to do with said script? Launch it via .dlg? Or will it just take effect whenever NPC levels up?

 

EDIT: Just to give the question more context...

 

Let's say I want Visas (she doesn't have an entry in feat.2da) to learn Force Jump 1 at lvl 20...

 

I could use feat.2da with most characters, but in this very case, Atton & Mira would get the bonus too... Which I don't want. Changing class would be an option for, let's say Kreia & Disciple, since there's only 2 in-games consular NPCS (besides, Kreia has her own column) but to change TWO NPCs cJedi lasses is a bit much...

 

I KNOW I could add to the workbench a "Visas" robe/item/lightsaber/whatever which could only be built at a certain level...

 

But still, it would nice to just script the thingie and be done with it...

 

So, I repeat, what would the script would look like *for a specific level restriction* and how to launch it?

 

I mean, theoretically speaking, shouldn't putting a lvl restriction in her dlg file, a few new lines ("Hey, how about you stop kidding me and show me whatcha got, sister?") and launch the script should work, right??

 

Still, I'd want her to gain it at level up and not through dialogue.

 

Well?

Link to comment
Share on other sites

Stoffe: Could you give an example of how to script giving a feat/power to a NPC at a specific level?

(snip)

Let's say I want Visas (she doesn't have an entry in feat.2da) to learn Force Jump 1 at lvl 20...

 

In this case I don't think you can make it so she receives them at levelup, but you can make her get them right after she has leveled up.

 

As an example I can mention how I perform some custom actions when a party member levels up. I've modified the custom userdefined heartbeat script of some NPCs to check if their level has changed since the last check. If this is the case some actions are performed (in my case fixing the Unarmed combat progression of the Handmaiden and Bao-Dur after they multiclass, and to multiclass Visas to a Watchman at level 15).

 

As an example, here's a modified version of that script, k_oei_hench_inc.nss, which has added a function that grants Visas the Force Jump feat if she's level 20+ and doesn't know it yet. Look for the ST_GiveVisasFeats() function to see this new addition.

 

Note that the above script is an include file, meaning that you can't compile or run it directly. It is instead used by two other scripts, k_oei_spawn and k_oei_userdef, which you'll need to compile and put in the override folder instead, using the above include file when you compile them. Those two scripts can be extracted from scripts.bif with KotorTool. No changes to them are necessary so I won't post them here.

Link to comment
Share on other sites

Mmm...

 

Just out of curiosity...

 

1 - Would scripting an alignment restriction (watchman VS assassin) be a problem... I mean, you *can* perform a 180 in-game and switch sides at later levels...

 

I suppose it wouldn't be a problem for mutliclass-ing since it can only be done once, but what about, let's say, feats, items & powers...

 

For example, let's say you wanna give Visas (whatever - other apprentices just might not work since you can decide to *not* train them) a power at lvl 25. Let's say crush opposition if DS and Inspire Followers if LS... (or new custom high-level DS or LS power, whatever - you might be more familiar with those ;))

 

Can it be done? And would you get the other (not a good thing, btw, me no want that :D) alignment power if you switch sides (guess it'd have to be a cheat at that stage of the game...)

 

2 - What about a class restriction for other padawans? Let's say Mira (just because she doesn't have a column in feat.2da) gets a Force Jump (just to use the example in your .nss file) at lvl 20 only if she's a Sentinel...

 

What would it look like?

 

If ((nClassType = 5) ???????

 

And where would it fit?

 

I DO realize the lazy way to go around it would be through items or feat.2da for most characters (or just create Mira a new class...), but I'd rather find out how it can be done via scripting...

Link to comment
Share on other sites

1 - Would scripting an alignment restriction (watchman VS assassin) be a problem... I mean, you *can* perform a 180 in-game and switch sides at later levels...

 

For example, let's say you wanna give Visas (whatever - other apprentices just might not work since you can decide to *not* train them) a power at lvl 25. Let's say crush opposition if DS and Inspire Followers if LS...

 

Should be doable, you could modify the example function above like:

[b]void[/b] ST_GiveVisasFeats() {
   [color=Green]int[/color] iLvl = GetHitDice([color=Pink]OBJECT_SELF[/color]);

   if ((iLvl >= [color=SkyBlue]20[/color]) && !GetFeatAcquired([color=SkyBlue]101[/color], [color=Pink]OBJECT_SELF[/color])) {
       GrantFeat([color=SkyBlue]101[/color], [color=Pink]OBJECT_SELF[/color]);
   } 

   if ((iLvl >= [color=SkyBlue]25[/color]) && !GetSpellAcquired([color=SkyBlue]167[/color]) && !GetSpellAcquired([color=SkyBlue]144[/color])) {
       int iGood = GetGoodEvilValue([color=Pink]OBJECT_SELF[/color]);
       if (iGood > [color=SkyBlue]60[/color]) {
           GrantSpell([color=SkyBlue]167[/color], [color=Pink]OBJECT_SELF[/color]);
       }
       else if (iGood < [color=SkyBlue]40[/color]) {
           GrantSpell([color=SkyBlue]144[/color], [color=Pink]OBJECT_SELF[/color]);
       }
   }
}

 

This would, at level 25, give Crush Opposition if Darkside and Inspire Followers if lightside (and give nothing as usual if neutral).

 

2 - What about a class restriction for other padawans? Let's say Mira (just because she doesn't have a column in feat.2da) gets a Force Jump (just to use the example in your .nss file) at lvl 20 only if she's a Sentinel...

 

That could be done with a conditional check and action like this in a similar manner. Assuming you meant level 20 Sentinel, and not character level 20, no matter how few or many of them being Sentinel levels.

[b]void[/b] main() {
   if ((GetLevelByClass([color=Pink]CLASS_TYPE_JEDISENTINEL[/color]) >= [color=SkyBlue]20[/color]) && !GetFeatAcquired([color=SkyBlue]101[/color])) {
       GrantFeat([color=SkyBlue]101[/color], [color=Pink]OBJECT_SELF[/color]);    
   }
}

Link to comment
Share on other sites

And this is supposed to be working?

 

The compiling, I mean...

 

I put the 3 files in the same folder only to get a awfully impressive number of mistakes in the DOS screen...

 

Bunch of "undeclared identifiers" having to do with the KOTOR1 NPCs and k_inc_utility...

 

And then a bunch of errors with the k_oei_hench_inc.nss having to do with "undeclared identifiers" and "required arguments missing" for SW_FLAG_WAYPOINT...

 

Hell, I tried it with the *original k_oei_hen_inc.nss and I still get mistakes...

 

What other .nss files am I suppose to include in the folder (that's what I assume is going on...) for the compiling to work?

Link to comment
Share on other sites

And this is supposed to be working?

 

The compiling, I mean...

 

Worked fine here when I tested it. Didn't have time to test it (the new modification to the script) in-game though.

 

Make sure you have all the required include files in the active folder. You will need the following:

k_inc_utility

k_inc_generic

k_inc_gensupport

k_inc_walkways

k_inc_drop

 

If you use any mods that modify any of those files, use the include files from those mods instead of the standard game ones, just in case.

 

Also make sure you have the nwscript.nss file from TSL in the proper folder (unless you use the latest KotorTool edition of nwnnsscomp, in which case you use the -g 2 parameter).

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...