Jump to content
TrinityCore

How to go about changing player character's normal size


Immense
 Share

Recommended Posts

Currently running: TrinityCore rev. 9685c9346dfe+ 2019-05-26 10:56:12 +0200 (master branch) (Win64, RelWithDebInfo, Static)

I'm basically just trying to change the size of one player race (Example: Gnomes) to something higher than their value is normally set to. I created a creature_display_info and hotfix_data entry in the hotfix database regarding the gnome's ID,  however the only thing that changes visually regarding scale is the camera position, which is positioned where it should be for the scaled model. The issue is that the actual model isn't scaled, it remains at its normal size for some reason. Google searching shows changing a player race's size was possible before the switch to the hotfix database over merely using DB2 and MPQ files, so am I missing something internally to make the scaling work properly?

 

Link to comment
Share on other sites

  • 2 weeks later...

I decided to just bypass the hotfix database entirely due to the lack of information on the wiki (As well as on the internet) and just manually do it via editing the source code. You'll need to edit Player.cpp, Player.h, World.cpp and World.h for this to work:

Player.cpp will involve inserting the following function above the Player::WorldSession statement:

void Player::SetupRaceSize()
{
    uint8 race = getRace();
    float size;
    {
        switch (race)
        {

        case RACE_HUMAN:
            size = sWorld->getFloatConfig(CONFIG_HUMAN_SIZE);
            SetObjectScale(size);
            break;
        case RACE_ORC:
            size = sWorld->getFloatConfig(CONFIG_ORC_SIZE);
            SetObjectScale(size);
            break;
        case RACE_PANDAREN_NEUTRAL:
            size = sWorld->getFloatConfig(CONFIG_PANDAREN_SIZE);
            SetObjectScale(size);
            break;
        case RACE_PANDAREN_ALLIANCE:
            size = sWorld->getFloatConfig(CONFIG_PANDARENALLIANCE_SIZE);
            SetObjectScale(size);
            break;
        case RACE_PANDAREN_HORDE:
            size = sWorld->getFloatConfig(CONFIG_PANDARENHORDE_SIZE);
            SetObjectScale(size);
            break;
        case RACE_MAGHAR_ORC:
            size = sWorld->getFloatConfig(CONFIG_MAGHARORC_SIZE);
            SetObjectScale(size);
            break;
        case RACE_DWARF:
            size = sWorld->getFloatConfig(CONFIG_DWARF_SIZE);
            SetObjectScale(size);
            break;
        case RACE_DARK_IRON_DWARF:
            size = sWorld->getFloatConfig(CONFIG_DARKIRONDWARF_SIZE);
            SetObjectScale(size);
            break;
        case RACE_DRAENEI:
            size = sWorld->getFloatConfig(CONFIG_DRAENEI_SIZE);
            SetObjectScale(size);
            break;
        case RACE_LIGHTFORGED_DRAENEI:
            size = sWorld->getFloatConfig(CONFIG_LIGHTFORGEDDRAENEI_SIZE);
            SetObjectScale(size);
            break;
        case RACE_GNOME:
            size = sWorld->getFloatConfig(CONFIG_GNOME_SIZE);
            SetObjectScale(size);
            break;
        case RACE_NIGHTELF:
            size = sWorld->getFloatConfig(CONFIG_NIGHTELF_SIZE);
            SetObjectScale(size);
            break;
        case RACE_WORGEN:
            size = sWorld->getFloatConfig(CONFIG_WORGEN_SIZE);
            SetObjectScale(size);
            break;
        case RACE_UNDEAD_PLAYER:
            size = sWorld->getFloatConfig(CONFIG_UNDEAD_SIZE);
            SetObjectScale(size);
            break;
        case RACE_TAUREN:
            size = sWorld->getFloatConfig(CONFIG_TAUREN_SIZE);
            SetObjectScale(size);
            break;
        case RACE_HIGHMOUNTAIN_TAUREN:
            size = sWorld->getFloatConfig(CONFIG_HIGHMOUNTAINTAUREN_SIZE);
            SetObjectScale(size);
            break;
        case RACE_TROLL:
            size = sWorld->getFloatConfig(CONFIG_TROLL_SIZE);
            SetObjectScale(size);
            break;
        case RACE_BLOODELF:
            size = sWorld->getFloatConfig(CONFIG_BLOODELF_SIZE);
            SetObjectScale(size);
            break;
        case RACE_VOID_ELF:
            size = sWorld->getFloatConfig(CONFIG_VOIDELF_SIZE);
            SetObjectScale(size);
            break;
        case RACE_GOBLIN:
            size = sWorld->getFloatConfig(CONFIG_GOBLIN_SIZE);
            SetObjectScale(size);
            break;
        case RACE_NIGHTBORNE:
            size = sWorld->getFloatConfig(CONFIG_NIGHTBORNE_SIZE);
            SetObjectScale(size);
            break;

        default:
            SetObjectScale(1.0f);
        }
    }
}

Also in Player.cpp, you'll then need to comment out the three "SetObjectScale(1.0f);" declarations using comments (which would be done by putting two // in front of the declaration) and place in below them the function "SetupRaceSize();" without quotes.

So in other words:

	//SetObjectScale(1.0f);
	SetupRaceSize();
	

=============================

For Player.h , it's just one line to add:

	void SetupRaceSize();
	

=============================

For World.cpp, place the following lines in the World::LoadConfigSettings function:

	m_float_configs[CONFIG_GNOME_SIZE] = sConfigMgr->GetFloatDefault("GnomeSize", SEC_CONSOLE);
    m_float_configs[CONFIG_HUMAN_SIZE] = sConfigMgr->GetFloatDefault("HumanSize", SEC_CONSOLE);
    m_float_configs[CONFIG_ORC_SIZE] = sConfigMgr->GetFloatDefault("OrcSize", SEC_CONSOLE);
    m_float_configs[CONFIG_DWARF_SIZE] = sConfigMgr->GetFloatDefault("DwarfSize", SEC_CONSOLE);
    m_float_configs[CONFIG_DARKIRONDWARF_SIZE] = sConfigMgr->GetFloatDefault("DarkIronDwarfSize", SEC_CONSOLE);
    m_float_configs[CONFIG_DRAENEI_SIZE] = sConfigMgr->GetFloatDefault("DraeneiSize", SEC_CONSOLE);
    m_float_configs[CONFIG_LIGHTFORGEDDRAENEI_SIZE] = sConfigMgr->GetFloatDefault("LightForgedDraeneiSize", SEC_CONSOLE);
    m_float_configs[CONFIG_UNDEAD_SIZE] = sConfigMgr->GetFloatDefault("UndeadSize", SEC_CONSOLE);
    m_float_configs[CONFIG_TAUREN_SIZE] = sConfigMgr->GetFloatDefault("TaurenSize", SEC_CONSOLE);
    m_float_configs[CONFIG_HIGHMOUNTAINTAUREN_SIZE] = sConfigMgr->GetFloatDefault("HighMountainTaurenSize", SEC_CONSOLE);
    m_float_configs[CONFIG_BLOODELF_SIZE] = sConfigMgr->GetFloatDefault("BloodElfSize", SEC_CONSOLE);
    m_float_configs[CONFIG_VOIDELF_SIZE] = sConfigMgr->GetFloatDefault("VoidElfSize", SEC_CONSOLE);
    m_float_configs[CONFIG_NIGHTELF_SIZE] = sConfigMgr->GetFloatDefault("NightElfSize", SEC_CONSOLE);
    m_float_configs[CONFIG_NIGHTBORNE_SIZE] = sConfigMgr->GetFloatDefault("NightborneSize", SEC_CONSOLE);
    m_float_configs[CONFIG_GOBLIN_SIZE] = sConfigMgr->GetFloatDefault("GoblinSize", SEC_CONSOLE);
    m_float_configs[CONFIG_WORGEN_SIZE] = sConfigMgr->GetFloatDefault("WorgenSize", SEC_CONSOLE);
    m_float_configs[CONFIG_PANDAREN_SIZE] = sConfigMgr->GetFloatDefault("PandarenSize", SEC_CONSOLE);
	m_float_configs[CONFIG_PANDARENALLIANCE_SIZE] = sConfigMgr->GetFloatDefault("PandarenAllianceSize", SEC_CONSOLE);
    m_float_configs[CONFIG_PANDARENHORDE_SIZE] = sConfigMgr->GetFloatDefault("PandarenHordeSize", SEC_CONSOLE);
    m_float_configs[CONFIG_MAGHARORC_SIZE] = sConfigMgr->GetFloatDefault("MagharOrcSize", SEC_CONSOLE);
    m_float_configs[CONFIG_TROLL_SIZE] = sConfigMgr->GetFloatDefault("TrollSize", SEC_CONSOLE);

=============================

For World.h, add these lines in the "enum WorldFloatConfigs" section:

    CONFIG_GNOME_SIZE,
    CONFIG_HUMAN_SIZE,
    CONFIG_ORC_SIZE,
    CONFIG_DWARF_SIZE,
    CONFIG_DARKIRONDWARF_SIZE,
    CONFIG_DRAENEI_SIZE,
    CONFIG_LIGHTFORGEDDRAENEI_SIZE,
    CONFIG_UNDEAD_SIZE,
    CONFIG_TAUREN_SIZE,
    CONFIG_HIGHMOUNTAINTAUREN_SIZE,
    CONFIG_BLOODELF_SIZE,
    CONFIG_VOIDELF_SIZE,
    CONFIG_NIGHTELF_SIZE,
    CONFIG_NIGHTBORNE_SIZE,
    CONFIG_WORGEN_SIZE,
    CONFIG_GOBLIN_SIZE,
    CONFIG_PANDAREN_SIZE,
    CONFIG_PANDARENALLIANCE_SIZE,
    CONFIG_PANDARENHORDE_SIZE,
    CONFIG_TROLL_SIZE,
    CONFIG_MAGHARORC_SIZE,

Then, in your worldserver config, place this text block somewhere inside:

###################################################################################################
# PLAYER RACE SIZE SETTINGS
#
#
GnomeSize = 1
HumanSize = 1
WorgenSize = 1
OrcSize = 1
MagharOrcSize = 1
GoblinSize = 1
PandarenSize = 1
PandarenAllianceSize = 1
PandarenHordeSize = 1
DraeneiSize = 1
LightForgedDraeneiSize = 1
DwarfSize = 1
DarkIronDwarfSize = 1
NightElfSize = 1
NightborneSize = 1
BloodElfSize = 1
VoidElfSize = 1
TrollSize = 1
TaurenSize = 1
HighMountainTaurenSize = 1
UndeadSize = 1
#
#
###################################################################################################
	

From this point, all you have to do is change the values in the worldserver config, then restart your server to see the modified size changes. This isn't the best solution to go about doing this, but it's the one way I managed to do so due to the lack of information regarding how to do this properly via the hotfix database.

 

Edited by Immense
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...