LANGUAGE alias for Player.DisplayName?

Moderator: GZDoom Developers

User avatar
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?

Post by Ed the Bat »

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.
User avatar
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?

Post by wildweasel »

Or, foreign language translations of Hexen could translate Fighter/Cleric/Mage into their language's equivalents without redefining all three.
User avatar
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?

Post by Ed the Bat »

Excellent point; I forgot to even consider that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49229
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: LANGUAGE alias for Player.DisplayName?

Post by Graf Zahl »

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.
User avatar
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?

Post by Ed the Bat »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49229
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: LANGUAGE alias for Player.DisplayName?

Post by Graf Zahl »

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.
User avatar
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?

Post by Ed the Bat »

I'll have to take your word for it, then... So would you recommend I not use LANGUAGE for my classes' names?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49229
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: LANGUAGE alias for Player.DisplayName?

Post by Graf Zahl »

What precisely do you do?
User avatar
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?

Post by Ed the Bat »

I do just what I was hoping to see done to DoomPlayer (and the other internal player classes)
In LANGUAGE:

Code: Select all

[enu default]
MYPLAYERNAME="My Player";
In DECORATE:

Code: Select all

ACTOR NewPlayer : PlayerPawn
{
	Player.DisplayName "$MYPLAYERNAME"
	...
}
I've seen no problems so far, but if you know of something I should be looking for...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49229
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: LANGUAGE alias for Player.DisplayName?

Post by Graf Zahl »

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!
User avatar
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?

Post by Ed the Bat »

Ah, I see. How disappointing... :(
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: LANGUAGE alias for Player.DisplayName?

Post by Arctangent »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49229
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: LANGUAGE alias for Player.DisplayName?

Post by Graf Zahl »

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.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: LANGUAGE alias for Player.DisplayName?

Post by Xaser »

I'd be all for such a change. It'd remove a persistent thorn for sure.
User avatar
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?

Post by Ed the Bat »

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.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”