[SOLVED] My customized player alias isn't working

Y4T5UR0
01 Jan 2020, 16:03So while I'm working on my project, I tried making something on a whim, and that includes making your own character name. To make it easier, I used a function, so it'll be like this:
msg ("Type in your name")
get input {
player.alias = result
ShowMenu ("\"{player.alias}\". Is this your name?", Split("Yes-No", "-"), false) {
if (result="Yes") {
//do change pov for yes
else {
//Function (from the very beginning of the code)
}
But then when I tried it, I see that the alias goes back to "player". I tried to search the problem, and I see that the codes are actually working without the menu. So I'm suspicious that the function is the one wrong here, but I'm not sure if I'm right or how to fix it. Please help >-<
mrangel
01 Jan 2020, 16:38Could the problem be with:
//do change pov for yes
Are you changing the POV here? (changing which object the player controls)
If so, you should be aware that doing so will automatically change the alias of both the old and new player objects. (It's why there is an "alias" field on both the 'Object' tab and the 'Player' tab in the GUI.
If you want to change the alias that an object is referred to by when the player is not controlling it, you need to set both alias
and external_alias
attributes. If you want to control the alias used when the player is controlling that character, you will need to set both alias
and pov_alias
(which I think is "you" by default).
If the line I quoted isn't changing POV, then I'm not sure what your comment means. The code you posted looks correct to me; so is it possible there's an error in the code represented by those comments? If possible, could you provide a link to a game for testing purposes?

Y4T5UR0
01 Jan 2020, 16:58Yes, now it's working right now! Thanks.
From the script orders in the function, it looks as if the pov change takes place after the name change, but as I tried before, it seems like it's not working. I was quite hesitant using external_alias attribute since it's not included in the player attribute but turns out it's working.
Thanks a lot!!
:D
I know this may be late but happy new year!
Wish you have a great year
mrangel
01 Jan 2020, 17:32When you change POV, this is roughly what happens:
newpov.external_alias = newpov.alias
- saving its alias for later usenewpov.alias = newpov.pov_alias
- changing its alias to "you" by default; from the 'player' taboldpov.alias = oldpov.external_alias
- so that if it's been renamed to "you", it changes back to what it was before the player took control
The same is true for pov_
and external_
versions of some other attributes: alt
, look
, gender
, and article
.