Getting Character Race
Ynnead
Member Posts: 3
Is there a way to get the race in a script?
It would be fine as a string or .2da line number. Using NWNXEE would also be fine, but didn't see a function in there either.
It seems to be easy to do in a conversation, but I can't find a way to access it inside a script. I don't know if its possible to pass from a conversation to a script, but I wouldn't be able to do this. I need some things done on client enter.
It would be fine as a string or .2da line number. Using NWNXEE would also be fine, but didn't see a function in there either.
It seems to be easy to do in a conversation, but I can't find a way to access it inside a script. I don't know if its possible to pass from a conversation to a script, but I wouldn't be able to do this. I need some things done on client enter.
0
Comments
https://nwnlexicon.com/index.php?title=Racial_type
Edit
Just to clarify that function will return the line number in the .2da or the constant in the .2da? I don't want to break feats like favored enemy, by having new races with the same racial type have different constants.
From testing I think that GetRacialType returns the line number in the .2da. The constant in the .2da is likely equal to the line number.
With that I think creating new races that should have the same racial type in racialtypes.2da (so they are selectable during character creation) already breaks things like favored enemy.
Does anyone have an idea on how to fix that?
If you use it on a "OnPlayerEquipItem" scipt:
int RacialType = GetRacialType(GetPCItemLastEquippedBy());
If you use it on a module "OnEnter" script:
int RacialType = GetRacialType(GetEnteringObject());
And so on, with that you will get the racial number on the racialtype.2da of the PC that triggered that event. The way on determining who triggered which event varies depending on each event.
You can get more information on all the events, and how to get who triggered them over here: https://nwnlexicon.com/index.php?title=Category:Events
As for the "Favored Enemy"part, well I've just noticed on that as well. It's not that it breaks it, it's just that we need to somehow to be able to specify (Either scripting or 2da, or something?) to tell that a new feat X is the one for Favored Enemy: Race X, but I totally understand where you want to get.
EDIT:
By the way, I think I get you now. You want to make a new race that has the SAME racial type as an already existing one? I believe that is not possible, and for that you would need to make Subraces. (Same RACIAL TYPE, different names for each)