Creating custom Races?
#1
Posté 19 juillet 2011 - 10:17
#2
Posté 19 juillet 2011 - 10:57
One of the files there for download is a tutorial on how it works. I was able to do things on my first try.
#3
Posté 19 juillet 2011 - 11:07
#4
Posté 18 mai 2013 - 12:31
The following data with the according entries are available (and these custom races are choosable and playable on Charater Creation):
racialtypes.2DA
47 Draconian Constant: RACIAL_TYPE_DRACONIAN
racialsubtypes.2DA
74 Kapak Constant: RACIAL_SUBTYPE_DRACONIAN
custom tlk
Now, in the toolset, these custom constants don't show up (HAKs + tlk are asigned to the mod)!
If I uncheck the "Show System Globals" box, no constants are displayed.
So, if I script something like:
if (GetRacialType(oPC) == RACIAL_TYPE_DRACONIAN), it's not compiled.
(Remark: The script works, if I set it to a default race, like RACIAL_TYPE_HUMAN and enter with a human.)
So, how do I detect a custom race/subrace in an OnEnter-script / how do I make the toolset to recongnize custom constants?
Edit: If I define this contant (RACIAL_TYPE_DRACONIAN) in an eg. include script, will this be the connection to the constants defined within the racial...2da-s?
Modifié par TheOneBlackRider, 18 mai 2013 - 01:12 .
#5
Posté 18 mai 2013 - 01:39
int RACIAL_TYPE_ELF = 1;
eg, means row 1 in racialtypes.2da
int RACIAL_SUBTYPE_MOON_ELF = 4;
eg, means row 4 in racialsubtypes.2da
The extra sub/races may be defined in an include or script, to avoid using a number, but need to remain consistent with the .2da's
edit, If RACIAL_TYPE_DRACONIAN is row#47, this should compile and detect that:
if (GetRacialType(oPC) == 47)
Modifié par kevL, 18 mai 2013 - 02:24 .
#6
Posté 18 mai 2013 - 04:13
Refering to the row# works like a charm, regardless of the naming of the according constant in the 2da.
No include script is needed!
Even works nicely with the subrace:
if (GetSubRace(oPC) == [row# in racialsubtypes.2DA])
Thank you kevL!
#7
Posté 18 mai 2013 - 04:56
( Even if the constant isn't defined other than in the .2da, it's nice to have a comment what it is, like
if (GetRacialType(oPC) == 47) // RACIAL_TYPE_DRACONIAN
saves headscratching later,
#8
Posté 19 mai 2013 - 10:08
Yup, that's exactly, what I did!
Just for clarification (and I didn't have the time to test):
IF I want to use eg. "RACIAL_TYPE_DRACONIAN" instead of "47", will I need to set something like:
int RACIAL_TYPE_DRACONIAN = 47; in a (include or whatever) script, before it works within the toolset/game (even if it's defined within the 2da)?
And (maybe a stupid question) subrace-constant names should be individualized within the 2da to make sense, right? (ATM I just used the row# and ignored the contant naming - they are all the same for 3 subraces - and that works fine).
#9
Posté 19 mai 2013 - 10:42
yep. It can even be put like that above "void main()", along where #includes are usually listed.TheOneBlackRider wrote...
Just for clarification (and I didn't have the time to test):
IF I want to use eg. "RACIAL_TYPE_DRACONIAN" instead of "47", will I need to set something like:
int RACIAL_TYPE_DRACONIAN = 47; in a (include or whatever) script, before it works within the toolset/game (even if it's defined within the 2da)?
You're referring to the "Label" column(s)? Am quite sure that column is only for human-readabilityAnd (maybe a stupid question) subrace-constant names should be individualized within the 2da to make sense, right? (ATM I just used the row# and ignored the contant naming - they are all the same for 3 subraces - and that works fine).
#10
Posté 20 mai 2013 - 10:00
kevL wrote...
TheOneBlackRider wrote...
You're referring to the "Label" column(s)? Am quite sure that column is only for human-readabilityAnd (maybe a stupid question) subrace-constant names should be individualized within the 2da to make sense, right? (ATM I just used the row# and ignored the contant naming - they are all the same for 3 subraces - and that works fine).
ATM in the racialsubtypes.2da, it says:
Label Constant
71 Baaz RACIAL_SUBTYPE_DRACONIAN
72 Bozak RACIAL_SUBTYPE_DRACONIAN
73 ...
74 Kapak RACIAL_SUBTYPE_DRACONIAN
As written: Using row#
works well. But to have it clean and open to use constant names, it
would make sense to name individually name the entries here, too (eg.
RACIAL_SUBTYPE_BAAZ, RACIAL_SUBTYPE_BOZAK, etc.), doesn't it?
Modifié par TheOneBlackRider, 20 mai 2013 - 10:03 .
#11
Posté 21 mai 2013 - 03:28
i guess you can test that column if you want to, by assigning the RACIAL_SUBTYPE_*
but I'm tending to the opinion it won't matter ... up to you, sir, although in some dim corner somewhere it could be getting referenced
#12
Posté 21 mai 2013 - 04:41
#13
Posté 21 mai 2013 - 01:58
So I'll will individualize the subrace contants to be on the safe side (doesn't hurt) and stick with the row# to do the job, since that works nicely.





Retour en haut






