Author Topic: Whycan I not get Player/DM tools to work?  (Read 708 times)

Legacy_Vendel

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« on: December 07, 2011, 05:40:27 pm »


               Hello!

Using 1.69, I get a range of feats, Player Tool 1-10, and DM tool 1-10. I can add these feats to the PC via items. For instance, I can add them as itemproperties (Bonus Feat) to either a helm,or directly to a creature skin.

I can then see (Character Sheet) that I possess the feat in question, but my radial menu does not contain the feat,so I cannot activate it! 

Help?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #1 on: December 07, 2011, 07:10:46 pm »


               This is odd. I've quickly made these work for me. BUT I was working from scratch with all 1.69 content.

The 2DA files that need to be looked at to ensure that these feats work are feats.2da, spells.2da and all of the cls_feats_xxx.2da files. For stuff to show up on the player's radial menu, I suggest looking at the class feat 2das and ensuring that those "tools" are listed there and available.

FYI - sticking that many tools in one radial menu is overload for most. I suggest looking at how the horse menu/feats were set up and following that example. I've done the same and it is working well for me.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #2 on: December 08, 2011, 04:07:46 am »


                So uh... I have managed to get these to work, but ran into trouble getting the subradial system working. Basically to set up subradial feat menus, you need to do some very weird math in the FeatID column in Spells.2da.

I found this post on a french forum:
http://forums.jeuxon...ad.php?t=349366

And something closer to the original:
http://www.alandfaraway.org/node/813

And to be completely honest I don't understand why featid has this formula

(65536*subfeatid)+featid

and subfeatid is an arbitrary number pulled out of thin air as far as I can tell.

what gives? how does one pick a subfeatid #? Can you pick anything? does it matter?
               
               

               


                     Modifié par henesua, 08 décembre 2011 - 04:15 .
                     
                  


            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #3 on: December 08, 2011, 04:29:40 am »


               Here, this is a bit more useful:

http://www.nwnprc.co...ide.html#subrad

It just says to use a number greater than 5000 for the sub-radial number.  What you might want to do is simply pick a number somewhere(ie start from 6000).  Auto increment it for each sub radial.  

Theoretically with different feat id's, you should never hit the same number if you kept repeating the same subfeatid, but better safe than sorry.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #4 on: December 08, 2011, 04:34:37 am »


               Yeah, I understand how to do it... but I don't understand what the engine is doing - to require this crazy number.

Put another way... I am very uncomfortable when I don't know why I need to code a certain way. I'm picking apart the horse feat subradial numbers and it looks like they used much smaller numbers to do their math. I think I'll follow the same pattern and see how it goes.

Perhaps thats the onyl way to learn, keep trying things until it breaks and try to figure out then how it is behaving.
               
               

               


                     Modifié par henesua, 08 décembre 2011 - 04:36 .
                     
                  


            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #5 on: December 08, 2011, 04:58:46 am »


               Ahh sorry, it's bitwise numbering systems.

The second link you had explained it breaks it into two part numbers and uses the top 16 bits, and such.

It shows the math with examples from bioware and explains that the older feats than that were actually hardcoded (that had subriadials).  They further suggest any subfeat id below 3000 is reserved for bioware.  My guess is that it does some bitwise ANDING or masking to figure out how to link the subfeats onto the main feat.  Primitive operations that a computer can perform very quickly with little overhead.

I'm sure someone with a few calculus courses under their belt could work it out.  IE 65536 is 2^16.  Doing some logical operations to calculate the sub feats that should be under a feat seems pretty likely.  The crazy number is required for binary math.
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #6 on: December 08, 2011, 05:04:25 am »


               It giving the radial feat a unique id number because it connected to master feat, (placholder for the subfeats to be under and then it reverse the math to find the master feat and sub feat on the radial. This just guess work on my part. It doing this to separate it from just standard feats in radial. I'm sure someone who knows the detail will come along.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #7 on: December 08, 2011, 05:14:45 am »


               And btw the number you have to made up must be unique. No subradial feat can have this number as well otherwise you can experience really weird issues - Im not sure now if I had this issue but one of my subradial was crashing a game.

So its really good to write a numbers you used somwhere to avoid duplication.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #8 on: December 08, 2011, 05:22:38 am »


               Yeah that makes some sense... the subfeat id is simply a number multiplied by 16th bit which means that the 16th bit acts like a mask. BUT the feat number is added after. So the engine must know what that number is because if you divide by the 16th bit before subtracting that number you can't find the subfeatid anyway... and the featid is stored in the master spell so access to that number appears to be in the right place.

Anyway I understand the math, and the process.

I wonder however if it is necessary. I would think there would be an easier way to do this....
               
               

               
            

Legacy_Calvinthesneak

  • Hero Member
  • *****
  • Posts: 1159
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #9 on: December 08, 2011, 05:24:18 am »


               If it has to be unique, then it must be applying a bitwise mask to get the feat and sub feats.  It will be done in binary because it's much faster for processor.  As shadow said, it reverse engineers it.  I don't remember enough of my assembly language programming anymore, but I do remember that sort of thing from networking submasking.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #10 on: December 08, 2011, 05:25:48 am »


               

ShaDoOoW wrote...

And btw the number you have to made up must be unique. No subradial feat can have this number as well otherwise you can experience really weird issues - Im not sure now if I had this issue but one of my subradial was crashing a game.

So its really good to write a numbers you used somwhere to avoid duplication.


The horse feats appear to simply use the actual featid of the subfeat as the subfeatid. I couldn't see any problem with following the same pattern so I used the method. Tested it a number of times - no problems. Makes it easy to avoid duplicating the numbers.

So the subfeats also get indexes in Feat.2da. Might be a little wasteful, but it works.
               
               

               
            

Legacy_Vendel

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
Whycan I not get Player/DM tools to work?
« Reply #11 on: December 08, 2011, 06:50:31 pm »


               Huh, I finally found what's wrong: I was using a hak that had cls_feat_*** without Horse Menu or Player Tools included. Seems you have to have these (OnMenu set to 1) for usage, even if you do not ge the feats themselves from leveling in the class.

Thanks for the help, guys!