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!)
Post Reply
User avatar
Bilbö Bägginson
Posts: 31
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Changing crosshair via ACS?

Post by Bilbö Bägginson »

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
R4L
Global Moderator
Posts: 420
Joined: Fri Mar 03, 2017 9:53 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11 Pro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: Changing crosshair via ACS

Post by R4L »

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
Bilbö Bägginson
Posts: 31
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: Changing crosshair via ACS

Post by Bilbö Bägginson »

[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
Rachael
Posts: 13922
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Changing crosshair via ACS

Post by Rachael »

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
Bilbö Bägginson
Posts: 31
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: Changing crosshair via ACS

Post by Bilbö Bägginson »

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

Re: Changing crosshair via ACS

Post by Graf Zahl »

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
Bilbö Bägginson
Posts: 31
Joined: Mon Nov 30, 2020 11:11 pm
Graphics Processor: nVidia with Vulkan support

Re: Changing crosshair via ACS

Post by Bilbö Bägginson »

ok, have Handled it setting a crosshair to the one I made with void sprite.

Code: Select all

    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")
Post Reply

Return to “Scripting”