Neverwinter Nights: Enhanced Edition

Neverwinter Nights: Enhanced Edition

Adventures await!
Gather your mods before venturing forth. Discover planes filled with player-created adventures in Steam Workshop, then build your own Neverwinter Nights modules using the Aurora Toolset to share!
Learn More
Help with Random Name scrip
Hi all! Just getting in to the nwn modding scene... loved nwn back in the day and it is pretty awesome to learn it is on steam.

Anyway, I am trying to get the random name script.. the one found on the wiki to work.
https://nwn.fandom.com/wiki/Random_NPC_name_generator

Anyway, it gives explicit instructions : "The random NPC name generator produces a random name for an NPC, customized to the NPC's race and gender. To use this in conjunction with the default OnSpawn event handler, the following script should be named "x3_name_gen". Each NPC whose name should be generated with this script needs to have a local variable set on them in the Toolset. The local variable's name must be "X2_NAME_RANDOM", its type must be "integer", and its value must be 1."

I created a new script and named it "x3_name_gen" and then I created a local variable on the NPC (through the advanced tab on the editor). I dont understand how to make it work from there. Do I attach the script to the onspawn section of the npc? Do I need to write a new script to put in the onspawn?

Sorry for the newbie questions. Any assistance is appreciated.

Cheers!
Last edited by Accendo; May 2 @ 8:23am
< >
Showing 1-3 of 3 comments
You shouldn't need to do anything else.

If the creature is using the regular on spawn script (nw_c2_default9) or the x2 script that calls it, x3_name_gen will be executed.
Accendo May 2 @ 9:14am 
You are awesome! I can't believe I was being that stupid. Thank you very much!
void main()
{
string name = RandomName(NAME_FIRST_GENERIC_MALE);
SetName(OBJECT_SELF,name);
}

this is the most simple script...

NAME_FIRST_GENERIC_MALE
is a constant,they are located in the constants tab in the script editor.
there are also constants for elf,dwarf,male,female,last-name etc....

always save your scripts under a different name,so they wont be the default script.
just do not name them the default,or you will overwrite those for the entire module you working on.

i do not know how to do a first and last name though.

optional,you could just add:
ExecuteScript("CompiledScriptName",OBJECT_SELF);
so you can run any script anytime you want.

i have just finished a random name+appearance script myself...

int number = Random(int max-number);
is very handy.

all my unimportant NPC's have a random appearance..not just a random name.
they also say 10 different random things when you talk to them.
Last edited by KustUuwKussenNog?; Sep 16 @ 12:29pm
< >
Showing 1-3 of 3 comments
Per page: 15 30 50