Player Resource Consortium

 

Author Topic: PRC 3.5 b2 and NWNX question.  (Read 10996 times)

0 Members and 1 Guest are viewing this topic.

October 13, 2011, 03:32:05 AM
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

I'm using the latest version of the PRC with NWNX2, trying to get the game to properly retain the Draconic Enlargement stat bonuses. Right now it treats them as temporary bonuses and erases them on rest/level up.

I was told that using NWNX would fix this, but it appears not to be the case. Am I missing a step, or is this not currently fixable?


October 13, 2011, 03:54:27 AM
Reply #1
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Usually this would require nwnx_funcs plugin installed, but iirc premanent stat modifications were not implemented for size changes.
I may be wrong though - check if other stat mods work for you (templates, class bonuses etc).


October 13, 2011, 06:12:34 AM
Reply #2
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

I forgot to add that I have nwnx_funcs installed. I just checked and it seems to be properly changing the stats for PnP Shifters. I'm willing to make the changes to the DD myself, but I haven't any idea where to start.

When you say 'class bonuses' which classes do you mean? The normal DD stat bonuses work for me, but they always have.


October 13, 2011, 07:05:33 AM
Reply #3
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Most of the nwnx_funcs modifications are applied in prc_nwnx_funcs.nss. This script applies ability changes to Warchief, Mighty Contender of Cord, Heartwarder, Acolyte of the Skin, Diamond Dragon... etc (see the script).

Temporary size bonuses you mentioned before are applied in prc_size.nss script (PRCGetCreatureSize() checks for draconic enlargement). I think you should start there ;)


October 18, 2011, 09:41:16 AM
Reply #4
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

Okay, had a poke around, raised about as many questions as I got answered.

Can I safely create new persistent local variables within the prc_size.nss script, or will I need to alter something elsewhere to make it work? Specifically will "SetPersistantLocalInt(oPC, "NWNX_Size<stat>", foo);" create the persistent local "NWNX_Size<stat>" or do I have to go about that some other way?

Am I correct in assuming that prc_size.nss handles the effects of the engorge spell, as well as DD size changes? (For that matter, what else touches prc_size.nss for determining stat changes?).

Are there any significant drawbacks to making the prc_size script attempt to use NWNX before failing over to the current method of operation?

Finally, what's the simplest way to check that NWNX is in use? If I'm reading inc_nwnx_funcs correctly, GetLocalInt(oModule, "PRC_NWNX_FUNCS"); should return nonzero if NWNX is running?


October 18, 2011, 12:14:04 PM
Reply #5
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Quote
Finally, what's the simplest way to check that NWNX is in use? If I'm reading inc_nwnx_funcs correctly, GetLocalInt(oModule, "PRC_NWNX_FUNCS"); should return nonzero if NWNX is running?
correct

Quote
Can I safely create new persistent local variables within the prc_size.nss script, or will I need to alter something elsewhere to make it work? Specifically will "SetPersistantLocalInt(oPC, "NWNX_Size<stat>", foo);" create the persistent local "NWNX_Size<stat>" or do I have to go about that some other way?
Yes, you can add new persistant locals this way. (I would use only one local though - the size for which bonuses were applied by nwnx - and allow the script to calculate the rest)

Quote
Am I correct in assuming that prc_size.nss handles the effects of the engorge spell, as well as DD size changes? (For that matter, what else touches prc_size.nss for determining stat changes?).
I haven't seen code for enlarge person in prc_size - imo it's OK - enlarge person is temporary magical bonus so it should be 'green'.


October 21, 2011, 06:41:51 PM
Reply #6
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

Finished coding up a version that I think works, but the darn thing won't compile! Every time I go to compile it with nwnsscomp it throws me errors about mostly unrelated files. Specifically, it's complaining about constants not being constants in prc_inc_nwscript and prc_inc_descrptr.

What am I missing here? I assume the nss files included with the PRC are identical to the ones used to compile the ncs files, in which case there's a way to kick the compiler in the teeth and force it to ignore errors.


October 22, 2011, 01:00:13 AM
Reply #7
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Finished coding up a version that I think works, but the darn thing won't compile! Every time I go to compile it with nwnsscomp it throws me errors about mostly unrelated files. Specifically, it's complaining about constants not being constants in prc_inc_nwscript and prc_inc_descrptr.

What am I missing here? I assume the nss files included with the PRC are identical to the ones used to compile the ncs files, in which case there's a way to kick the compiler in the teeth and force it to ignore errors.

Are you compiling with the latest soruces (3.5 beta 2)? Which compiler do you use?


October 22, 2011, 07:53:02 AM
Reply #8
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

Using the .nss files I extracted from the 3.5b2 haks, and the NwnNssComp 2.0 file from here: http://nwvault.ign.com/View.php?view=Other.Detail&id=708

The specific error I am getting is this:

prc_inc_nwscript.nss(63): Error: Non-constant value specified for constant "BIOWARE_INHIBIT"
prc_inc_descrptr.nss(57): Error: Non-constant value specified for constant "DESCRIPTOR_ELEMENTAL"

I haven't touched either of those files at all, so why it's throwing errors at me is a bit baffling. I did take a look at them, and the relevant lines are as follows:

// This line is here to prevent the bioware toolkit from
// throwing an exception over the number of constants in PRC
const int BIOWARE_INHIBIT = !!0;

//special
const int DESCRIPTOR_ELEMENTAL         = DESCRIPTOR_ACID | DESCRIPTOR_COLD | DESCRIPTOR_ELECTRICITY | DESCRIPTOR_FIRE | DESCRIPTOR_SONIC;
« Last Edit: October 22, 2011, 07:57:09 AM by Ophichius »


October 22, 2011, 08:08:27 AM
Reply #9
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Right, i'll have to update prc_inc_descrptr.nss.

The compiler you use seems to be an older version (Strat updated it in 2011!? - i don't think so) The version we use to compile PRC doesn't complain about errors in those scripts.

Try Advanced Script Compiler - It's the most recent version of 'PRC Compiler' and i use it to compile most of my scripts (but i haven't updated our SVN repository with it yet).


October 22, 2011, 08:16:52 AM
Reply #10
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

Hmm, that squashed the complaints about constants being declared improperly, but I'm getting a new error. "unable to load nwscript.nss". Did a quick search and couldn't find that file at all. I think I may need some help in configuring my development environment properly. So far I've just dumped the contents of most of the PRC haks into a folder along with the compiler.


October 22, 2011, 08:19:37 AM
Reply #11
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

The command line for Advanced Script Compiler is a bit different than for Nwnnsscomp
I use something like this:
NWNScriptCompiler.exe -1ogl -i "<path_to_include_files>" -n "<path_to_nwn_dir>" <script_name>


October 22, 2011, 08:26:56 AM
Reply #12
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

Excellent, that got it compiling. Will report in a few if it worked.

One minor bug this will introduce though, NWNX doesn't appear to have a way to alter dodge AC, just base AC. So any dodge bonuses from size changes will be rendered as base AC bonuses instead.


October 22, 2011, 09:02:32 AM
Reply #13
  • Adept
  • *
  • Posts: 11
  • Karma: +0/-0
  • New Member
    • View Profile

Half-success.

Stats change properly with size changes from enlarge person, reduce person, or DD levels. Unfortunately, they don't revert properly when the enlarge/reduce person spells wear off.


October 22, 2011, 10:03:07 AM
Reply #14
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

I'll quote myself:
Quote
enlarge person is temporary magical bonus so it should be 'green'.