Player Resource Consortium
Neverwinter Nights => General Discussion => Topic started by: -Norbert- on June 03, 2018, 05:12:52 AM
-
In prc_inc_switch.nss it says the default values for some of the epic spell switches are true or false. Does that mean that those switches have to look like this:
<nr> <switch_name> bool {true/false}
or do they still use int and {0/1}?
I'm also a bit confused about the switches for power attack.
I think it would go like this:
1 PRC_POWER_ATTACK_DISABLED int -1
2 PRC_POWER_ATTACK_FULL_PNP int 1
But then why is there a line const string PRC_POWER_ATTACK = "PRC_POWER_ATTACK"; ? Do I need to set that too?
-
0/1 are equivalent to false/true in C programming languages so you can't go wrong with using 0 for false and 1 for true, although technically any number that isn't 0 has the boolean value of true but if you have doubts about stuff, I would recommend using windows grep to search the (extracted from the haks) script files.
This is is from the ft_poweratk.nss :
<Ornedan> And a bunch of switches to control it:
<Ornedan> PRC_POWER_ATTACK - 3 values:
<Ornedan> -1 -- Disabled. Never apply the PRC PA feats to hide
<Ornedan> 0 -- Default. As it is now, you can't go higher than the equivalent BW feat you have
<Ornedan> 1 -- Full PnP. Ignores the BW IPA
<Ornedan> PRC_POWER_ATTACK_STACK_WITH_BW
<Ornedan> 0 - Default. Allow people to use both at the same time
<Ornedan> 1 - Add the BW effects in when limiting to BAB
From prc_inc_switch.nss :
* A possible value of PRC_POWER_ATTACK.
* If this is used, PRC Power Attack is completely disabled. The feats will
* not be granted to players and even if they somehow gain access to the feats,
* they will have no effect.
*
* @see PRC_POWER_ATTACK
*/
const int PRC_POWER_ATTACK_DISABLED = -1;
PRC_POWER_ATTACK_DISABLED is a defined constant int value that you can apply to the PRC_POWER_ATTACK switch, so you need to set PRC_POWER_ATTACK to -1 for disabled, or 1 for full PNP or leave it for the default functionality at 0.
-
Thank you, especially for the power attack bit.
As for the first point, I know about C's 0 and not 0 behaviour. The issue wasn't so much if 0 == false and 1 == true, but whether the program is expecting a boolean or an integer.
And apparently it is expecting int. If you put in bool, the variable ends up being 0 regardless of whether you made it true or false. Either that or it goes back to default and that default just happened to be 0 on those few variables I tested it on.
Either way... useing int is the correct way to go. No bool in personal_switch.2da.