NWNX_RACE_SHOW_EFFECT_ICON
- Helpful when debugging, this shows the effect's icon (the red and green squares). Some builders may even wish this permanently.
Adding new races is beyond the scope of this documentation. The builder should know how to add new races by adding a new entry in the racialtypes.2da
as well as adding the appropriate TLK reference identifiers for that new race then adjusting the appropriate columns for their race, including the Ability Score modifications.
The NWNX Race plugin does not provide modifications to ability scores, use the racialtypes.2da
columns for changing those.
To use the 2da method, the builder must create a new column at the end of the racialtypes.2da
named RacialModsTable. This column should then be populated with a string value that references another 2da file in which we will define our racial modifiers. Once that is done the builder needs to include nwnx_race_2da and make sure to run NWNX_Race_LoadRacialModifiers()
in their OnModuleLoad script.
For example, we've inserted a new race called Aasimar into racialtypes.2da
at line 150. In the RacialModsTable
column we enter RACEMOD_AASIMAR (Remember maximum 16 characters, case insensitive)
We will now create and define our racemod_aasimar.2da
file and enter appropriate lines for each modifier they will receive. The end result will look something like this:
The scripting method involves running a command for each race and each modifier OnModuleLoad.
The end result for the Aasimar using the script method would be something like:
The AB
entry is used to modify an attack bonus for a race. Note: this is not a change to the base attack bonus, it's added on top of that.
The ABVSRACE
entry is used to modify the attack bonus for a race versus another specific race.
The AC
entry is used to modify the base AC for a race.
The ACVSRACE
entry is used to modify the base AC for a race versus another specific race.
The CONCEALMENT
entry is used to grant an inate concealment to a race.
The DMGREDUCTION
entry gives an inate damage reduction
The DMGRESIST
entry gives an inate resistance to damage types
The DMGIMMUNITY
entry gives an inate immunity to damage types
The FEAT
entry awards a feat at a specified level. This feat is awarded after the creature levels up. Level 1 feats can still be added using the FeatsTable column of the racialtypes.2da
.
The FEATUSAGE
controls the amount of usages a race will have based upon their character level for a custom feat they are granted.
The IMMUNITY
entry is used to grant the race a total immunity to a variety of effects.
The INITIATIVE
entry is used to modify the initiative check.
The MOVEMENTSPEED
can modify the speed at which the race moves by default.
The RACE
entry is used when the race the builder is adding has a parent race with which to inherit some hard coded checks. For example, a Ghostwise Halfling would have its RACE
set as 3
representing the Halfling race and in turn a player with that race would have an additional +1 to ranged attacks as is set for the Halfling race.
The REGENERATION
entry is used to grant the race an inate regeneration.
The SAVE
entry is used to modify base save values.
The SAVEVSRACE
entry is used to modify base save values vs a specific race. Param1 is the Save constant ID and param2 is the target race constant ID and param3 is the modifier.
The SAVEVSTYPE
entry is used to modify base save values vs a specific type. Param1 is the Save constant ID and param2 is the Saving Throw Type constant ID and param3 is the modifier.
The SKILL
entry is used to modify base skill ranks. Note: This requires the NWNX_SkillRanks
plugin.
The SPELLIMMUNITY
entry is used to grant the race a total immunity to specific spells. Note: Only spells that can be resisted can have immunities.
The SRCHARGEN
entry is used to award the race a default spell resistance on character creation.
The SRINCLEVEL
entry is used to award a spell resistance racial bonus as the creature's level increases.
Files | |
file | nwnx_race.nss |
file | nwnx_race_2da.nss |
Parse a column in the racialtypes.2da to load the modifiers. | |
Functions | |
void | NWNX_Race_SetRacialModifier (int iRace, int iMod, int iParam1, int iParam2=0xDEADBEEF, int iParam3=0xDEADBEEF) |
Sets a racial modifier. More... | |
int | NWNX_Race_GetParentRace (int iRace) |
Gets the parent race for a race. More... | |
void | NWNX_Race_SetFavoredEnemyFeat (int iRace, int iFeat) |
Associates the race with its favored enemy feat. More... | |
void | NWNX_Race_SuppressCreatureRaceEffects (object oCreature) |
Removes any nwnx_race 'Effects' on the targeted creature. Suppression lasts until levelup, next login, or Reactivated by function. More... | |
void | NWNX_Race_ReactivateCreatureRaceEffects (object oCreature) |
Reactivates the nwnx_race 'Effects' on the targeted creature after they were Suppressed. More... | |
int | NWNX_Race_GetModifierConstant (string raceMod) |
Translate a modifier type from a string to its constant. More... | |
void | NWNX_Race_LoadRacialModifiers (string sColumnName="RacialModsTable") |
Loops through racialtypes.2da and checks for the column for racial modifications and sets them. More... | |
void NWNX_Race_SetRacialModifier | ( | int | iRace, |
int | iMod, | ||
int | iParam1, | ||
int | iParam2 = 0xDEADBEEF , |
||
int | iParam3 = 0xDEADBEEF |
||
) |
Sets a racial modifier.
iRace | The RACIALTYPE_ constant or value in racialtypes.2da. |
iMod | The racial modifier to set. |
iParam1,iParam2,iParam3 | The parameters for this racial modifier. |
Definition at line 69 of file nwnx_race.nss.
int NWNX_Race_GetParentRace | ( | int | iRace | ) |
Gets the parent race for a race.
iRace | The race to check for a parent. |
Definition at line 82 of file nwnx_race.nss.
void NWNX_Race_SetFavoredEnemyFeat | ( | int | iRace, |
int | iFeat | ||
) |
Associates the race with its favored enemy feat.
iRace | The race |
iFeat | The feat |
Definition at line 92 of file nwnx_race.nss.
void NWNX_Race_SuppressCreatureRaceEffects | ( | object | oCreature | ) |
Removes any nwnx_race 'Effects' on the targeted creature. Suppression lasts until levelup, next login, or Reactivated by function.
oCreature | The creature to suppress |
Definition at line 102 of file nwnx_race.nss.
void NWNX_Race_ReactivateCreatureRaceEffects | ( | object | oCreature | ) |
Reactivates the nwnx_race 'Effects' on the targeted creature after they were Suppressed.
oCreature | The creature to reactive |
Definition at line 110 of file nwnx_race.nss.
int NWNX_Race_GetModifierConstant | ( | string | raceMod | ) |
Translate a modifier type from a string to its constant.
raceMod | The string representation of the constant. |
Definition at line 18 of file nwnx_race_2da.nss.
void NWNX_Race_LoadRacialModifiers | ( | string | sColumnName = "RacialModsTable" | ) |
Loops through racialtypes.2da and checks for the column for racial modifications and sets them.
sColumnName | The column name in the racialtypes.2da that defines the 2da for the racial mods. |
Definition at line 45 of file nwnx_race_2da.nss.
const int NWNX_RACE_MODIFIER_INVALID = 0 |
Definition at line 13 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_AB = 1 |
Definition at line 14 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_ABVSRACE = 2 |
Definition at line 15 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_AC = 3 |
Definition at line 16 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_ACVSRACE = 4 |
Definition at line 17 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_CONCEALMENT = 5 |
Definition at line 18 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_DMGIMMUNITY = 6 |
Definition at line 19 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_DMGREDUCTION = 7 |
Definition at line 20 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_DMGRESIST = 8 |
Definition at line 21 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_FEAT = 9 |
Definition at line 22 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_FEATUSAGE = 10 |
Definition at line 23 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_IMMUNITY = 11 |
Definition at line 24 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_INITIATIVE = 12 |
Definition at line 25 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_MOVEMENTSPEED = 13 |
Definition at line 26 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_RACE = 14 |
Definition at line 27 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_REGENERATION = 15 |
Definition at line 28 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SAVE = 16 |
Definition at line 29 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SAVEVSRACE = 17 |
Definition at line 30 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SAVEVSTYPE = 18 |
Definition at line 31 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SKILL = 19 |
Definition at line 32 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SPELLIMMUNITY = 20 |
Definition at line 33 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SRCHARGEN = 21 |
Definition at line 34 of file nwnx_race.nss.
const int NWNX_RACE_MODIFIER_SRINCLEVEL = 22 |
Definition at line 35 of file nwnx_race.nss.