I made a simple health bar mod.
Warning! This will probably only work for alpha 132.
The red bar shows how much temporary health you have left, it regenerates over time. The yellow is your permanent health, you can never have more temporary health than you have permanent health.
Installing: Simple
Download the zip below, extract it and then copy the Data folder into your main Overgrowth folder.
Installing: Advanced
Use this if you want to use this mod with other mods at the same time
Open your aschar.as file, it's located in your installation folder "Overgrowth\Scripts\aschar.as" remember, you may need administrative rights to modify the file.
Find the Draw function. It's in the line 1405.
Code: Select all
void draw() {
this_mo.DrawBody();
}
Replace it with this:
Code: Select all
// Draws some debug lines to make a thick bar.
void DrawDebugBar(vec3 pos, vec3 right, vec3 up, float amount, float offset, vec3 color, float step_i, int step_c)
{
for(int i = 0; i < step_c; i++)
{
DebugDrawLine(pos + (up * (step_i * i)) + right * (max(offset, 0) - 0.5f),
pos + (up * (step_i * i)) + right * (max(amount, 0) - 0.5f),
color,
_delete_on_draw);
}
}
// Draws the health bar
void DrawHealthBar()
{
vec3 right = normalize(cross(camera.GetFacing(), vec3(0.0f, 1.0f, 0.0f)));
vec3 up = normalize(cross(camera.GetFacing(), right));
if(permanent_health < 1.0f)
DrawDebugBar(this_mo.position + vec3(0.0f, 1.0f, 0.0f), right, up, 1.0f, permanent_health, vec3(0.0f, 0.0f, 0.0f), 0.0025f, 7); //Draw the background (Black)
if(temp_health < permanent_health)
DrawDebugBar(this_mo.position + vec3(0.0f, 1.0f, 0.0f), right, up, permanent_health, temp_health, vec3(1.0f, 1.0f, 0.0f), 0.0025f, 7); //Draw the permanent health (Yellow)
DrawDebugBar(this_mo.position + vec3(0.0f, 1.0f, 0.0f), right, up, temp_health, 0.0f, vec3(1.0f, 0.0f, 0.0f), 0.0025f, 7); //Draw the temporary health (Red)
}
void draw() {
this_mo.DrawBody();
DrawHealthBar();
}
Let me know what you think about it.