[Solved] Lifebar Colors Along with Color Tones for Players, MP, and Enemies

maxman

Well-known member
Is it possible to make lifebars and MP colors different from each other? Let's say, like, there's a lifebar color for the player and the other different lifebar color for the enemy or boss. Plus a different color for the MP too for player. Also, there are 4 color tones on the MP and health bars. I'm just wondering if having a 4-color-tone lifebar and MP would work.

Here's an example in the attachment below. The yellow one is the health bar for player and the green one is for MP. Also, the purple one is for enemy or boss. I wonder if enemies and bosses have their own different colors of life bars. As in, enemy has a blue lifebar while a boss has an orange lifebar, for example.

Does it have to be scripted or non-scripted or whatever?

[attachment deleted by admin]
 
The engine's default system only outputs single tone bars. You can script multi-tone bars though, and an example of exactly what you want is already out there. See utunnel's Golden Axe Remake.

DC
 
Yeah it's subtle, but there. Just FYI, it's not done with gradients or any kind of special effect; basically what utunnels did was generate several small lifebars of slightly differing tone and stack them together into a single larger bar. With some of the effects we have available now there might be another way to do it.

DC
 
I am using utunnels's update.c script as a reference for creating multi-tone bars on health and MP. Also, I edit the update.c for my own, but I'm having a problem. After I edit my update.c, the multi-tone bars don't show in in-game. I added and edited drawbox with position, size, etc. Also, according to the color part in the manual, it says I have to "check my palette" for color. When I look at Ax's colors in his hud.gif in the color table in GIMP, Ax has 63 color palettes while the character has 22 shown below. I really had followed utunnels's way for coding the lifebar in update.c and never knew he was using 8bit until I started to realize it now.

Plus, the only part I don't really understand is the setlayer. I get confused what setlayer does. I know its value is {int} but I don't know the result of it.

This is my update.c edit here:
Code:
void main()
{
    if(getindexedvar(10))
    {
        void pl;
        int i, t, health, off;
        //int hres = getindexedvar(11);
        int vres = getindexedvar(12);
        int z = getindexedvar(13); // front panel z
        for(i=0; i<3; i++)
        {
            pl = getplayerproperty(i, "ent");
            if(pl)
            {
                //magic background
                drawbox(i*128+23, vres-22, 126, 22, z+5110, 45);
                //Commando MP Gauge
                t = getentityproperty(pl, "mp")/10;
                drawbox(i*128+23, vres-20, 11*t, 17, z+5111, 92); 
			    drawbox(i*128+23, vres-19, 11*t, 17, z+5111, 93);
			    drawbox(i*128+23, vres-18, 11*t, 17, z+5111, 94);
			    drawbox(i*128+23, vres-17, 11*t, 17, z+5111, 95);
                //Commando Health Gauge
                health = getentityproperty(pl, "health");
                off = (health-1)/20;
                drawbox(i*128+23, vres-6, health, 1, z+18000, 68 + off);//health
                drawbox(i*128+23, vres-5, health, 1, z+18000, 67 + off);
                drawbox(i*128+23, vres-4, health, 1, z+18000, 66 + off);
				drawbox(i*128+23, vres-3, health, 1, z+18000, 65 + off);
				drawstring(i*128+34, vres-9, 1, "x"+getplayerproperty(i, "lives"));
				char cstring = getglobalvar("cstring");
				if(cstring!=NULL())
				{
					drawstring(i*128+23, vres-16, 2, cstring);
				}
            }
            else
            {
                drawbox(i*128+22, vres-22, 128, 22, z+10110, 1);
            }
        }
    }
}

I cannot make multi-tone bars for health and MP. They are just single tones in each bar.

mybor_0001.png


When I go to the Wiki, I see RGBColor there. I'm just not sure what to do but I understand it's part of functions. For drawbox, it says this:

Color of the box.

In 8-bit color mode, you can specify the index in the global palette.
In any color mode, you can use the rgbcolor function to get this value.

It seems that utunnels used 8bit for his old GA Remake mod while I'm using 32bit. I know the rgbcolor is shown in example especially with setdrawmethod and changedrawmethod, but I don't know how I'd do it.

Attachments shown for what color palettes the icon is. This is the icon I'm using for a character lifebar. The color palettes are used in the icon image in the color table.

[attachment deleted by admin]
 
This is a fake shot, but the part of multi-color tone bars on both health and MP bars is what I want it to look like in-game. I tried using drawbox for each color tone bar but doesn't apply to those multi-color tone bars in in-game.

fakeshot.png


(Care to explain something I missed or I made it wrong? I'll give out my unfinished work for multi-tone bars in PM whoever wants to try it.)
 
nsw25 said:
Hey nsw25,

moon_dpoint_062110.png


When you look at my screenshot, do you see the dark blue color in my mp bar? Is that the color you're referring to?

Also, when you talk about "neon colors" for your lifebars, do you mean like a constant glow like an Outer Glow in Photoshop? ...or are you looking for an effect like a pulsing neon light like you'd see at nightclubs?
 
The dark blue is actually hard coded into the engine and I don't believe that can be edited, but I have noticed that it shows up when you resize your mp bar in anyway.

As far as the actual editing of the mp bar itself to match the image that you showed, I'm pretty sure that can be done with scripting, similar to the way that the lifebar can be edited to show multi-color tone. I haven't done it myself since I haven't had to make a game that called for something like that, but give me some time and I'll be sure to tackle it. (I'm sure someone else will beat me to it before I do :P)

Perhaps something like this will help you? Overlay effect on Magic Bar
 
Well. I couldn't come up with the lifebar until Bloodbane shared this one here. I got it solved. Thanks, Bloodbane.

kungpow12345 is correct that the lifebar you are asking about has to be scripted. Since the lifebar is hardcoded, it can't be edited unless it is scripted.

@kungpow12345: I had done making the multi-color tone for the first time recently with another mod.
 
Code:
colormagic {R} {G} {B}

    ~Controls the color of the MP bar.


colormagic2 {R} {G} {B}

    ~When a player's MP bar is longer than their health, the extra MP is overlaid on top of the first bar in this color, like with health.

 
Back
Top Bottom