Access System's Username

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Access System's Username

Post by cawmageddon »

Hi All,

I'm making a horror wad and I think it'd be cool to break the fourth wall at one point and have a demon address the player by their real name, or at least the name of their user account in their system.
Since gzdoom is running C/C++ this should be easy to implement for windows and linux, right?
Any help is appreciated :)
yum13241
Posts: 852
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support

Re: Access System's Username

Post by yum13241 »

But that's not exposed in ZScript. Just because it's possible in C++ doesn't mean we'll get to see it in ZScript.
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: Access System's Username

Post by cawmageddon »

yum13241 wrote: Thu May 25, 2023 11:00 am But that's not exposed in ZScript. Just because it's possible in C++ doesn't mean we'll get to see it in ZScript.
Oh nooooooo :{
Do you have any idea how one might go about implementing it?
yum13241
Posts: 852
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support

Re: Access System's Username

Post by yum13241 »

No, but you can use the player name.
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: Access System's Username

Post by cawmageddon »

Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
User avatar
Chris
Posts: 2950
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Access System's Username

Post by Chris »

cawmageddon wrote: Sun May 28, 2023 7:50 am Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
Given the wide range of styles a person can set their system username with, that may not be any better. Depending on what it's set to, it may even come across as confusing, with the player not realizing it was meant to address them rather than a using a generic word or name. The system username may be better thought of as a unique (for the system) identifier or title, rather than a name you'd address someone with in conversation.
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

Re: Access System's Username

Post by wildweasel »

cawmageddon wrote: Sun May 28, 2023 7:50 am Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
Your mod would end up addressing me as "wildw" or "owner" which wouldn't really work either.
User avatar
ramon.dexter
Posts: 1558
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Access System's Username

Post by ramon.dexter »

Yeah, another attempt on jumpscare wad, just to be completely fade away like a year later.
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: Access System's Username

Post by cawmageddon »

Chris wrote: Sun May 28, 2023 2:16 pm
cawmageddon wrote: Sun May 28, 2023 7:50 am Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
Given the wide range of styles a person can set their system username with, that may not be any better. Depending on what it's set to, it may even come across as confusing, with the player not realizing it was meant to address them rather than a using a generic word or name. The system username may be better thought of as a unique (for the system) identifier or title, rather than a name you'd address someone with in conversation.
Hm, yeah that's a good point,.,.. :oops:
Alright, well I might still play around with it and see if I can get it working as a zdoom learning exercise, but not actually use it in a map.
Thanks to everyone who replied <3
yum13241
Posts: 852
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support

Re: Access System's Username

Post by yum13241 »

cawmageddon wrote: Sun May 28, 2023 7:50 am Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
What I meant was getting the name CVar. That is the name the player uses in game.
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: Access System's Username

Post by cawmageddon »

yum13241 wrote: Tue May 30, 2023 8:08 am
cawmageddon wrote: Sun May 28, 2023 7:50 am Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
What I meant was getting the name CVar. That is the name the player uses in game.
Oh, I thought you meant GetUserName() from the Player struct
User avatar
inkoalawetrust
Posts: 75
Joined: Mon Aug 26, 2019 9:18 pm
Graphics Processor: nVidia with Vulkan support

Re: Access System's Username

Post by inkoalawetrust »

cawmageddon wrote: Tue May 30, 2023 7:03 pm
yum13241 wrote: Tue May 30, 2023 8:08 am
cawmageddon wrote: Sun May 28, 2023 7:50 am Hm, I want to create a sense of horror so having the demon address the player as "PLAYER1" won't really have the same impact.
What I meant was getting the name CVar. That is the name the player uses in game.
Oh, I thought you meant GetUserName() from the Player struct
Yeah, that's what yum is talking about, the GetUsername() method gets the name CVAR of the player whose struct belongs to.
ramon.dexter wrote: Mon May 29, 2023 2:39 am Yeah, another attempt on jumpscare wad, just to be completely fade away like a year later.
And ? Most maps aren't unforgettable masterpieces that will be fondly remembered for years to come.
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: Access System's Username

Post by cawmageddon »

inkoalawetrust wrote: Wed Jun 14, 2023 9:35 am Yeah, that's what yum is talking about, the GetUsername() method gets the name CVAR of the player whose struct belongs to.
Oh, thank you ! :oops:

Return to “Scripting”