LANGUAGE alias for Player.DisplayName?
Moderator: GZDoom Developers
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
LANGUAGE alias for Player.DisplayName?
I know this is a rather esoteric request, but I would imagine it's very simple to implement... Could the Player.DisplayName properties of the player classes in zdoom.pk3 be externalized to LANGUAGE? With this, one could rename the classes without actually defining a new actor by simply changing one LANGUAGE string. For instance, a project that gives the player a new story role could have him appear as something other than "Marine" in the player setup menu without having to make a new actor to replace him; a simpler way to add just a touch of flavor.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
Or, foreign language translations of Hexen could translate Fighter/Cleric/Mage into their language's equivalents without redefining all three.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
Excellent point; I forgot to even consider that.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49229
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: LANGUAGE alias for Player.DisplayName?
Sadly not. Despite the term 'Displayname' this property is used for other purposes as well which should have been using the class name in the first place.
I'd really like to change this design bug, but that'd break pretty much any player mod out there.
I'd really like to change this design bug, but that'd break pretty much any player mod out there.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
What kind of things would break? I've successfully made player classes that reference a LANGUAGE string in their DisplayName, and didn't notice problems. What should I be looking out for?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49229
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: LANGUAGE alias for Player.DisplayName?
The entire player class selection is done via display name. If that gets replaced by a LANGUAGE lookup it'd all fall apart.
I have no idea why Grubber implemented it this way as it's completely stupid.
I have no idea why Grubber implemented it this way as it's completely stupid.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
I'll have to take your word for it, then... So would you recommend I not use LANGUAGE for my classes' names?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49229
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: LANGUAGE alias for Player.DisplayName?
What precisely do you do?
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
I do just what I was hoping to see done to DoomPlayer (and the other internal player classes)
In LANGUAGE:
In DECORATE:
I've seen no problems so far, but if you know of something I should be looking for...
In LANGUAGE:
Code: Select all
[enu default]
MYPLAYERNAME="My Player";
Code: Select all
ACTOR NewPlayer : PlayerPawn
{
Player.DisplayName "$MYPLAYERNAME"
...
}
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49229
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: LANGUAGE alias for Player.DisplayName?
That's basically fine. The language lookup is only used in the menu.
The problem I was talking about is that I cannot retroactively change current player names because it'd break all mods out there, for the simple reason that some parts of the code use the 'display'-name for identification purposes - and expose this to some definition lumps!
The problem I was talking about is that I cannot retroactively change current player names because it'd break all mods out there, for the simple reason that some parts of the code use the 'display'-name for identification purposes - and expose this to some definition lumps!
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
Ah, I see. How disappointing... 

- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
Perhaps this could be better resolved by the addition of Player.NiceName or making Tag functional on player classes, which will override the name on the menu if defined? It's definitely kind of silly that that's a direction this would be required to take, but the simpler option is clearly unavailable due to poor implementation.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49229
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: LANGUAGE alias for Player.DisplayName?
I think you are correct. The best option would probably be to officially deprecate the 'displayname' property, wrap all accesses into some functions, add a new property solely for display and use the class name in other places and the old 'displayname' only in the places where it's necessary but fall back to the class name if none is specified. But that'd require some serious thinking.
Re: LANGUAGE alias for Player.DisplayName?
I'd be all for such a change. It'd remove a persistent thorn for sure.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: LANGUAGE alias for Player.DisplayName?
That would be just fine with me. I'd even retract my feature suggestion from last year to make Tag default to DisplayName, if it would be considered the new 'proper' method for nice names.