Jump to content

Recommended Posts

  • Honorable Member
13 hours ago, NXS said:

**Sometimes when I enter in the game the name is displayed ok and sometimes it's displayed too low.**

Same

It happens on official too, it's not this system's fault

 

  • 4 months later...
  • Premium

Hello,

Im using TMP4 Sources and i added a lot a new mounts with costume_mount and a Mount follow system ( Mitachi Mount like Horses ).

I had a lot of trouble making this Race Height working because of my low brain.

The name of horses while mounting was displayed too high and not mounting was the same, 

with new mounts added this was worst.

I finally made it work, it's visually good and work with emoticons etc.

proof:

Spoiler

.jpg


.jpg


.jpg


.jpg

 

.jpg

Here is my Instancebase.cpp part:

Spoiler
float CInstanceBase::GetBaseHeight()
{
	CActorInstance* pkHorse = m_kHorse.GetActorPtr();
	if (!m_kHorse.IsMounting() || !pkHorse)
		return 0.0f;

	DWORD dwHorseVnum = m_kHorse.m_pkActor->GetRace();
	///////////////////////////////////
	// Changes for new Mounts.		//
	///////////////////////////////////
	
	// Horse base mount or who need the same settings when mounting (Boar and Wolf for exemple)
	if ((dwHorseVnum >= 20101 && dwHorseVnum <= 20111) ||	//horse from level 0 to 21 & boar and wolf
		(dwHorseVnum == 20029 || dwHorseVnum == 20030) ||	//Pony
		(dwHorseVnum == 20115 || dwHorseVnum == 20116 || dwHorseVnum == 20227 || dwHorseVnum == 20226) ||	//Boar and wolfs and horsesbase unicorns
		(dwHorseVnum == 20219 || dwHorseVnum == 20220 || dwHorseVnum == 20250 || dwHorseVnum == 20251) ||	//Dear, horses base mount & Magma lezards
		(dwHorseVnum == 20261 || dwHorseVnum == 20262 || dwHorseVnum == 20286 || dwHorseVnum == 20287) ||	//spectral horses and dears
		(dwHorseVnum == 20273 || dwHorseVnum == 20274 || dwHorseVnum == 20265 || dwHorseVnum == 20266))		//Lama & Horses
		return 88.0f;	//100 is too high i don't know why i've tried differents setting to match an Official like setting.
						//and what Xpengers was showing in video.


	//Fork VNum of the new mounts implanted and/or who have no line in official race_heigh.txt
	//name is display too high while mounting if Vnum is not declare here
	//if you add a new mount i recommand putting Vnum here then look if player name is display too high or too low 
	//if too low:  try put Vnum with horses base mount then with Mammoth or dragon as needed.
	if ((dwHorseVnum >= 20112 && dwHorseVnum <= 20114) ||
		(dwHorseVnum >= 20117 && dwHorseVnum <= 20218) ||
		(dwHorseVnum >= 20221 && dwHorseVnum <= 20225) ||
		(dwHorseVnum >= 20228 && dwHorseVnum <= 20245) ||
		(dwHorseVnum >= 20253 && dwHorseVnum <= 20260) ||
		(dwHorseVnum == 20267 || dwHorseVnum == 20268) ||
		(dwHorseVnum >= 20276 && dwHorseVnum <= 20281) ||
		(dwHorseVnum >= 20288 && dwHorseVnum <= 20290))
		return 55.0f;

	//For new mounts (Mammoth,camel,flying stuff /////except dragons////) 
	//without this adjustment player name is display too low while mounting.
	if ((dwHorseVnum >= 20246 && dwHorseVnum <= 20249) ||	//Mammoth & Camel
		(dwHorseVnum == 20271 || dwHorseVnum == 20272 ||	//Crows
		dwHorseVnum == 20282 || dwHorseVnum == 20283 || dwHorseVnum == 20284 || dwHorseVnum == 20285 ||		//Seahorses & Bats
		dwHorseVnum == 20263 || dwHorseVnum == 20264 || dwHorseVnum == 20269 || dwHorseVnum == 20270))		//Bats and sphynx
		return 135.0f;

	//For Dragon's (with 135.0f : while mounting the character head was flying through the name of player)
	if (dwHorseVnum == 20275 || dwHorseVnum == 20252)
		return 180.0f;
		

	float fRaceHeight = CRaceManager::instance().GetRaceHeight(dwHorseVnum);
	if (fRaceHeight == 0.0f)
		return 100.0f;
	else
		return fRaceHeight;
}

 

My race_height.txt:

Spoiler

20029    220.00
20030    220.00
20101    220.00
20102    220.00
20103    220.00
20104    220.00
20105    220.00
20106    220.00
20107    220.00
20108    220.00
20109    220.00
20110    160.00
20111    160.00
20112    160.00
20113    220.00
20114    220.00
20115    160.00
20116    160.00
20117    220.00
20118    220.00
20119    220.00
20120    220.00
20121    220.00
20122    220.00
20123    220.00
20124    220.00
20125    220.00
20205    160.00
20206    160.00
20207    220.00
20208    220.00
20209    160.00
20210    160.00
20211    220.00
20212    220.00
20213    220.00
20214    220.00
20215    220.00
20216    220.00
20217    220.00
20218    220.00
20219    220.00
20220    220.00
20221    160.00
20222    160.00
20226    220.00
20227    220.00
20244    260.00
20245    260.00
20246    260.00
20247    260.00
20248    260.00
20249    260.00
20250    220.00
20251    220.00
20252    300.00
20253    220.00
20257    220.00
20258    220.00
20259    220.00
20260    220.00
20275    300.00
20280    220.00
20281    220.00
20286    220.00
20287    220.00
20288    220.00
30000    150.00
30002    220.00
30003    220.00
30004    200.00
30005    200.00
30006    270.00
30007    270.00
30008    270.00
2493    500.00
6436    500.00
6500    184.00
6501    184.00
6502    368.00
6503    368.00
6504    500.00
7550    220.00
7557    220.00
7564    220.00
7571    220.00
7578    220.00
7585    220.00
6752    260.00
6753    260.00
6754    260.00
6756    530.00
6852    260.00
6853    260.00
6854    260.00
6856    530.00
6760    280.00
6764    320.00
6784    260.00
6792    260.00
6877    280.00
6881    320.00
6770    220.00
6882    220.00
6522    260.00
6523    260.00
6524    260.00
6525    520.00
6526    520.00
6527    520.00
6528    520.00
6531    520.00
6532    520.00
7210    800.00
7211    800.00
7212    800.00
7213    800.00
7214    800.00
7215    800.00
7216    800.00
34180    155.00
34181    155.00
34182    155.00
34183    120.00
34184    120.00
40003    70.00

about race_height:

some mounts needed their Vnum here, if not, when following the player their name is display too high.

others does not as the game display them correctly (flying crows, bats, sphynxs for exemple)

And my Playersetting module part:

Spoiler

def __LoadRaceHeight():    
    try:
        lines = pack_open("race_height.txt", "r").readlines()
    except IOError:
        import dbg
        dbg.LogBox("__LoadRaceHeight: load text file error!")
        app.Abort()

    for line in lines:
        tokens = line[:-1].split("\t")
        if len(tokens) == 0 or not tokens[0]:
            continue

        vnum = int(tokens[0])
        height = float(tokens[1])

        chrmgr.SetRaceHeight(vnum, height)

I decided to go with pack_open and a log box to see if race_heigh.txt was trully read because it was not at first.

 

I wanted some opinions: 

Is it a good way or am i ruining something ? (specially in instancebase.cpp)

Why does "normal" setting as said in tutorial (100.0f; in instancebase.cpp) Display the name of the horse too high while mounting

compare with the video exemple shown in topic ?

if anyone has and idea 

Thank you xpenger for your systems.

Best regards, Ariver.

  • Love 1
  • 3 months later...
  • Nitro Booster

Here is fix for the character name low height issue when you enter game too fast.
There is 2 way to fix it, i suggest the second way bcs it will fix the height issues after rescale actors. 

 

// FIRST WAY

float CActorInstance::GetHeight()
{
    if (IsPC()) // fix pc height
        return CGraphicThingInstance::GetHeight();

    DWORD dwRace = GetRace();
    float fRaceHeight = CRaceManager::instance().GetRaceHeight(dwRace);
    if (fRaceHeight == 0.0f)
    {
        fRaceHeight = CGraphicThingInstance::GetHeight();
        CRaceManager::instance().SetRaceHeight(dwRace, fRaceHeight);
    }

    return fRaceHeight;
}

// SECOND WAY (this will also fix the height issues after rescale)

float CActorInstance::GetHeight()
{
    const float fHeight = CRaceManager::instance().GetRaceHeight(GetRace());
    return (fHeight > 0.0f) ? fHeight : CGraphicThingInstance::GetHeight();
}

 

Edited by Luigina
  • Metin2 Dev 1
  • Love 1
On 3/25/2025 at 9:47 PM, Luigina said:

Here is fix for the character name low height issue when you enter game too fast.
There is 2 way to fix it, i suggest the second way bcs it will fix the height issues after rescale actors. 

 

// FIRST WAY

float CActorInstance::GetHeight()
{
    if (IsPC()) // fix pc height
        return CGraphicThingInstance::GetHeight();

    DWORD dwRace = GetRace();
    float fRaceHeight = CRaceManager::instance().GetRaceHeight(dwRace);
    if (fRaceHeight == 0.0f)
    {
        fRaceHeight = CGraphicThingInstance::GetHeight();
        CRaceManager::instance().SetRaceHeight(dwRace, fRaceHeight);
    }

    return fRaceHeight;
}

// SECOND WAY (this will also fix the height issues after rescale)

float CActorInstance::GetHeight()
{
    const float fHeight = CRaceManager::instance().GetRaceHeight(GetRace());
    return (fHeight > 0.0f) ? fHeight : CGraphicThingInstance::GetHeight();
}

 


Thanks. It solved the problem, but when dismounting, the name shifts up and down, and for some reason, this bothers me a little. 🙂

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.