Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: kestus0756 on July 11, 2016, 08:53:19 pm

Title: [TrinityCore 3.3.5a] Error creating a custom race character.
Post by: kestus0756 on July 11, 2016, 08:53:19 pm
So, I've experienced a problem. I've created 2 new custom races for my private server: Fel Orc and Broken. I go to character creation screen and then I'm trying to create for example a Fel Orc Warrior. So I did all stuff like change skin color and put a name, but when I click accept, it says "Error creating a character". Same with Broken or/and other classes, doesn't happen with blizzard already implemented races. Help would be appreciated.          http://prntscr.com/brmjx1 (http://prntscr.com/brmjx1" onclick="window.open(this.href);return false;)
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: Amaroth on July 12, 2016, 11:15:40 am
Its very likely that you have forgotten to add something on server side. First of all, check server.log. There might be some kind of hint there (and in such cases usually is). Also check your database, especially world database, tables playercreateinfo and player_levelstats (and other playersomething tables in general as well, but these are the most important). Haven't you forgotten to add data for new races there? And btw, position for creating character in playercreateinfo must NOT be in any kind of instance, otherwise you will get this error as well. And ofc, have you updated DBCs on server side? I guess you did, but just make double sure.
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: kestus0756 on July 12, 2016, 12:17:08 pm
When I open Worldserver.exe, after some time it says "Wrong race 12 in 'player_levelstats" AND not one time but many times like 20, but the Worldserver.exe doesn't force close though. Anyway to fix this? And yes, I defined the  races in SharedDefines.h, and updated the DBC server-side and client-side but that error still appears. Anyway to fix this? The first error happens aswell.
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: Amaroth on July 13, 2016, 08:30:49 am
And those database tables I've mentioned? They are essential. Btw, which DBCs have you edited. "I've done DBCs correctly!". Well, good for you, but if you haven't, noone has now any means by which he would judge if you actually did everything correctly. Provide also list of DBCs you have edited and in general, what you have done. Server encountered error while trying to make this race playable and that can be caused by huge variety of reasons.
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: kestus0756 on July 13, 2016, 10:30:48 am
Ok, all DBCs/XML/Lua files that I've updated:
CharacterCreate.LUA
CharacterCreate.XML
CharBaseInfo.DBC
CharStartOutfit.DBC
ChrRaces.DBC
Faction.DBC
GlueParent.LUA
GlueStrings.LUA
SkillLineAbility.DBC
SkillRaceClassInfo.DBC

And yes, I've checked Player_LevelStats and PlayerCreateInfo databases, PlayerCreateInfo is good, but not sure about Player_LevelStats. Can you help me through a teamviewer? I've been following this tutorial on how to make custom races: http://emudevs.com/showthread.php/121-H ... stom-Races (http://emudevs.com/showthread.php/121-How-to-Custom-Races" onclick="window.open(this.href);return false;)!
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: Amaroth on July 13, 2016, 04:56:49 pm
There's nothing difficult about player_levelstats. You just need to enter base stats there for each class of race you are adding. You don't need to fill all 80 levels, but you must enter stats for level 1. TC will use lower level's base stats for each character level which doesn't have base stats set here, but that, obviously, can't work for level 1. You can add higher level base stats later, when you get this to work.
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: kestus0756 on July 13, 2016, 08:31:43 pm
I already put the base stats for Race Broken (id 14) and Race Fel Orc (id 12) in player_levelstats database, even put them to level 80 and for other classes aswell, not just Warrior, but I'm still getting that error, I'm not sure what I did wrong. Here's 2 screenshots showing that I've put the base stats in that database http://prntscr.com/bshyuc (http://prntscr.com/bshyuc" onclick="window.open(this.href);return false;), http://prntscr.com/bsi2eo (http://prntscr.com/bsi2eo" onclick="window.open(this.href);return false;).
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: Amaroth on July 14, 2016, 10:17:24 am
It doesn't really matter what do those stats really look like, its just needed to have at least something there. As long as you have stats for all classes of your races defined in CharBaseInfo.dbc for their level 1, it should be OK. If you have that, well, I am not sure what else could go wrong. The best would be if someone really went though your code, DB and DBCs. I am not really the most suitable person for that, because while I know how stuff like this generally works, I've never really added new custom race and also can't code in core or C++ whatsoever. I just know most of things which can go wrong whenever one touches classes and races in general (even those existing ones).
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: kestus0756 on July 14, 2016, 07:13:47 pm
Well, I've went to CharBaseInfo.dbc, there was two exact same rows, I deleted one row and kept one. So, I've opened WoW and then it just says the same error when I try to create a character. (Yes, I've did replaced the edited CharBaseInfo.dbc server-side and client-side aswell). Do you maybe have some friends that can help me then?
Title: Re: [TrinityCore 3.3.5a] How do I fix this error?
Post by: Amaroth on July 14, 2016, 07:32:02 pm
I don't have any real "friends" who did this already before, but there are plenty of guys around who should know a thing or two about adding new races to WoW. I'm quite surprised noone wrote here yet. Maybe rename topic, "How do I fix this error" isn't really descriptive. Something like "[TC 3.3.5a] Error creating custom race character" would be better.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: kestus0756 on July 14, 2016, 08:40:45 pm
Well, thanks anyways, have a nice day.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Ascathos on July 14, 2016, 09:14:56 pm
worldserver most likly has an error output for an unknown class race combination that is flagged as cheating. Make sure to add the combination into any relevant player_ table. Also, check for the error. If you checked every player_ table in world and do not know what to do with the error, post here.

Consider changing worldserverconfig logging to debug.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: kestus0756 on July 15, 2016, 09:09:39 am
I already checked all playercreateinfo tables and they were fine. How do I change the worldserver.conf into debug mode?
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Ascathos on July 15, 2016, 08:56:18 pm
Should actually display an error on default. Press create and check worldserver. Is there a printout ?
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: kestus0756 on July 17, 2016, 01:31:42 pm
Where is that "create" button?
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Ascathos on July 17, 2016, 01:50:06 pm
IF you enter Character creation, change your char to preference and press continue.

Expected Behavior: It should send you to Character Login without Popup. Character should be in Login displayed.

Actual behavior: Failed to create charater. An error is in 100% of all cases in Worldserver.

 Find that one. Should be on the bottom, one of the first after pressing continue.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: kestus0756 on July 17, 2016, 03:31:51 pm
"Player::Create: Possible hacking-attempt: account 3 tried creating a character named "Test" with an invalid race/class pair (12/7) - refusing to do so" I think that's what you mean.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Amaroth on July 17, 2016, 08:38:15 pm
In the end, nothing new. Can someone who actually can find a thing in core create a list of things which are checked by worldserver while its determining wheter race and class combination is correct or no? it would be much easier to find a thing which kestus has forgotten or missed.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: kestus0756 on July 18, 2016, 11:03:04 am
Yeah, a LOT easier.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Ascathos on July 18, 2016, 08:54:33 pm
Code: [Select]
bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::CharacterCreateInfo const* createInfo)
{
    //FIXME: outfitId not used in player creating
    /// @todo need more checks against packet modifications

    Object::_Create(ObjectGuid::Create<HighGuid::Player>(guidlow));

    m_name = createInfo->Name;

    PlayerInfo const* info = sObjectMgr->GetPlayerInfo(createInfo->Race, createInfo->Class);
    if (!info)
    {
        TC_LOG_ERROR("entities.player", "Player::Create: Possible hacking attempt: Account %u tried to create a character named '%s' with an invalid race/class pair (%u/%u) - refusing to do so.",
                GetSession()->GetAccountId(), m_name.c_str(), createInfo->Race, createInfo->Class);
        return false;
    }

PlayerInfo is built in
void ObjectMgr::LoadPlayerInfo()

More precisely
Code: [Select]
   {
        uint32 oldMSTime = getMSTime();
        //                                                0     1      2    3        4          5           6
        QueryResult result = WorldDatabase.Query("SELECT race, class, map, zone, position_x, position_y, position_z, orientation FROM playercreateinfo");

        if (!result)
        {
            TC_LOG_ERROR("server.loading", ">> Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
            exit(1);
        }
        else
        {
            uint32 count = 0;

            do
            {
                Field* fields = result->Fetch();

                uint32 current_race  = fields[0].GetUInt8();
                uint32 current_class = fields[1].GetUInt8();
                uint32 mapId         = fields[2].GetUInt16();
                uint32 areaId        = fields[3].GetUInt32(); // zone
                float  positionX     = fields[4].GetFloat();
                float  positionY     = fields[5].GetFloat();
                float  positionZ     = fields[6].GetFloat();
                float  orientation   = fields[7].GetFloat();

                if (current_race >= MAX_RACES)
                {
                    TC_LOG_ERROR("sql.sql", "Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
                    continue;
                }

                ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race);
                if (!rEntry)
                {
                    TC_LOG_ERROR("sql.sql", "Wrong race %u in `playercreateinfo` table, ignoring.", current_race);
                    continue;
                }

                if (current_class >= MAX_CLASSES)
                {
                    TC_LOG_ERROR("sql.sql", "Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
                    continue;
                }

                if (!sChrClassesStore.LookupEntry(current_class))
                {
                    TC_LOG_ERROR("sql.sql", "Wrong class %u in `playercreateinfo` table, ignoring.", current_class);
                    continue;
                }

                // accept DB data only for valid position (and non instanceable)
                if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation))
                {
                    TC_LOG_ERROR("sql.sql", "Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
                    continue;
                }

                if (sMapStore.LookupEntry(mapId)->Instanceable())
                {
                    TC_LOG_ERROR("sql.sql", "Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race);
                    continue;
                }

                PlayerInfo* info = new PlayerInfo();
                info->mapId = mapId;
                info->areaId = areaId;
                info->positionX = positionX;
                info->positionY = positionY;
                info->positionZ = positionZ;
                info->orientation = orientation;
                info->displayId_m = rEntry->MaleDisplayID;
                info->displayId_f = rEntry->FemaleDisplayID;
                _playerInfo[current_race][current_class] = info;

                ++count;
            }
            while (result->NextRow());

            TC_LOG_INFO("server.loading", ">> Loaded %u player create definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
        }
    }
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: kestus0756 on July 19, 2016, 07:34:34 am
I did every single thing right, not even an one mistake but that error shows up still, I've rechecked everything like 2 times now and nothing wrong. Could you actually help me through a teamviewer or something because I honestly have no clue what's wrong?
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Ascathos on July 19, 2016, 07:28:51 pm
I send you a pm with my skype addy. From there we'll try to find some time.

If I find the source for the problem, I'll note it here.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: soliant on November 28, 2016, 09:00:02 pm
Have you find the error for the "wrong xx race in playercreateinfo.......".

I've got the same error with mangos core 3.3.5a rev.12340.
Title: Re: [TrinityCore 3.3.5a] Error creating a custom race charac
Post by: Ascathos on November 28, 2016, 09:29:22 pm
Quote from: "soliant"
Have you find the error for the "wrong xx race in playercreateinfo.......".

I've got the same error with mangos core 3.3.5a rev.12340.
Never worked much with Mangos, despite it being the initial source to TC. However, it should be about the same cause of error.