Page 1 of 1

Handle NPC names through script

Posted: Mon Nov 27, 2017 10:47 pm
by JakSparro98
I would suggest a couple of quite obvious addition (that maybe are already planned but since the last small update didn't covered that lacks I will post it anyway) regarding the handling of the NPC's names through code:

An overload of the existent Game.CreatePlayer with the possibility to specify the name of the player.
Game.CreatePlayer(Vector2 worldPosition, string PlayerName);
Access the Name field of the IObjectPlayerSpawnTrigger.
IObjectPlayerSpawnTrigger.GetPlayerName();
The first suggestion could also be replaced by an addition for the IPlayer class that provides a method for setting the NPC name.

Also I want to ask, what the profile ID in the profile info is supposed to do?
I thought it was for assigning a name to the player using that profile, but the user ID and name are two distinct variables.
What is the meaning of having an ID for the profile and another ID for the profile info object? (that, moreover, when I try to click on the button on the right of the profile ID field I get some kind of random names, more similar to be NPC names instead of IDs)

Re: Handle NPC names through script

Posted: Tue Nov 28, 2017 12:09 am
by Gurt
Handling of NPC names have gone through some recent changes to allow for custom names. Guess we missed the option to change it directly through code. The profile ID is left-over junk and isn't used for anything. We can't think of everything :)

Re: Handle NPC names through script

Posted: Tue Nov 28, 2017 12:25 am
by JakSparro98
Gurt wrote:
Tue Nov 28, 2017 12:09 am
[..]We can't think of everything :)
The thread wasn't supposed to mortify you, I just wanted to know the purposes of things I really can not understand the uses.
Take this thread just as a reminder, even because you cannot think of everything, it's completely legitimate, my only worry was that my behavior could make me look like a pain in the ass.

By the way,I would really like to see the random name generator as an standalone method for populating NPC names faster, it would be a pity to throw away a so good nordic names generator ;)