Changing crosshair via ACS?

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!)

Changing crosshair via ACS?

Postby Bilbö Bägginson » Wed May 25, 2022 11:40 am

Is it possible to set crosshair or change its scale or transparency via ACS?
Last edited by Bilbö Bägginson on Fri Jun 03, 2022 10:06 pm, edited 1 time in total.
User avatar
Bilbö Bägginson
 
Joined: 30 Nov 2020
Discord: Bilbö Bägginson#4376
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Changing crosshair via ACS

Postby R4L » Wed May 25, 2022 1:36 pm

I don't think it's possible in ACS unless you fake it with HUDMessages. Even then, you'd probably be better off using ZScript instead.
User avatar
R4L
Barry Burton - I have THIS
 
Joined: 03 Mar 2017
Discord: R4L#4655
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Changing crosshair via ACS

Postby Bilbö Bägginson » Wed May 25, 2022 1:50 pm

[quote="R4L"you'd probably be better off using ZScript instead.[/quote]
Okey, but can I set crosshair outside of weapon states. I dont know zscript at all, sorry if it`s stupid
User avatar
Bilbö Bägginson
 
Joined: 30 Nov 2020
Discord: Bilbö Bägginson#4376
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Changing crosshair via ACS

Postby Rachael » Wed May 25, 2022 2:50 pm

You can provide replacement graphics (basically null textures) for the existing internal engine crosshairs, and then HudMessage your own in onto the middle of the screen.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: Changing crosshair via ACS

Postby Bilbö Bägginson » Thu May 26, 2022 1:08 am

Rachael wrote:You can provide replacement graphics (basically null textures) for the existing internal engine crosshairs, and then HudMessage your own in onto the middle of the screen.

Yeah, I was thinking about this, but then useless crosshair-settings will still be in options menu. It is not quiet good-looking for standalone project I make. But If there is no other way to hide crosshair, I`ll do so.
Thanks
User avatar
Bilbö Bägginson
 
Joined: 30 Nov 2020
Discord: Bilbö Bägginson#4376
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Changing crosshair via ACS

Postby Graf Zahl » Thu May 26, 2022 11:07 am

That'd be considered very rude, though. The only 'legal' way to override the crosshair is to attach one to your weapons. But the advice still stands to only do this when the weapon demands it, e.g. a sniper rifle.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Changing crosshair via ACS

Postby Bilbö Bägginson » Thu May 26, 2022 12:36 pm

ok, have Handled it setting a crosshair to the one I made with void sprite.
Code: Select allExpand view
    NOHUD:
     TNT1 A 0 A_SetCrosshair(14)
    NOHUD1:
     TNT1 A 1
     TNT1 A 0 A_JumpIfInventory("NOHUD", 1, "NOHUD1")
    Ready:
     TNT1 A 0
     TNT1 A 0 A_JumpIfInventory("NOHUD", 1, "NOHUD")
User avatar
Bilbö Bägginson
 
Joined: 30 Nov 2020
Discord: Bilbö Bägginson#4376
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Scripting

Who is online

Users browsing this forum: brick, SPZ1 and 0 guests