Player Resource Consortium


Author Topic: personal_switch.2da questions  (Read 1887 times)

0 Members and 1 Guest are viewing this topic.

June 03, 2018, 05:12:52 AM
  • Adept
  • *
  • Posts: 14
  • Karma: +0/-0
  • New Member
    • View Profile

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:

But then why is there a line const string PRC_POWER_ATTACK                        = "PRC_POWER_ATTACK"; ? Do I need to set that too?
« Last Edit: June 03, 2018, 05:34:34 AM by -Norbert- »

June 08, 2018, 03:19:59 AM
Reply #1

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> 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.

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.

June 09, 2018, 06:12:32 AM
Reply #2
  • Adept
  • *
  • Posts: 14
  • Karma: +0/-0
  • New Member
    • View Profile

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.