Here's what I recently gave in response to a pm:
As for a GetFirstName function, you have to use nwnx to do it properly,
though there are workarounds that work for most names, by using spaces
to guess it. Here is one such function by Axe Murderer:
string GetFirstName(object oCreature) {
if (!GetIsObjectValid(oCreature))
return "";
string sName = GetName(oCreature);
int iPos = FindSubString(sName, " ");
if (iPos < 0)//if there's no space, FSS returns -1, return the full name
return sName;
while(iPos == 0) {
sName = GetStringRight(sName, GetStringLength(sName) -1);
iPos = FindSubString(sName, " ");
}
return ((iPos < 0) ? sName : GetStringLeft(sName, iPos));
}