• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Level Rang Name. Where i find line with this function?

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
I looking a src and cant find line withg information with name character.
I wanna add level and rang up character outfit.
Some tips?
 
Solution
engine version...?

if something like 0.3+

you can trying edit it in protocolgame.cpp
find it:
C++:
void ProtocolGame::AddCreature(NetworkMessage_ptr msg, const Creature* creature, bool known, uint32_t remove)
below:
C++:
    if(!known)
    {
        msg->AddU16(0x61);
        msg->AddU32(remove);
        msg->AddU32(creature->getID());

try with something like this:
C++:
        std::string nickname= creature->getName();
        if (const Player* target = creature->getPlayer())
                nickname = "Level " + target->getLevel() + nickname;

over "}" from condition if(!known) add:
C++:
msg->AddString(creature->getHideName() ? "" : nickname);
i have no idea about your TFS version and iam not good in otc but i know how to do it ( not sure if it will work ), and i know nothing about your military system
Or maybe the level next to the character's name?
 
engine version...?

if something like 0.3+

you can trying edit it in protocolgame.cpp
find it:
C++:
void ProtocolGame::AddCreature(NetworkMessage_ptr msg, const Creature* creature, bool known, uint32_t remove)
below:
C++:
    if(!known)
    {
        msg->AddU16(0x61);
        msg->AddU32(remove);
        msg->AddU32(creature->getID());

try with something like this:
C++:
        std::string nickname= creature->getName();
        if (const Player* target = creature->getPlayer())
                nickname = "Level " + target->getLevel() + nickname;

over "}" from condition if(!known) add:
C++:
msg->AddString(creature->getHideName() ? "" : nickname);
 
Last edited:
Solution
engine version...?

if something like 0.3+

you can trying edit it in protocolgame.cpp
find it:
C++:
void ProtocolGame::AddCreature(NetworkMessage_ptr msg, const Creature* creature, bool known, uint32_t remove)
below:
C++:
    if(!known)
    {
        msg->AddU16(0x61);
        msg->AddU32(remove);
        msg->AddU32(creature->getID());

try with something like this:
C++:
        std::string nickname= creature->getName();
        if (const Player* target = creature->getPlayer())
                nickname = "Level " + target->getLevel() + nickname;

over "}" from condition if(!known) add:
C++:
msg->AddString(creature->getHideName() ? "" : nickname);
TFS 1.3
Thanks for little help.
do you can change this for TFS 1.3???

I try change somethink thanks :p
 
Last edited:
Back
Top