PDA

View Full Version : question about feats (TSL)


Dark_lord_Cheez
05-10-2006, 05:19 PM
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?

Darkkender
05-10-2006, 05:41 PM
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.

Dark_lord_Cheez
05-10-2006, 05:54 PM
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?

Darkkender
05-10-2006, 06:15 PM
Since you have feats.2da handy can you list the name of all of the columns here. That way I might be able to get a better idea. It could be script driven but I have my doubts.

stoffe
05-10-2006, 06:29 PM
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.

Dark_lord_Cheez
05-10-2006, 06:55 PM
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?

stoffe
05-10-2006, 07:15 PM
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.

darthrevanrlz
06-21-2006, 06:33 PM
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?

stoffe
06-24-2006, 06:25 AM
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 (http://www.algonet.se/~stoffe/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.

darthrevanrlz
06-24-2006, 05:02 PM
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...

stoffe
06-24-2006, 06:03 PM
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:

void ST_GiveVisasFeats() {
int iLvl = GetHitDice(OBJECT_SELF);

if ((iLvl >= 20) && !GetFeatAcquired(101, OBJECT_SELF)) {
GrantFeat(101, OBJECT_SELF);
}

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


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.

void main() {
if ((GetLevelByClass(CLASS_TYPE_JEDISENTINEL) >= 20) && !GetFeatAcquired(101)) {
GrantFeat(101, OBJECT_SELF);
}
}

darthrevanrlz
06-25-2006, 02:01 PM
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?

stoffe
06-25-2006, 03:18 PM
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).

darthrevanrlz
06-25-2006, 06:52 PM
Ah.

Had the k_inc_walkways and k_inc_drop missing.

Exactly how many of those include files *might* at some point become necessary when modding, lol???