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!
了解更多
Accendo 2019 年 5 月 2 日 上午 8:22
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!
最后由 Accendo 编辑于; 2019 年 5 月 2 日 上午 8:23
< >
正在显示第 1 - 3 条,共 3 条留言
Proleric 5 2019 年 5 月 2 日 上午 8:53 
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 2019 年 5 月 2 日 上午 9:14 
You are awesome! I can't believe I was being that stupid. Thank you very much!
findstr /s "hi" c:\* 2019 年 9 月 16 日 上午 11:56 
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.
最后由 findstr /s "hi" c:\* 编辑于; 2019 年 9 月 16 日 下午 12:29
< >
正在显示第 1 - 3 条,共 3 条留言
每页显示数: 1530 50