Change character description

Post suggestions for improvements here.
Post Reply
sergeil
Duke
Duke
Posts: 250
Joined: Sat Mar 09, 2019 5:52 am

Change character description

Post by sergeil »

It would be great to have the way to change character description.
In fact, now it can be done only by deleting and creating character again.

Very often people do not change the description by mistake.
User avatar
Qui Chang
Baron
Baron
Posts: 59
Joined: Thu Aug 31, 2006 1:40 pm

Re: Change character description

Post by Qui Chang »

This is actually something that could be done pretty easily via the OnPlayerChat event.
An example:

Code: Select all

else if (GetStringLeft(sSaid, 5) == "/bio ")
        {
            string sRemove = StringParse(sSaid, " ");
            string sBio = StringRemoveParsed(sSaid, sRemove, " ");
            SendMessageToPC(oSpeaker, "You have reset your current bio.");
            SetDescription(oSpeaker, sBio);
            //ExportSingleCharacter(oSpeaker);
        }
In this case you would just type "/bio "(with the space) followed by whatever you want your bio to be. Something like: "/bio You hail from the far off lands of Hufflepuff and have decided to set off in search of a better house."
"When the student is ready.....the master appears" Old Zen Saying
sergeil
Duke
Duke
Posts: 250
Joined: Sat Mar 09, 2019 5:52 am

Re: Change character description

Post by sergeil »

I don't mean so radical. IMHO, changing gender of character is too much. I propose just changing of it's description. Name of function is like SetDescription(object, string, int). I can see it in my test location to be sure, because I already tried it.
https://nwnlexicon.com/index.php?title=SetDescription

PS: Maybe, it would be good to have item to activate this functionality or dummy in some placy like dummy to change appearance of weapon or armor.
User avatar
Qui Chang
Baron
Baron
Posts: 59
Joined: Thu Aug 31, 2006 1:40 pm

Re: Change character description

Post by Qui Chang »

sergeil wrote: Mon Feb 21, 2022 12:57 am I don't mean so radical. IMHO, changing gender of character is too much. I propose just changing of it's description. Name of function is like SetDescription(object, string, int). I can see it in my test location to be sure, because I already tried it.
https://nwnlexicon.com/index.php?title=SetDescription

PS: Maybe, it would be good to have item to activate this functionality or dummy in some placy like dummy to change appearance of weapon or armor.
What I posted above doesn't change gender. That's "bio" as in "biography" AKA player description.
"When the student is ready.....the master appears" Old Zen Saying
sergeil
Duke
Duke
Posts: 250
Joined: Sat Mar 09, 2019 5:52 am

Re: Change character description

Post by sergeil »

Qui Chang wrote: Sat Feb 19, 2022 10:33 pm

Code: Select all

if (GetStringLeft(sSaid, 5) == "/bio ")
{
...
}
I was not able to find function how to read text string from talk window. As I understand, it is part of conversation.
Can you post small example? How you receive text to sSaid variable?
User avatar
driller
Site Admin
Site Admin
Posts: 4798
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Re: Change character description

Post by driller »

I went and added a function like this. Type /bio=Enter your text here.
User avatar
driller
Site Admin
Site Admin
Posts: 4798
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Re: Change character description

Post by driller »

https://nwnlexicon.com/index.php?title=GetPCChatMessage
sergeil wrote: Tue Feb 22, 2022 12:45 pm
Qui Chang wrote: Sat Feb 19, 2022 10:33 pm

Code: Select all

if (GetStringLeft(sSaid, 5) == "/bio ")
{
...
}
I was not able to find function how to read text string from talk window. As I understand, it is part of conversation.
Can you post small example? How you receive text to sSaid variable?
sergeil
Duke
Duke
Posts: 250
Joined: Sat Mar 09, 2019 5:52 am

Re: Change character description

Post by sergeil »

Thank you very much
sergeil
Duke
Duke
Posts: 250
Joined: Sat Mar 09, 2019 5:52 am

Re: Change character description

Post by sergeil »

it could be great if it can be realized /bio+, means, append string from new line

As example

/bio=-The Family Clan-
/bio+Good girl from great family

----------------------------------------
-The Family Clan-
Good girl from great family
----------------------------------------

In case of
/bio+
means new line to append


/bio=-The Family Clan-
/bio+
/bio+Good girl from great family

----------------------------------
-The Family Clan-

Good girl from great family
----------------------------------
Post Reply