Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

Handle NPC names through script

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Handle NPC names through script

Post by JakSparro98 » Mon Nov 27, 2017 10:47 pm

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)
0 x

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1884
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 34

Post by Gurt » Tue Nov 28, 2017 12:09 am

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 :)
2 x
Gurt

User avatar
JakSparro98
Superfighter
Superfighter
Posts: 530
Joined: Fri Jul 15, 2016 7:56 pm
Started SFD: PreAlpha 1.0.5
Location: Rome, Italy
Gender:
Age: 25

Post by JakSparro98 » Tue Nov 28, 2017 12:25 am

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 ;)
1 x

Post Reply