colors of damage received

Sod Pirates

Pirate
Registered
LV
0
 
Joined
Apr 21, 2026
Messages
14
Reaction score
2
Points
8
Hi everyone, I need some help. Do you know how I can get the damage numbers to appear in this format? Can anyone give me a hand?




1782413445635.webp
 
I think Mapko has that effect; you can search for the effect name, copy and replace. It used to be on the Top Lokos website, but it's been shut down.
 
In engine\I_Effect.cpp a list of texture files client\texture\effect for symbols is specified
C++:
s_string str[] =
{
        "addblood", //healing
        "subblood", //damage
        "addsp",
        "subsp",
        "addblood",
        "subblood",
        "bao",
        "submiss",
};

If this is your character, then 2 is added to the texture name, for example addblood2, subblood2, addsp2
C++:
if(!bmain)
{
    sprintf(psName,"%s",str[_iTextureID].c_str());
}
else
{
        sprintf(psName,"%s2",str[_iTextureID].c_str());
}

The texture consists of 12 characters (0123456789+-). The easiest way to change the display is to replace these textures.

CreateSpliteTexture(12, 1) — 12 columns, 1 row. UV of each character = 1/12 of the texture width:
C++:
void    CTexList::CreateSpliteTexture(int iRow, int iColnum)
{
    m_wTexCount = iRow * iColnum;
    float fw = 1.0f / iRow;
    float fh = 1.0f / iColnum;
The pixel size of the file (subblood.tga, etc.) is not read anywhere in the code — the engine divides the texture into 12 equal parts along U.

The size of one digit on the screen (worldwide):
C++:
    float fx = 0.5f; //quad width 1.0 world unit
    float fy = 0.7f; //Height 1.4
    // ...
    t_SEffVer[0].m_SPos = D3DXVECTOR3(-fx, -fy, 0);
    // ...
    t_SEffVer[2].m_SPos = D3DXVECTOR3(fx, fy, 0);