Player Resource Consortium

 

Author Topic: Shifter (PNP) issues  (Read 7568 times)

0 Members and 1 Guest are viewing this topic.

June 09, 2009, 04:29:19 PM
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

I've just played through several modules with the Shifter (PNP) class, and it has changed significantly since the last time I played it (over a year ago in an earlier version of the PRC). First of all: it's a lot faster, which is great! However, a couple of issues I noticed:

1) When shifting into another form, many attributes are adjusted to match the new shape. However, some, but not all of these adjustments are lost after sleeping. For instance: STR, DEX, and CON adjustments are all lost after sleeping, but AC adjustments are not. Since they are supposed to be properties of the shape one is in, the shouldn't be lost by sleeping--and weren't in the previous version of Shifter (PNP) that I played, if I remember correctly. Similarly, I'm pretty sure I once saw some of my adjustments being dispelled, although this also shouldn't be possible.

2) The predefined Troll shape is given both an AC increase and temporary hit points, among other things. However, when the temporary hit points are used up, the AC increase is also lost. They shouldn't be linked like this.

3) The predefined shape "Falcon" is given at Shifter (PRC) level 1; however, it can't actually be used until Shifter (PRC) level 2.

The previous version of PRC I used had code available in a CVS repository. Is the code for the curren tversion available? I'll be glad to try to debug what's going on and suggest a patch if I can figure it out.


June 09, 2009, 04:45:30 PM
Reply #1

All code for the PRC is publicly available. Just look at the article entitled PRC CVS.
That is not dead which can eternal lie.
And with strange aeons even death may die.


June 10, 2009, 10:18:08 PM
Reply #2
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

Quote from: Stratovarius

All code for the PRC is publicly available. Just look at the article entitled PRC CVS.


Cool, thanks.


June 25, 2009, 12:20:57 PM
Reply #3
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

More info on two of these issues:

Quote
1) When shifting into another form, many attributes are adjusted to match the new shape. However, some, but not all of these adjustments are lost after sleeping. For instance: STR, DEX, and CON adjustments are all lost after sleeping, but AC adjustments are not. Since they are supposed to be properties of the shape one is in, the shouldn't be lost by sleeping--and weren't in the previous version of Shifter (PNP) that I played, if I remember correctly. Similarly, I'm pretty sure I once saw some of my adjustments being dispelled, although this also shouldn't be possible.


Properties that are applied with the SetCompositeBonus to the shifter's hide (which is gotten using the PRC's GetPCSkin function) are lost after sleeping. If I instead apply them to the creature weapons of the form I shift to (again using the SetCompositeBonus function), they are not lost. This is a viable work-around for most forms, but won't help forms that don't have creature weapons.

I remember reading in another thread, or in the PRC code somewhere, that someone else had a similar problem with another PRC class and used a similar workaround for it. Does anyone know why properties applied to the PC skin are lost after sleeping?

Quote
2) The predefined Troll shape is given both an AC increase and temporary hit points, among other things. However, when the temporary hit points are used up, the AC increase is also lost. They shouldn't be linked like this.


I've got a patch for this (attached). The problem is that any properties that are linked to the temporary hit points are removed when the hit points are used up. The solution is not to link the hit points to the other properties.


June 25, 2009, 12:26:02 PM
Reply #4
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

Quote from: CapnQ

... I've got a patch for this (attached)....


Apparently attachments don't work? What's the best way to submit a patch?


June 25, 2009, 03:17:56 PM
Reply #5
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

I think that the problem is caused by ScrubPCSkin function in 'prc_inc_function.nss'. I had the same problem with bonus domain casting feats - they were removed form PC skin after rest. Adding those feats to exclusion list fixed the problem :) .

About attachments - they do work, but there might be some kind of limit for the size of single file. If you can't upload your fix as attachmet, there are plenty of other file sharing services (RapidShare, Easy-Share, SendSpace, etc.) - use them instead.


June 25, 2009, 04:10:14 PM
Reply #6
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

Quote from: xwarren

I think that the problem is caused by ScrubPCSkin function in 'prc_inc_function.nss'. I had the same problem with bonus domain casting feats - they were removed form PC skin after rest. Adding those feats to exclusion list fixed the problem :) .


So that function is called after sleeping? In any case, adding feats to the exclusion list won't help, because it isn't feats that are being lost, it's STR, DEX, and CON adjustments. I assume ScrubPCSkin shouldn't be removing item properties that are marked as DURATION_TYPE_PERMANENT; if it is, which it appears to be in my case, this should be fixed, right?

Quote
About attachments - they do work, but there might be some kind of limit for the size of single file. If you can't upload your fix as attachmet, there are plenty of other file sharing services (RapidShare, Easy-Share, SendSpace, etc.) - use them instead.


My patch was quite small. Now that I think about it, maybe I should just include it here:


Index: prc_shft_effap.nss
===================================================================
RCS file: /cvsroot/nwnprc/nwnprc/scripts/prc_shft_effap.nss,v
retrieving revision 1.4
diff -u -r1.4 prc_shft_effap.nss
--- prc_shft_effap.nss   2 Jan 2007 22:35:56 -0000   1.4
+++ prc_shft_effap.nss   25 Jun 2009 15:01:58 -0000
@@ -121,22 +121,6 @@
         DeleteLocalInt(oShifter, "PRC_Shifter_ExtraDEX");
     }
 
-    // Extra CON bonus gets turned into temporary HP
-    if(GetLocalInt(oShifter, "PRC_Shifter_ExtraCON"))
-    {
-        int nExtraCON = GetLocalInt(oShifter, "PRC_Shifter_ExtraCON");
-
-        if(DEBUG) DoDebug("prc_sft_effap: Applying extra Constitution bonus\n"
-                        + "nExtraCON = " + IntToString(nExtraCON)
-                          );
-
-        // Generate effect
-        eTotalEffect = EffectLinkEffects(eTotalEffect, EffectTemporaryHitpoints(nExtraCON * GetHitDice(oShifter)));
-
-        // Clean up local var
-        DeleteLocalInt(oShifter, "PRC_Shifter_ExtraCON");
-    }
-
     // Natural AC
     if(GetLocalInt(oShifter, "PRC_Shifter_NaturalAC"))
     {
@@ -163,6 +147,33 @@
 
         // Clean up local var
         DeleteLocalInt(oShifter, "PRC_Shifter_HarmlessInvisible");
+    }
+
+    // Supernaturalise and apply the total effect
+    ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(eTotalEffect), oShifter);
+
+    // Queue deletion of the applicator object
+    DestroyObject(oApplier, 6.0f);
+    
+    //Apply temporary HP separately from other effects--linking it with other effects
+    //causes those other effects to be removed when the temporary HP is used up.
+    
+    eTotalEffect = EffectVisualEffect(VFX_DUR_CESSATE_NEUTRAL); // Initialise to an unobtrusive VFX
+
+    // Extra CON bonus gets turned into temporary HP
+    if(GetLocalInt(oShifter, "PRC_Shifter_ExtraCON"))
+    {
+        int nExtraCON = GetLocalInt(oShifter, "PRC_Shifter_ExtraCON");
+
+        if(DEBUG) DoDebug("prc_sft_effap: Applying extra Constitution bonus\n"
+                        + "nExtraCON = " + IntToString(nExtraCON)
+                          );
+
+        // Generate effect
+        eTotalEffect = EffectLinkEffects(eTotalEffect, EffectTemporaryHitpoints(nExtraCON * GetHitDice(oShifter)));
+
+        // Clean up local var
+        DeleteLocalInt(oShifter, "PRC_Shifter_ExtraCON");
     }
 
     // Supernaturalise and apply the total effect


June 25, 2009, 04:15:37 PM
Reply #7
  • Developer
  • ***
  • Posts: 220
  • Karma: +0/-0
    • View Profile

Quote from: CapnQ

I assume ScrubPCSkin shouldn't be removing item properties that are marked as DURATION_TYPE_PERMANENT...


Oops, ignore that--I was looking at the wrong line. They aren't marked permanent--SetCompositeBonus doesn't even allow that, I guess. Which still leaves me with the problem of how to apply these permanently. As I said, applying them to the creature weapons is a satisfactory solution for forms that have them, but doesn't work for those that don't.