Player Resource Consortium

 

Author Topic: Craft system  (Read 7308 times)

0 Members and 1 Guest are viewing this topic.

February 14, 2012, 07:52:31 PM
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

I am attempting to alter the craft system (arbitrary) to give more options while still avoiding TMIs.  I wrote some functions into prc_craft, but they don't seem to work.  It appears as if some other function (probably from one of the includes) is setting a limit that I can't change.  Specifically I am trying to increase the number of feats available for bonus feats.

Does anyone know where to start looking?  Also, where is the code for PRCGetFileEnd function?

or where the const NUM_MAX_FEAT_SUBTYPES is used?



February 15, 2012, 03:13:29 AM
Reply #1
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

Figured it out!

I'm going to attempt to add more feats to the list and then I'll post the files.


February 15, 2012, 04:37:59 AM
Reply #2
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

Ok, got feats working AND corrected an error that prevented adding spells using arbitrary crafting (always getting a TMI error)

For now, all you get is Bioware spells.  Fix was in the code, but the error prevented it from working ("irp_spells" constant reference should have been capitalized).

Enjoy.  My first NWN coding!
« Last Edit: February 15, 2012, 07:58:58 PM by barna10 »


February 15, 2012, 08:02:08 PM
Reply #3
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

I have tweaked the fix as much possible to provide as many spells as possible (about twice as many as my first attempt).  Some, but not all, of the PRC spells are enabled.

 If playing on a server, I could tweak it to allow ALL spells, but it will require a separate prc_craft.ncs. 

On that, is there a way for the system to detect if it is running in multi-player mode or not?  I could incorporate an if statement to have it enable all spells automatically when playing on a server.

 If you downloaded the previous file, this one supersedes the previous one.


February 16, 2012, 02:01:51 AM
Reply #4
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

On that, is there a way for the system to detect if it is running in multi-player mode or not?  I could incorporate an if statement to have it enable all spells automatically when playing on a server.
I use GetPCPublicCDKey() for that - in single player mode (with default parameters) it returns blank string.


February 16, 2012, 03:18:01 AM
Reply #5
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

good to know, I will try that


February 17, 2012, 07:36:04 AM
Reply #6
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

I've integrated your fix with PRC sources. :)
Thank you!


February 17, 2012, 11:05:32 PM
Reply #7
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

No problem.  I'm glad I could finally give something back.


February 20, 2012, 03:53:31 AM
Reply #8
  • Associate
  • ***
  • Posts: 112
  • Karma: +2/-0
    • View Profile

I cleaned up the code a bit.  Also, I noticed some code uses "IPRP_SPELLS", others use "iprp_spells".  I added support for both.  Now both arbitrary and non-arbitrary crafting work. 

However, non-arbitrary crafting requires the PC to have the spell memorized.  I haven't figured out how to tie-in the Warlock's UMD check for this, but I'll keep working on it so Warlock's can create scrolls and potions without using arbitrary crafting.


February 20, 2012, 05:25:17 AM
Reply #9
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

I cleaned up the code a bit.  Also, I noticed some code uses "IPRP_SPELLS", others use "iprp_spells".  I added support for both.  Now both arbitrary and non-arbitrary crafting work. 

However, non-arbitrary crafting requires the PC to have the spell memorized.  I haven't figured out how to tie-in the Warlock's UMD check for this, but I'll keep working on it so Warlock's can create scrolls and potions without using arbitrary crafting.
Good point with iprp_spells case, though it's only needed for string comparision in PopulateList() function (Get2daCache always uses lowercased file names).

Thanks for fixing this. I've updated my copy of SVN repository.