world.ReadNamesFile

MUSHclient script function (Method)

Loads in a file for generating character names

Prototype

long ReadNamesFile(BSTR FileName);

Data type meanings

Description

This is used to load in a file of character names for the random name generator.

The names file should be loaded before calling GenerateName.

The file should contain lines with "[start]", "[middle]", "[end]" and "[stop]" in it (see below for example). Using the example file below, a generated name might be Wicorebwyn (Wic - ore - bwyn). By setting up different files you can generate names with a different "feel" to them.

Example names file:

[start]
A
Ab
Ac
Ad
W
Wic
[middle]
a
ae
ore
u
y

[end]
a
and
b
bwyn
baen
bard
[stop]

VBscript example

world.readnamesfile "mynames.nam"

Jscript example

world.readnamesfile("mynames.nam");

PerlScript example

$world->readnamesfile("mynames.nam");

Python example

world.readnamesfile("mynames.nam")

Lua example

ReadNamesFile ("mynames.nam")

Return value

eNoNameSpecified: File name cannot be blank
eCouldNotOpenFile: Could not open file, or file was not a valid names file
eOK: Processed file OK

Return code meanings

Related topic

Utilities

See also

FunctionDescription
GenerateNameGenerates a random character name