Aller au contenu

Photo

How to grant a companion an extra Feat?


  • Veuillez vous connecter pour répondre
70 réponses à ce sujet

#26
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

So here's another question: How does the game deal with restrictions on Feats? 

 

Like, let's say you're creating a new class, and you want that class to have a fighter feat, like Weapon Spec. But it's not a fighter class. How do you make that work, short of manually assigning the feat (which would be sort of difficult to do, given than you don't know the weapon proficiency of the character). 

 

I'm trying to dissect Kaedrin's stuff, but not seeing the connection. 



#27
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

You copy the table of the fighter's feats to the new class you intend to create.

 

From http://nwn2.wikia.co.../Cls_feat_*.2da

 

The "List" column has the following values:

 

0 = Selectable on level up
1 = Regular feat or bonus feat (Fighter/Wizard bonus feats)
2 = Bonus feat only
3 = Automatically granted feat



#28
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

As for general restrictions, they are in the feat.2da on the "AllClassesCanUse" (1 if it's for everyone, 0 if not) column and other restrictions based on minimum ability scores ecc.cc are on MinStr, MinCon, ecc...



#29
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

A good example of what I'm talking about is the Favored Soul class. At 12th level they automatically get Weapon Specialization in their diety's favored weapon. 

 

Now, in the Favored Soul feats 2da file, the Weapon Specialization isn't listed. And I can't find a script anywhere they grants this. 

 

So how the heck does this happen? 

 

Because this is basically how I'd like to do something. Weapon Specialization is a great example, because it's a Fighter feat. If you just try and add it to another class's feat file, it still won't show up as selectable because that class isn't a Fighter. 

 

I've looked in the feats.2da file to restrictions, but there's nothing on weapon specialization. For instance, Longword Specialization, all that is required is Feat 106 (Weapon Focus Longsword) and a minimum attack bonus. 

 

The way the Favored Soul weapon specialization is handled is a perfect example of what I'd like to do. 



#30
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Favored Soul's deity weapon is taken care of in the general classes.2da at the columns "FavoredWeaponProficiency" eccc you'll notice that while all other classes have -1, Favoured Souls has the values 1,3 and 12 there. Which are the levels when they gain that particular feat.

But that's only an exception and it only concern weapon feats from favored deity and that's it, you can't do it with any other feat.

 

Weapon Specialization maybe does not show because it has a minimum requirements of levels in the fighter's class in the feat.2da, you need to change those as well. (they have the column "MinLevelClass" value set to 4, which is fighter only).


  • ColorsFade aime ceci

#31
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Favored Soul's deity weapon is taken care of in the general classes.2da at the columns "FavoredWeaponProficiency" eccc you'll notice that while all other classes have -1, Favoured Souls has the values 1,3 and 12 there. Which are the levels when they gain that particular feat.

But that's only an exception and it only concern weapon feats from favored deity and that's it, you can't do it with any other feat.

 

Weapon Specialization maybe does not show because it has a minimum requirements of levels in the fighter's class in the feat.2da, you need to change those as well. (they have the column "MinLevelClass" value set to 4, which is fighter only).

 

Ah, I see now. 

 

Well... that would do it. But I'll need a custom class after all. 

 

So, next question (and I do appreciate you folks help today, so much, like always, this board is awesome): 

 

I was halfway through creating a custom class, but what I couldn't suss out was how to define a custom CLASS_TYPE_ variable. I found a PDF discussing custom class generation here. The relevant file is codi_new_prestige_class_tutorial.7z.

 

The author writes: 

 

 

You will need to add a new constant for the class. Bioware suggests not putting the

nwscript.nss in a hak file, so to create new CLASS_TYPE_ constants, use the const keyword in a
central include file.

 

But he doesn't have a suggestion for what centrally located include file to use... 

 

I started digging through Kaedrin's stuff, but couldn't see anything of the sort. Kaedrin defines the constant string name in the classes.2DA file, but I can't find a script that references it. 

 

Any clues?

 

I'm really thinking a custom class is the way to go here. 



#32
kevL

kevL
  • Members
  • 4 052 messages
Kaedrin defines his custom constants in 'cmi_includes' (v1.41.4 -- i think he removed them at some pt. and was/is intending to put them back in a new release)

in any case, just create your own constants file: eg. 'cf_constants.nss' and #include it, or alternately just define what you need by the .2da row and/or at the top of the script where they'll be used.
  • ColorsFade aime ceci

#33
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Right, but #include it where? Is there a root file I should include it in? 

 

Next question: I have created a custom class, by essentially copying an existing class line in classes.2da, and modifying a couple columns. I added refs to the descriptions (modified my Dialog.tlk file). I created the feats and bonus feats 2da files for this new class, and referenced them in the appropriate column. 

 

 

But... the class doesn't show up in the toolkit as a selectable class in the companion's blueprint properties. 

 

How does one do that, or does it take scripting to assign it to the companion after it's been created?



#34
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

the class_constant field is not mandatory (you can leave the "****"), you can always just use the row ID to identify it in scripts and that's what counts.

 

What class did you copy? Maybe it was a prestige class?



#35
kevL

kevL
  • Members
  • 4 052 messages
Ps. modifications to Dialog.Tlk need to be in the installation folder, to show up in the TS.
  • ColorsFade aime ceci

#36
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

All right, progress. 

 

To get the custom class to show up in the Toolkit, the related 2DA files have to go in the base NW install directory override folder. Once there, it worked, and I was able to set the class on my companion. 

 

The deity weapon feats are granted on the appropriate levels as I have them set in the 2DA. The trick there is making sure the companion has "Weapon of Choice (weapon-that-matches-deity)" as a granted Feat on their blueprint. Once that happens, it works automatically. 

 

With some tweaking, The Fred's script (and XML) to restrict companion multiclassing allows me to make sure this companion is the only companion that has access to this custom class. 

 

I Have One Open Issue

 

There seems to be some problem with bonus feats. What I've done in my classes.2da file is cloned the Paladin class, and then added the diety weapon feats, and a couple other automatically granted feats at level 1. 

 

Then I created a bonus feats 2da for this class, and granted bonus feats every X levels. And then I created the associated class_feats.2da file. 

 

My intention was to allow the class to select one of the Paladin's Divine feats as a bonus feat at levels x, y and z. So I added them to this class's feats.2da. I've tried setting the List value to all possible values. I tried 1, 2 and even 3, specifying the exact level to grant the feat, and still it doesn't work. 

 

And it's really weird; the bonus feat dialog automatically opens, but on the wrong levels, and it's empty. No feats available, even though I've specified them in the custom class's 2da file.

 

I had bonus feats specified at 3,6,9,12, and the bonus feats dialog instead opens at 7 and 16. I checked the default paladin bonus feats table to see if it was using those values, but Paladins don't get bonus feats at all (until epic levels). 

 

So there seems to be a disconnect between the bonus feats table I've created for this custom class, and the way the game uses it. And there seems to be a real disconnect between the bonus feats I specify in the custom classes's 2da file, and what shows up (which is nothing).

 

So close...  



#37
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Maybe you could upload those 3 2das somewhere so we can take a look at them and see better what's the problem. (Also need to know what row ID you used for the new class)

 

Specifically all that's need are (let's assume the new class is called "companion", but replace companion with whatever name it actually is)

 

classes.2da

cls_feat_companion.2da

cls_bfeat_companion.2da


  • ColorsFade aime ceci

#38
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Maybe you could upload those 3 2das somewhere so we can take a look at them and see better what's the problem. (Also need to know what row ID you used for the new class)

 

Specifically all that's need are (let's assume the new class is called "companion", but replace companion with whatever name it actually is)

 

classes.2da

cls_feat_companion.2da

cls_bfeat_companion.2da

 

Can do. I have a dropbox account. Will upload in a bit and update this thread. 



#39
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Okay, here's the dropbox: 

 

https://www.dropbox....ZADomoV0ka?dl=0

 

The script and XML is what I'm using in my campaign folder to prevent any other classes (including the player) from having access to this Companion's class. 

 

See what you can make of it; I can't find any obvious errors that would cause the bonus feats to not work correctly. It was cloned straight from the Paladin class, with minor modifications.



#40
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Divine Might and Divine Shield are supposed to be bonus or automatically granted?

 

Edit: Oh well, I made em bonus anyway. Gonna upload the fixed (hopefully, still have to be tested) versions right away with the problem that there were before.



#41
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Here's the "fixed" (fingers crossed) files.

 

https://www.dropbox....lasses.2da?dl=0

https://www.dropbox....al_tyr.2da?dl=0

https://www.dropbox....al_tyr.2da?dl=0

 

The problems were:

 

1) in classes.2da, you did not assign the row ID 104 to the new class. It was still 6 like the normal paladin and that probably was causing conflicting issues:

2) in cls_bfeat_.2da, the bonus feats were not assigned at levels 3/6/9 eccc but at levels 4/7/10 one level ahead, well, no big deal. Row 0 is level 1, not level 0. ^^

3) in cls_feat_.2da some of the extra bonus feats were assigned on specific levels only, but on those levels there were no bonus feats at all, I made them check for every level in which there's a bonus feat (changed their value to -1) and changed the list from 2 to 1, so they also work should you decide to change the bfeat progression to be more similar to other classes, were at epic levels they can pick up ALL feats (as long as they have requisites as bonus).

 

Hopefully that should be enough.


  • ColorsFade aime ceci

#42
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Here's the "fixed" (fingers crossed) files.

 

https://www.dropbox....lasses.2da?dl=0

https://www.dropbox....al_tyr.2da?dl=0

https://www.dropbox....al_tyr.2da?dl=0

 

The problems were:

 

1) in classes.2da, you did not assign the row ID 104 to the new class. It was still 6 like the normal paladin and that probably was causing conflicting issues:

2) in cls_bfeat_.2da, the bonus feats were not assigned at levels 3/6/9 eccc but at levels 4/7/10 one level ahead, well, no big deal. Row 0 is level 1, not level 0. ^^

3) in cls_feat_.2da some of the extra bonus feats were assigned on specific levels only, but on those levels there were no bonus feats at all, I made them check for every level in which there's a bonus feat (changed their value to -1) and changed the list from 2 to 1, so they also work should you decide to change the bfeat progression to be more similar to other classes, were at epic levels they can pick up ALL feats (as long as they have requisites as bonus).

 

Hopefully that should be enough.

 

Thanks. 

 

The bonus feat window opens when expected, but it is still empty. 

 

I'm puzzled about that. 



#43
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Maybe you don't meet the prerequisites for those feats?

Edit: I just noticed you put strange numbers on index feats for those feats. 211289 for Empower Turning, really? I don't think there's more than 2250 or so feats in the game.



#44
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Maybe you don't meet the prerequisites for those feats?

Edit: I just noticed you put strange numbers on index feats for those feats. 211289 for Empower Turning, really? I don't think there's more than 2250 or so feats in the game.

 

Ah, I see. I put the column number in Feats.2da for the string ref in dialog.tlk. 

 

Let me switch that and see what happens. 



#45
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Maybe you don't meet the prerequisites for those feats?

Edit: I just noticed you put strange numbers on index feats for those feats. 211289 for Empower Turning, really? I don't think there's more than 2250 or so feats in the game.

 

That did it! It worked!

 

Oh my gosh.. so happy. 

 

Thank you for all your help. Can't believe this is working. Very happy. 



#46
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

Another one down.

Queue the A-Team music.


  • kamal_ aime ceci

#47
kevL

kevL
  • Members
  • 4 052 messages

  • Clangeddin86 et GCoyote aiment ceci

#48
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Okay, so one last thing... I swear. 

 

I'm able to use Fred's script and XML file in my campaign folder to handle character level up. This is great; it works. With the script, I can filter the companion so only certain classes and prestige classes are available. And, I can use the script to ensure the PC and other companions can NOT select this custom class. 

 

However... on initial character creation, it's an available class. And I can't figure out how to hook into the appropriate XML GUI screen to do the same sort of filtering. 

 

I've tried modifying chargen_classx2.xml (because I have SoZ and my campaign requires MoTB and SoZ) and ig_chargen_class.xml, but neither seems to be working. 

 

Since I don't know which of these xml files is used for class selection during character creation, I decided to add a bit of text to each XML file at the top: 

<!-- Title Pane -->
    <UIPane name="TitlePane" x=ALIGN_CENTER y=ALIGN_TOP width=984 height="74" capturemouseclicks="false" ignoreevents="true" >
        <UIText name="TITLE_TEXT" strref="113693" x=ALIGN_CENTER y=12 width=356 height=30 align="center" valign="middle" 
	        fontfamily="Special_Font" style="4" />
        <UIIcon img="main_sub_titles.tga" x="0" y="0" width="PARENT_WIDTH" height="PARENT_HEIGHT"/>
<UIText name="TITLE_TEXT_TEST" text="TESTING CLASS X2" x=ALIGN_CENTER y=52 width=356 height=30 align="center" valign="middle" 
	        fontfamily="Special_Font" style="4" />
    </UIPane>

Unfortunately, this text doesn't show up. So I have no idea if I'm even messing with the right screens. 

 

Both of these files are sitting in my campaign folder. I moved them directly into the NWN base UI folder, and still no change (text didn't show up, script didn't fire). The script I am using is modified to point to the correct screen and UI element. But the custom class still shows up as available to the player. 

 

Any clues?



#49
ColorsFade

ColorsFade
  • Members
  • 1 267 messages

Okay, I know which XML is is. It's the classx2 one. Had to adjust the text. 

 

Now I have to figure out how to hook the script to fire... 



#50
Clangeddin86

Clangeddin86
  • Members
  • 220 messages

The answer should be in the xml you linked earlier, look:

<UIScene name="SCREEN_LEVELUP_CLASS" width=1024 height=768 priority="SCENE_INGAME_FULLSCREEN" fullscreen=true cullrenderables=true scriptloadable=true idleexpiretime=1.0
        OnAdd=UIObject_Misc_ExecuteServerScript("gui_class_open") />

Add the "OnAdd=UIObject_Misc_ExecuteServerScript("gui_class_open")" to the UIscene of the chargen_classx2.xml

 

If it doesn't work, then a tweak to the gui_class_open script may be necessary.