Set translation for HUD weapons

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
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Set translation for HUD weapons

Post by Jarewill »

I'm looking for a way to visually show the chaingun overheating.
Mostly a way to tint the sprite red the more it fires.
I've tried using A_SetTranslation, but that didn't work (I was sure it wouldn't, but hey better to make sure than to be an even bigger idiot later).
Is that even possible via DECORATE? Or do I need to add sprites (either by copying and translating the sprite or by using the TEXTURES lump)?
It would be grand if it would be possible via a function instead, as it would simplify the code and I wouldn't need to make new states for each overheat sprite.
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

Re: Set translation for HUD weapons

Post by Cherno »

I believe the tinting renderstyle (Stencil) was changed a few versions back to what it was originally suposed to be, which is a single opaque color. It'd be great if one would be added, but it's beyond my skills to dabble in the source code.
So: No, there is no gradual tinting.
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Re: Set translation for HUD weapons

Post by Jarewill »

I apologize for not wording myself properly earlier, but I was asking if there was a function similar to A_SetTrasnlation that would work on hud weapons.
This works with how it tints the sprite red, but the thing is that calling A_SetTranslation translates the player instead of the weapon.

Code: Select all

Overheat2 = "0:255=@30[255,0,0]"
Well, of course it translates the player, I suspected that would happen and the way I was trying to make it work was a far stretch.
So I wanted to ask if there is a function like A_SetTrasnlation that would work on weapons.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Set translation for HUD weapons

Post by Blue Shadow »

As far as I'm aware, you can't change the color translation of HUD sprites in game.
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Re: Set translation for HUD weapons

Post by Jarewill »

I see. Thank you for clearing it up.
Post Reply

Return to “Scripting”