Page 1 of 1

<random> name manualy

Posted: Mon May 05, 2008 8:27 am
by BELL
i based player merchants on WoD scripts, i have:

npcdecs.cfg

Code: Select all

NpcTemplate playermerchant
{
	Name			<random>
	script		playermerchant
	ObjType		0x190
	Color		33784
	TrueColor....
and script part:

Code: Select all

	var parms := {};
	if (!gender)
		SendSysMessage (character, "Canceled.");
		return;
	elseif (gender.index == 1)
		parms.+gender := 0;
	elseif (gender.index == 2)
		parms.+gender := 1;
	else
		parms.+gender := RandomInt (2);
		parms.+name := "<random>";
		set_critical (1);
		var merchant := CreateNpcFromTemplate (":player_merchants:playermerchant", where.x, where.y, where.z, parms);
NPC name really is <random>.... help?

Posted: Mon May 05, 2008 11:02 am
by coltain
now readconfigfile(file with list of names); //(::names - as i presume)

then choose randomly from it and set it as a parm

Posted: Mon May 05, 2008 12:30 pm
by BELL
aa.. im including include/randName from distro pack and

Code: Select all

		var merchant := CreateNpcFromTemplate (":player_merchants:playermerchant", where.x, where.y, where.z, parms);
		if (!merchant)
			SendSysMessage (character, "Can't place there.");
			return;
		endif
		SetName(merchant, RandomName(merchant));
has no effect...

thx, im go coding.. load names and etc..

Posted: Mon May 05, 2008 1:06 pm
by BELL
heh, read this fu**ng debug.log :)
in include/randName im replacing "names" on "::names" :)
its worked...