Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Damage Space

Initiate Mage
Joined
Sep 8, 2011
Messages
67
Reaction score
252
I've had a report my post wasn't working so I updated it to work properly. Also, I added period to the image when the damageRender variable is set to 3.
 
Initiate Mage
Joined
Jul 1, 2019
Messages
13
Reaction score
2
Here's mine with options for Comma or space. Without code for the option window. I could also add period.
2dRender
Code:
#ifdef __DamageRenderComma
        const int spacePosition = nLength % 3;
        for (int i = 0; i < nLength; ++i)
        {
            const unsigned long nIndex = strTemp[i] - '0' + m_nAttribute * 16;
            if (static_cast<int>(nIndex) >= 0)
            {
                if (i % 3 == spacePosition && i)
                {
                    switch (g_Option.damageRender)
                    {
                        case 3:
                            textPackNum->Render(&g_Neuz.m_2DRender, CPoint(static_cast<int>(fX), static_cast<int>(fY)), m_nAttribute * 16 + 11, static_cast<DWORD>(nAlpha), fScaleX, fScaleY);
                            fX = static_cast<FLOAT>(fX + (textPackNum->m_ap2DTexture[m_nAttribute * 16 + 11].m_size.cx * 0.5 * fScaleX));
                            break;
                        case 2:
                            textPackNum->Render(&g_Neuz.m_2DRender, CPoint(static_cast<int>(fX), static_cast<int>(fY)), m_nAttribute * 16 + 10, static_cast<DWORD>(nAlpha), fScaleX, fScaleY);
                            fX = static_cast<FLOAT>(fX + (textPackNum->m_ap2DTexture[m_nAttribute * 16 + 10].m_size.cx * 0.5 * fScaleX));
                            break;
                        case 1:
                            fX = static_cast<FLOAT>(fX + (textPackNum->m_ap2DTexture[nIndex].m_size.cx * 0.5 * fScaleX));
                            break;
                        case 0:
                        default:
                            break;

                    }
                }
                textPackNum->Render(&g_Neuz.m_2DRender, CPoint(static_cast<int>(fX), static_cast<int>(fY)), nIndex, static_cast<DWORD>(nAlpha), fScaleX, fScaleY);
                fX = static_cast<FLOAT>(fX + (textPackNum->m_ap2DTexture[nIndex].m_size.cx * 0.5 * fScaleX));
            }
        }
#else
        for (int i = 0; i < nLength; i++)
        {
            DWORD nIndex = strTemp[i] - '0' + m_nAttribute * 14;
            if ((int)nIndex >= 0)    // ¿¡·¯¹æÁö.
            {
                textPackNum->Render(&g_Neuz.m_2DRender, CPoint((int)(fX), (int)(fY)), nIndex, (DWORD)nAlpha, fScaleX, fScaleY);
            }
            else
            {
                LPCTSTR szErr = Error("DamageNum::Render : %s %d", strTemp, m_nAttribute);
                ADDERRORMSG(szErr);
            }
            fX = (FLOAT)(fX + (textPackNum->m_ap2DTexture[nIndex].m_size.cx*0.5*fScaleX));
        }
#endif

HwOption.h
Code:
#ifdef __DamageRenderComma
    unsigned char damageRender;
#endif
HwOption.cpp
COption::Init
Code:
#ifdef __DamageRenderComma
    damageRender = 1;
#endif
COption::Load
Code:
#ifdef __DamageRenderComma
    else if (scan.Token == _T("damageRender"))
        damageRender = scan.GetNumber();
#endif

COption::Save
Code:
#ifdef __DamageRenderComma
    _ftprintf(fp, _T("damageRender %d\n"), static_cast<int>(damageRender));
#endif


DmgEffect.inc
Code:
number 32
texture "sfx\DmgEffect.dds" 0x00000000
serialize 12 50 50 0  0 0 0
pos 200 50 0   50 n
pos 200 50 200 50 n
pos 300 50 400 50 n
pos 250 50 700 50 n
serialize 12 50 50 0 128 0 0
pos 200 178 0   178 n
pos 200 178 200 178 n
pos 300 178 400 178 n
pos 250 178 700 178 n

Image:

I tried yours but seems the comma doesn't really shows up even though I even add an option for it on to make sure I don't miss something,

But what it does, when turning of the option, the spaces on the damages will be turned off, then turning on will give spaces on it.

WndOption.cpp/.h at these functions.
CWndOptVideo::OnChildNotify
CWndOption::OnChildNotify
CWndOptVideo::OnInitialUpdate
CWndOptVideo::OnChildNotify

Or I did wrong or somehow.
 
Initiate Mage
Joined
Sep 8, 2011
Messages
67
Reaction score
252
I tried yours but seems the comma doesn't really shows up even though I even add an option for it on to make sure I don't miss something,

But what it does, when turning of the option, the spaces on the damages will be turned off, then turning on will give spaces on it.

WndOption.cpp/.h at these functions.
CWndOptVideo::OnChildNotify
CWndOption::OnChildNotify
CWndOptVideo::OnInitialUpdate
CWndOptVideo::OnChildNotify

Or I did wrong or somehow.

in neuz.ini
damageRender 3 = period
damageRender 2 = comma
damageRender 1 = space

if you're not using raido buttons or not using combo box and just one single button to set to 1(on) or 0(off), then there's your issue as its multi option based for the user.
 
Last edited:
Initiate Mage
Joined
Jul 1, 2019
Messages
13
Reaction score
2
Okay I understand. But if there's only one g_Option.damageRender

How can I call the other buttons? Do I make new
g_Option.damageRender, like this?

switch (g_Option.damageRender)
{
if (g.Option.DamageRender3)
{
case 3:
textPackNum->Render(&g_Neuz.m_2DRender, CPoint(static_cast<int>(fX), static_cast<int>(fY)), m_nAttribute * 16 + 11, static_cast<DWORD>(nAlpha), fScaleX, fScaleY);
fX = static_cast<FLOAT>(fX + (textPackNum->m_ap2DTexture[m_nAttribute * 16 + 11].m_size.cx * 0.5 * fScaleX));
break;

}.......


 
Inactive
Joined
Jan 20, 2009
Messages
1,015
Reaction score
1,830
Okay I understand. But if there's only one g_Option.damageRender

How can I call the other buttons? Do I make new
g_Option.damageRender, like this?

switch (g_Option.damageRender)
{
if (g.Option.DamageRender3)
{
case 3:
textPackNum->Render(&g_Neuz.m_2DRender, CPoint(static_cast<int>(fX), static_cast<int>(fY)), m_nAttribute * 16 + 11, static_cast<DWORD>(nAlpha), fScaleX, fScaleY);
fX = static_cast<FLOAT>(fX + (textPackNum->m_ap2DTexture[m_nAttribute * 16 + 11].m_size.cx * 0.5 * fScaleX));
break;

}.......



There is already more then 1 case provided.

So why would u make:
Code:
g.Option.DamageRender3

when u can use?
Code:
g.Option.damageRender == 3

This is more proof when people say to you directly that you should google basic things you should take the advice rather then flaming them.
 
Junior Spellweaver
Joined
Sep 29, 2021
Messages
133
Reaction score
26
Here for someone who might be want to add Fenris Damage Render in Option

WndOption.cpp
Code:
#ifdef __DamageRenderComma
    CWndComboBox* pComboBox2 = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX2);
    if (pComboBox2)
    {
        pComboBox2->AddWndStyle(EBS_READONLY);

        int nIdx = pComboBox2->AddString("Default");
        pComboBox2->SetItemData(nIdx, 0);
        nIdx = pComboBox2->AddString("Space");
        pComboBox2->SetItemData(nIdx, 1);
        nIdx = pComboBox2->AddString("Comma");
        pComboBox2->SetItemData(nIdx, 2);
        nIdx = pComboBox2->AddString("Period");
        pComboBox2->SetItemData(nIdx, 3);
        
        pComboBox2->SetCurSel(g_Option.damageRender);
    }
#endif // __DamageRenderComma

Code:
#ifdef __DamageRenderComma
    case WIDC_COMBOBOX2:
    {       
        if (message == WNM_SELCHANGE)
        {            
            CWndComboBox* pComboBox2 = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX2);
            if (pComboBox2)
            {                
                g_Option.damageRender = pComboBox2->GetSelectedItemData();
            }
        }
    }
    break;
#endif // __DamageRenderComma

resdata.inc
Code:
    WTYPE_STATIC STATIC111 "" 1 290 229 399 248 0x20000 0 0 0 0 246 204 77
    {
    // Title String
    IDS_RESDATA_INC_176449
    }
    {
    // ToolTip
    IDS_RESDATA_INC_176450
    }
    WTYPE_COMBOBOX WIDC_COMBOBOX2 "WndEditTile00.tga" 1 230 256 452 275 0x20000 0 0 0 0 255 249 198
    {
    // Title String
    IDS_RESDATA_INC_176451
    }
    {
    // ToolTip
    IDS_RESDATA_INC_176452
    }

resdata.txt
Code:
IDS_RESDATA_INC_176449    Damage Render
IDS_RESDATA_INC_176450    
IDS_RESDATA_INC_176451    
IDS_RESDATA_INC_176452

thankyou everyone
 
Back
Top