Aller au contenu

Photo

Creating custom Races?


  • Veuillez vous connecter pour répondre
12 réponses à ce sujet

#1
ShadowWarrior12

ShadowWarrior12
  • Members
  • 10 messages
 Hey there everyone. I've been looking on the net for a guide or any information on how to build custom races. But of course, I've had very little luck, and all I seem to find is the first games guides. I was wonering if anyone knew of a guide, or could possibly give me a small explanation on how to, it would be great. Thanks for reading!

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Use this program (works outside of Toolset): http://nwvault.ign.c...r.Detail&id=116

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
ShadowWarrior12

ShadowWarrior12
  • Members
  • 10 messages
Thanks a lot Knigtmare.

#4
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
I want to check for a cutsom race/subrace in a script.
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
kevL

kevL
  • Members
  • 4 056 messages
the constants refer back to the row# in each .2da

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
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Fast answer, so I was able to continue to tinker and:

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
kevL

kevL
  • Members
  • 4 056 messages
hey yer welcome.

( 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
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Sorry for the slow reply. Busy day...

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
kevL

kevL
  • Members
  • 4 056 messages

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)?

yep. It can even be put like that above "void main()", along where #includes are usually listed.


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

You're referring to the "Label" column(s)? Am quite sure that column is only for human-readability :)

#10
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Thanks for clarification on part 1 :)

kevL wrote...

TheOneBlackRider wrote...


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

You're referring to the "Label" column(s)? Am quite sure that column is only for human-readability :)


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
kevL

kevL
  • Members
  • 4 056 messages
oh ok, didn't see that

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
Dann-J

Dann-J
  • Members
  • 3 161 messages
I also suspect that 'Constant' column does squat. It might have been a handy reference for developers, or something left over from NWN1. It seems that half of the columns in the 2DAs (probably more than half) do nothing in NWN2.

#13
TheOneBlackRider

TheOneBlackRider
  • Members
  • 379 messages
Thanks people!
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.