Source Development Swhmap Whit Names

ximboliex

Pirate
Registered
LV
0
 
Joined
Jan 29, 2026
Messages
14
Reaction score
8
Points
8
Location
Panama
As you know, the portals created in mapnameSwhmap.txt don't have names to identify them, only the teleport function itself. Well, today I'll show you how to name them; it's simple. Upon reviewing that, I realized that the client already supported the name for that type of entity, it was just that the server was sending the name.

Src/Libraries/common/include/SwitchMapRecord.h:

Reemplace this:
C++:
class CSwitchMapRecord : public CRawDataInfo
{
public:

    long    lID;
    long    lEntityID;
    long    lEventID;
    Point    SEntityPos;
    short    sAngle;

    _TCHAR    szTarMapName[defMAP_NAME_LEN];

    Point    STarPos;

};

With this
Code:
class CSwitchMapRecord : public CRawDataInfo
{
public:

    long    lID;
    long    lEntityID;
    long    lEventID;
    Point    SEntityPos;
    short    sAngle;

    _TCHAR    szTarMapName[defMAP_NAME_LEN];

    Point    STarPos;

    char szName[64];    //map name
};

Src/Libraries/common/src/SwitchMapRecord.cpp

search for this:
C++:
    n = Util_ResolveTextLine(strLine.c_str(),strList,80,',');
    pInfo->STarPos.x = Str2Int(strList[0]);
    pInfo->STarPos.y = Str2Int(strList[1]);


Add this right below:
C++:
    // Activate Determinant Requirement
    m++;
    // Portal Name
    _tcsncpy(pInfo->szName,ParamList[m++].c_str(),63);
    pInfo->szName[63] = '\0';
        return TRUE;
    }


Src/Server/GameServer/src/EntitySpawn.cpp

search: CMapSwitchEntitySpawn::Load

and just below:

C++:
CEvtCont.SetTableRec(pCSwitchMapRecord);

add this :
C++:
CEvtCont.SetName(pCSwitchMapRecord->szName);


and Done, Enjoy!

now can change name on mapnameSwhmap.txt

Code:
//ID    binded entity ID    incident type    entity placement location    entity placement direction    Target map name    Target map location    Activate Determinant Requirement    Name
3    193    1    26875,178275    -1    lonetower    35178,37078    1    Sacred Forest - Lone Tower 1
 

Attachments

  • Captura de pantalla 2026-05-11 112153.webp
    Captura de pantalla 2026-05-11 112153.webp
    59 KB · Views: 13
  • Captura de pantalla 2026-06-02 131143.webp
    Captura de pantalla 2026-06-02 131143.webp
    67.8 KB · Views: 13
i like to see with my eyes sir. Where is the TXT mentioned? *mapnameSwhmap, cant find it on alot of sources
GameServer\resource\garner\garnerswhmap.txt
GameServer\resource\jialebi\jialebiswhmap.txt
etc
 
  • Like
Reactions: JamePOWER1