PDA

View Full Version : (Utility) Halo Alpha Rescaler (fixes ammo meter gradients)



Moses
April 3rd, 2013, 02:23 PM
I tried making an ammo gradient for a 13 missile vehicle and no matter how perfectly I set up the gradient in the alpha it would always be off. So I did some testing and figured out WHY this is happening. I will paste the readme from here on out to make it easier on me.


Have you ever noticed that no matter how hard you try your ammo meter gradients never work exactly how you want them to? Well cry no more because I bring to you the Halo Alpha Rescaler(yea I couldn't think up a better name so shut up).


What this tool does:

In the image below take a look at the part that says "0 - 255". It's a perfect gradient that goes up by exactly 1 for every pixel it moves to the right until it hits 255. Now when I compiled it into a meter and opened the tag in Guerilla it displayed that perfect gradient as exactly how it looks in the area "HALO SCALED".

3186


Now what this means is that even if you made a perfect gradient in photoshop, halo would not read it as such. It will add a curve to it so any ammo meters that you try to make will not work correctly. This issue is most prominent with weapons with large magazines (and also don't use bars like plasma weapons do) such as SMG's and Assault Rifles.

Well I took scaled the gradient halo turned mine into and, in combination with the original, came up with the "Conversion Gradient" seen above. When I ran this "Conversion Gradient" through tool and viewed the result in guerilla it gave me the "Converted Gradient" also seen above. It's almost perfectly identical to the "0 - 255" only there are about 20 or so values that cannot be obtained because halo skips over them (a few of them are 2, 7, 12, and 16).


Now what does this tool actually DO? It takes a greyscale image and converts it using the "conversion_gradient.png" so when you compile the converted meter in tool and view it in guerilla it looks and acts how you intended for it to. Here's an original(top) and converted(bottom) of the ammo meter I was trying to make.


3185 3184

The difference isn't very noticeable unless you lay them on top of each other and toggle visibility, but it makes a big difference to Halo.



How to use:

1: Copy the alpha from your hud element's texture (the part that actually contains the gradients halo uses to fill the meter) and paste that into the RGB of a new image file.
2: Save the new image into the Input folder as a .png (ONLY .PNG FILES WORK)
3: Repeat steps 1 and 2 for any hud elements you need to convert.
4: Double click "Halo Alpha Rescaler.jar" and it will convert all the files in the "Input" folder and save the converted versions in the Output folder.
5: Load the converted image into your editing program and copy it into your hud element texture's alpha and save.


DOWNLOAD (http://chief-01.deviantart.com/art/Halo-Alpha-Rescaler-363249172?ga_submit_new=10%3A1365016288&ga_type=edit&ga_changes=1&ga_recent=1)
Don't whine that it doesn't work if you didn't read the readme. THERE IS NO GUI. It's a simple run and done program.


This program was written by me, Moses(though in places I go by Exelixis and my deviantart is Chief-01), and is my first standalone program I've ever written so don't complain about it lol. Arby(aka The Arbiter / Gabo7) WOULD have gotten a mention right here, but he complained and wanted me to make such a simple tool have a GUI, so no. Oh and TheKillerDonut(aka Donut) for a little help debugging.

Also, I've included the source code in case you guys want to mess with it (though I don't see why you'd want to). Just make sure to credit me if you modify it. And don't bitch about me using Java. I barely even know java to begin with so it took me 2 days to write this simple program.

Kornman00
April 3rd, 2013, 05:10 PM
Your rockets look like dongs lol

Good job from the looks of it (I don't mess with HUDs, let alone bitmaps)

_TheArbiter_
April 4th, 2013, 02:44 AM
Good job, mo. :golfclap: