Honorable Member Mali 41830 Posted February 6, 2021 Honorable Member Share Posted February 6, 2021 27 minutes ago, Kafa said: As far as i remember, at the time when he released this topic those things were not there what? I don't care when they're there. I just said he could expand topic. 1 Link to comment Share on other sites More sharing options...
Kafa 153 Posted February 6, 2021 Share Posted February 6, 2021 1 hour ago, Mali61 said: what? I don't care when they're there. I just said he could expand topic. Ah okay, btw how are you bro 1 Link to comment Share on other sites More sharing options...
numNum 37 Posted February 6, 2021 Share Posted February 6, 2021 (edited) 7 hours ago, Mali61 said: You could expand the topic for locale_quest.txt and locale_quiz.txt keep it up, nice work That would be much appreciated from @Sonitex Edited February 6, 2021 by jeddawee Link to comment Share on other sites More sharing options...
Bot Metin2 Dev 4877 Posted February 12, 2021 Bot Share Posted February 12, 2021 nice Link to comment Share on other sites More sharing options...
Kafa 153 Posted February 13, 2021 Share Posted February 13, 2021 On 2/6/2021 at 11:47 PM, jeddawee said: That would be much appreciated from @Sonitex You can actually do it yourself too, isnt too hard i guess Link to comment Share on other sites More sharing options...
numNum 37 Posted February 13, 2021 Share Posted February 13, 2021 (edited) 2 hours ago, Kafa said: You can actually do it yourself too, isnt too hard i guess I actually tried to do it for quests, but the problem was the string sent from server side like this ex: [blalbalba][ENTER][DONE] I'm not that good to do it xD Edited February 13, 2021 by jeddawee Link to comment Share on other sites More sharing options...
DrTurk 133 Posted February 13, 2021 Share Posted February 13, 2021 (edited) look at say_in_map function with the header = HEADER_GC_SCRIPT Edited February 13, 2021 by DrTurk Link to comment Share on other sites More sharing options...
spectrum 7 Posted February 26, 2021 Share Posted February 26, 2021 (edited) dont't read for (const auto& format : FormatTable) more precisely auto error : locale.cpp:169: error: 'format' has not been declared a solution plizz? Edited February 26, 2021 by spectrum Link to comment Share on other sites More sharing options...
Silver Sonitex 1438 Posted February 26, 2021 Author Silver Share Posted February 26, 2021 49 minutes ago, spectrum said: dont't read for (const auto& format : FormatTable) more precisely auto error : locale.cpp:169: error: 'format' has not been declared a solution plizz? Hey! "auto" keyword is only supported by higher C++ versions, I believe it was introduced in C++11. You can replace it with "TFormat" and you should be just fine. For future use, I would suggest to upgrade your C++ language standard as it makes thing much simpler when programming. Link to comment Share on other sites More sharing options...
nikolaider 1 Posted February 27, 2021 Share Posted February 27, 2021 (edited) this is my char.cpp can you tell me what i made mistake on this and i get full of errors? https://metin2.dev/bin/?d7c88acc9acc2d29#Fy1mi4tMv9zCFNZ9sLL7uwGcsDBz4UFMBhVU8mvc6uRE i tried and with LocaleChatPacket and with ChatPacket. Edited February 27, 2021 by nikolaider 1 Link to comment Share on other sites More sharing options...
lordsas61 15 Posted September 22, 2021 Share Posted September 22, 2021 CQuestManager::Instance().AddScript(s.str() + "[ENTER]"); maybe change ? -> CQuestManager::Instance().AddScript(LocaleChatPacket(CHAT_TYPE_SAY, dwindex, "%s", s.str().c_str())+ "[ENTER]"); if i do it this way. Can I get quest texts from Metin2 locale pack? Link to comment Share on other sites More sharing options...
lordsas61 15 Posted October 27, 2021 Share Posted October 27, 2021 (edited) All time giving syserr. word character problem. LocaleStringManager::RegisterLocaleStringTable(locale/tr/locale_string.txt) - Strange Token Count [Line:550 / TokenCount:5] Line 550 -> 1550 You cannot use that any more. And errors. c = -35 Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Kafa 153 Posted November 1, 2021 Share Posted November 1, 2021 Can someone help me with Wedding & war_map ? I mean struct FNotice { FNotice(const char * psz) : m_psz(psz) { } void operator() (LPCHARACTER ch) { ch->ChatPacket(CHAT_TYPE_NOTICE, "%s", m_psz); } const char * m_psz; }; I would really love if someone extends the topic with notice, so i can actually use this beatiful release. Link to comment Share on other sites More sharing options...
DrTurk 133 Posted November 1, 2021 Share Posted November 1, 2021 Just create another function like that: void SendNoticeMapLocal(DWORD dwIndex, const char* c_pszBuf, int nMapIndex, bool bBigFont, ...) { BYTE type = 0; const DESC_MANAGER::DESC_SET& c_ref_set = DESC_MANAGER::instance().GetClientSet(); if (!c_pszBuf) return; DESC_MANAGER::DESC_SET::const_iterator it = c_ref_set.begin(); while (it != c_ref_set.end()) { LPDESC d = *(it++); if (d->GetCharacter()) { if (d->GetCharacter()->GetMapIndex() != nMapIndex) continue; bool isNotice = false; if (c_pszBuf == "%s") { char chatbuf[CHAT_MAX_LEN + 1]; va_list args; va_start(args, c_pszBuf); vsnprintf(chatbuf, sizeof(chatbuf), c_pszBuf, args); va_end(args); strlcpy(chatbuf, c_pszBuf, sizeof(chatbuf)); isNotice = true; } TEMP_BUFFER buf; if (bBigFont == true) { type = CHAT_TYPE_BIG_NOTICE; } else { type = CHAT_TYPE_NOTICE; } TPacketGCLocaleChat packet; packet.header = HEADER_GC_LOCALE_CHAT; packet.size = sizeof(TPacketGCLocaleChat); packet.type = type; packet.format = dwIndex; va_list args; va_start(args, bBigFont); FindFormatSpecifiers(c_pszBuf, args, &packet.size, &buf); va_end(args); d->Packet(&packet, sizeof(packet)); if (buf.size()) d->Packet(buf.read_peek(), buf.size()); } } } then you can use it like that: void WeddingMap::SetEnded(DWORD dwMapIndex) { if (m_pEndEvent) { sys_err("WeddingMap::SetEnded - ALREADY EndEvent(m_pEndEvent=%x)", get_pointer(m_pEndEvent)); return; } wedding_map_info* info = AllocEventInfo<wedding_map_info>(); info->pWeddingMap = this; m_pEndEvent = event_create(wedding_end_event, info, PASSES_PER_SEC(5)); SendNoticeMapLocal(889, " ", dwMapIndex, true); SendNoticeMapLocal(447, " ", dwMapIndex, true); 2 Link to comment Share on other sites More sharing options...
Kafa 153 Posted November 1, 2021 Share Posted November 1, 2021 6 hours ago, DrTurk said: Just create another function like that: void SendNoticeMapLocal(DWORD dwIndex, const char* c_pszBuf, int nMapIndex, bool bBigFont, ...) { BYTE type = 0; const DESC_MANAGER::DESC_SET& c_ref_set = DESC_MANAGER::instance().GetClientSet(); if (!c_pszBuf) return; DESC_MANAGER::DESC_SET::const_iterator it = c_ref_set.begin(); while (it != c_ref_set.end()) { LPDESC d = *(it++); if (d->GetCharacter()) { if (d->GetCharacter()->GetMapIndex() != nMapIndex) continue; bool isNotice = false; if (c_pszBuf == "%s") { char chatbuf[CHAT_MAX_LEN + 1]; va_list args; va_start(args, c_pszBuf); vsnprintf(chatbuf, sizeof(chatbuf), c_pszBuf, args); va_end(args); strlcpy(chatbuf, c_pszBuf, sizeof(chatbuf)); isNotice = true; } TEMP_BUFFER buf; if (bBigFont == true) { type = CHAT_TYPE_BIG_NOTICE; } else { type = CHAT_TYPE_NOTICE; } TPacketGCLocaleChat packet; packet.header = HEADER_GC_LOCALE_CHAT; packet.size = sizeof(TPacketGCLocaleChat); packet.type = type; packet.format = dwIndex; va_list args; va_start(args, bBigFont); FindFormatSpecifiers(c_pszBuf, args, &packet.size, &buf); va_end(args); d->Packet(&packet, sizeof(packet)); if (buf.size()) d->Packet(buf.read_peek(), buf.size()); } } } then you can use it like that: void WeddingMap::SetEnded(DWORD dwMapIndex) { if (m_pEndEvent) { sys_err("WeddingMap::SetEnded - ALREADY EndEvent(m_pEndEvent=%x)", get_pointer(m_pEndEvent)); return; } wedding_map_info* info = AllocEventInfo<wedding_map_info>(); info->pWeddingMap = this; m_pEndEvent = event_create(wedding_end_event, info, PASSES_PER_SEC(5)); SendNoticeMapLocal(889, " ", dwMapIndex, true); SendNoticeMapLocal(447, " ", dwMapIndex, true); Thanks buddy, im pretty sure we need to change something in client source too, am i right? Cause currently the chat packets are only appearing in chat. The big notice thing doesnt appear. If you understand me Link to comment Share on other sites More sharing options...
DrTurk 133 Posted November 1, 2021 Share Posted November 1, 2021 (edited) Ye didnt fix this yet, i'll fix that as soon as i have time for that. ok just edit this in client src: bool CPythonNetworkStream::RecvLocaleChatPacket() { TPacketGCLocaleChat kChat; if (!Recv(sizeof(kChat), &kChat)) return false; std::string localeString = ""; bool bSuccess = LocaleStringManager::Instance().FillLocaleString(kChat.format, localeString); if (!bSuccess) return false; if (CHAT_TYPE_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetTipMessage", Py_BuildValue("(s)", localeString.c_str())); } else if (CHAT_TYPE_BIG_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetBigMessage", Py_BuildValue("(s)", localeString.c_str())); } if (!localeString.empty()) CPythonChat::Instance().AppendChat(kChat.type, localeString.c_str()); return true; } Edited November 1, 2021 by DrTurk 1 Link to comment Share on other sites More sharing options...
Silver Sonitex 1438 Posted November 1, 2021 Author Silver Share Posted November 1, 2021 We can just use the default setup that is used in normal chat packet for displaying notices. UserInterface/PythonNetworkStreamPhaseGame.cpp - CPythonNetworkStream::RecvLocaleChatPacket() // Search: if(!localeString.empty()) CPythonChat::Instance().AppendChat(kChat.type, localeString.c_str()); // Replace: if(localeString.empty()) return true; if (CHAT_TYPE_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetTipMessage", Py_BuildValue("(s)", localeString.c_str())); } else if (CHAT_TYPE_BIG_NOTICE == kChat.type) { PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_SetBigMessage", Py_BuildValue("(s)", localeString.c_str())); } else CPythonChat::Instance().AppendChat(kChat.type, localeString.c_str()); 2 Link to comment Share on other sites More sharing options...
DrTurk 133 Posted November 1, 2021 Share Posted November 1, 2021 (edited) ye better, the thing that i did was without checking if the string is empty also created something for whisper because of duel: pkVictim->LocaleWhisperPacket(WHISPER_TYPE_SYSTEM , pkChr, 503, "%s challenged you to a battle!", pkChr->GetName()); but the ugliest part that i did was for the priv_empire, no one wants to see what i did there Edited November 1, 2021 by DrTurk 1 Link to comment Share on other sites More sharing options...
Silver Sonitex 1438 Posted November 1, 2021 Author Silver Share Posted November 1, 2021 1 minute ago, DrTurk said: ye better, the thing that i did was without checking if the string is empty Oh, I didn't see that you edited the post Better be safe in case the client cannot find the requested string and appends empty space in chat window. Thank you for sharing the notice function with others Link to comment Share on other sites More sharing options...
PetePeter 36 Posted November 2, 2021 Share Posted November 2, 2021 How about "BroadcastNotice" ? Actually we format the string before sending it, have any way to send the arguments to the "notice_packet_func" function ? Link to comment Share on other sites More sharing options...
Kafa 153 Posted November 2, 2021 Share Posted November 2, 2021 17 hours ago, DrTurk said: ye better, the thing that i did was without checking if the string is empty also created something for whisper because of duel: pkVictim->LocaleWhisperPacket(WHISPER_TYPE_SYSTEM , pkChr, 503, "%s challenged you to a battle!", pkChr->GetName()); but the ugliest part that i did was for the priv_empire, no one wants to see what i did there Can i ask you what you did at start_position.cpp/,h ? Link to comment Share on other sites More sharing options...
DrTurk 133 Posted November 2, 2021 Share Posted November 2, 2021 1 hour ago, Kafa said: Can i ask you what you did at start_position.cpp/,h ? If you talking about that -> char g_nation_name[4][32] = { "", "½Å¼ö±¹", "õÁ¶±¹", "Áø³ë±¹", }; I removed castle/monarch etc. on my source so i didnt had to translate that, but the same is for priv_empire function. I send Sonitex my way how i have done this, but i think its better i keep that for me. I dont have alot knowledge about coding, so I dont really know if it works with alot of players. My way is a very dirty solution for the problem 1 Link to comment Share on other sites More sharing options...
[DEV]Rexar 0 Posted April 30, 2022 Share Posted April 30, 2022 thanks Link to comment Share on other sites More sharing options...
raihan3 20 Posted October 13, 2022 Share Posted October 13, 2022 how can i put locale_string without index like : "%sÀÌ ÇÊ¿äÇÕ´Ï´Ù."; "%s needed."; not 1 %s needed. i mean without DWORD dwIndex Link to comment Share on other sites More sharing options...
Xyria 0 Posted October 14, 2022 Share Posted October 14, 2022 thanks Link to comment Share on other sites More sharing options...
Recommended Posts