-
Posts
1797 -
Joined
-
Last visited
-
Days Won
4 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by ReFresh
-
-
File: root/uiattachmetin.py
SpoilerFind: newToolTip.SetPosition(230 + 20, 38) Change to: newToolTip.SetPosition(300 + 20, 38) Find: newWidth = self.newToolTip.GetWidth() + 230 + 15 + 20 Change to: newWidth = self.newToolTip.GetWidth() + 300 + 15 + 20 Find: self.SetPosition(x, y) Change to: self.SetCenterPosition()
File: uiscript/attachstonedialog.py
SpoilerI believe this will fix your problem with font.
-
I would be really glad, if someone can help me little bit, because I'm really stucked here and got no idea how to get the invite senderName on the invited player question dialog. I think problem is on server side, where it's not getting the senderName value.
File: src/game/guild.cpp
Spoilervoid CGuild::Invite( LPCHARACTER pchInviter, LPCHARACTER pchInvitee ) { { ... } DWORD gid = GetID(); TPacketGCGuild p; p.header = HEADER_GC_GUILD; p.size = sizeof(p) + sizeof(DWORD) + GUILD_NAME_MAX_LEN + 1 + CHARACTER_NAME_MAX_LEN + 1; //Added + CHARACTER_NAME_MAX_LEN + 1 p.subheader = GUILD_SUBHEADER_GC_GUILD_INVITE; TEMP_BUFFER buf; buf.write( &p, sizeof(p) ); buf.write( &gid, sizeof(DWORD) ); buf.write( GetName(), GUILD_NAME_MAX_LEN + 1 ); buf.write( pchInvitee->GetName(), CHARACTER_NAME_MAX_LEN + 1 ); //Added this line pchInvitee->GetDesc()->Packet( buf.read_peek(), buf.size() ); }
File: UserInterface/PythonNetworkStreamPhaseGame.cpp
Spoilercase GUILD_SUBHEADER_GC_GUILD_INVITE: { DWORD dwGuildID; if (!Recv(sizeof(dwGuildID), &dwGuildID)) return false; char szGuildName[GUILD_NAME_MAX_LEN + 1]; if (!Recv(GUILD_NAME_MAX_LEN, &szGuildName)) return false; //ADDED THIS: char szSenderName[CHARACTER_NAME_MAX_LEN + 1]; if (!Recv(CHARACTER_NAME_MAX_LEN, &szSenderName)) return false; szGuildName[GUILD_NAME_MAX_LEN] = 0; //ADDED THIS: szSenderName[CHARACTER_NAME_MAX_LEN] = 0; PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "RecvGuildInviteQuestion", Py_BuildValue("(iss)", dwGuildID, szGuildName, szSenderName)); //ADDED 's' and szSenderName Tracef(" <Guild Invite> %d, %s, %s\n", dwGuildID, szGuildName, szSenderName); break; }
File: root/game.py
Spoilerdef RecvGuildInviteQuestion(self, guildID, guildName, senderName): #Added senderName {...} guildInviteQuestionDialog.SetText1(localeInfo.GUILD_DO_YOU_JOIN_1 % (senderName, guildName)) #Added senderName {...}
File: locale/locale_game.txt
SpoilerGUILD_DO_YOU_JOIN_1 %s invited you to guild %s. #ADDED %s for senderName
-
Because there's a limit 15 levels between monster and player, if I remember that right. So, if the player will be the same level as the monster, it will drop items, but when the player level is >= 15 then it won't drop items.
-
On 6/15/2022 at 2:47 AM, VegaS™ said:
Video with the fix: https://metin2.download/video/gV3x7RhoJZsJnMY6C61nEvmBOGrvnNn0/.mp4
I just implemented right now that function and after some tests, I found that GetPartItemID was always set to 0 when you used an emotion with a weapon equipped, from here.
The problem itself is the ChangeWeapon function, which is responsible for refreshing the weapon index and the refresh state of the wait motion, but that wasn't called properly because it always got blocked in the following condition:
Hidden Contentvoid CInstanceBase::ChangeWeapon(DWORD eWeapon) { if (eWeapon == m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON)) return; if (SetWeapon(eWeapon)) RefreshState(CRaceMotionData::NAME_WAIT, true); }
In order that when you unequip an item from the server, it's called the ChangeWeapon(0), which means eWapon = 0, and the GetPartItemID(CRaceData::PART_WEAPON) = 0 as well, since it was set from the previous use of motion.
For fixing it, we just have to add into our condition if the eWeapon it's not 0, so it will let the function to work properly.
Hidden Content// Search for the following condition: if (eWeapon == m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON)) // Replace it with: if (eWeapon && eWeapon == m_GraphicThingInstance.GetPartItemID(CRaceData::PART_WEAPON))
This visual bug happens when you use above solution:
SpoilerSo, if someone got some time to investigate that bug and can share with us the solution, it would be really nice!
-
@OwsapThanks, for the release. Good job! Would be nice, if you can do something like that for question dialogs too, because when you want to drop for example 1000x pcs of some item, the text will overflow the question dialog (sometimes it happens with lower counts of item, for example books, they have a long names). Do something like when the text can overflow the question dialog width, then add 20px to question dialog width.
- 2
-
-
-
@martysama0134 So, if I understand to that right, it's a global fix for all default sources?
Did I do it right?
Spoiler -
@martysama0134 Yea, now the distance between characters is reduced, but on the attacked traget screen it still looks like the attacker is not attacking me and is fighting something invisible -> hitting a free space where is no-one.
-
Someone got an solution for that? Still got no idea, how to fix it.
-
@VegaS™It must be a game problem, because it's not happening in Windows at all. It's happening only when game is in windowed mode. So problem must be somewhere in the source idk. I had chance to test it on one server and there wasn't this issue. So I believe it's a game problem.
- 1
-
-
Hey guys,
I'm trying to center whole quest window with content inside by extending the say_size function, but the text is overflowing quest window (quest window is not resized after changes mentioned below).
Client/PythonEventManager.cpp:
Spoilercase EVENT_TYPE_WINDOW_SIZE: { int iWidth = atoi(GetArgument("width", ScriptCommand.argList)); int iHeight = atoi(GetArgument("height", ScriptCommand.argList)); int iXpos = atoi(GetArgument("x", ScriptCommand.argList)); int iYpos = atoi(GetArgument("y", ScriptCommand.argList)); PyCallClassMemberFunc(pEventSet->poEventHandler, "OnSize", Py_BuildValue("(iiii)", iWidth, iHeight, iXpos, iYpos)); break; }
Server/questlib.lua
Spoilerfunction say_size(width, height, x, y) raw_script("[WINDOW_SIZE width;"..width.."|height;"..height.."|x;"..x.."|y;"..y.."]") end
Quest function use:
Spoilersay_size(463, 300, -50, 0)
I will be really glad if someone can tell me where should be the mistake and why it's happening.
Thanks for possible answers!
Sincerely,
ReFresh
-
This is the RecvMainCharacter() function (read comments in code to know what I mean):
Default code:
SpoilerClient/PythonNetworkStreamPhaseLoading.cpp:
Spoilerbool CPythonNetworkStream::RecvMainCharacter() { TPacketGCMainCharacter MainChrPacket; if (!Recv(sizeof(TPacketGCMainCharacter), &MainChrPacket)) return false; m_dwMainActorVID = MainChrPacket.dwVID; m_dwMainActorRace = MainChrPacket.wRaceNum; m_dwMainActorEmpire = 0; //What about this? Is this line right? m_dwMainActorSkillGroup = MainChrPacket.bySkillGroup; m_rokNetActorMgr->SetMainActorVID(m_dwMainActorVID); CPythonPlayer& rkPlayer=CPythonPlayer::Instance(); rkPlayer.SetName(MainChrPacket.szName); rkPlayer.SetMainCharacterIndex(GetMainActorVID()); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_LOAD], "LoadData", Py_BuildValue("(ii)", MainChrPacket.lX, MainChrPacket.lY)); //Tracef(" >> RecvMainCharacter\n"); SendClientVersionPacket(); return true; }
Client/Packet.h:
Spoilertypedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lX, lY, lZ; BYTE bySkillGroup; //Missing BYTE byEmpire or empire? } TPacketGCMainCharacter;
Server/Packet.h:
Spoilertypedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lx, ly, lz; BYTE empire; //But here in server source is the BYTE empire. Why it doesn't exist in client source? BYTE skill_group; } TPacketGCMainCharacter;
So should I change it like this?
SpoilerClient/PythonNetworkStreamPhaseLoading.cpp:
Spoilerbool CPythonNetworkStream::RecvMainCharacter() { TPacketGCMainCharacter MainChrPacket; if (!Recv(sizeof(TPacketGCMainCharacter), &MainChrPacket)) return false; m_dwMainActorVID = MainChrPacket.dwVID; m_dwMainActorRace = MainChrPacket.wRaceNum; m_dwMainActorEmpire = MainChrPacket.empire; //Here is the change m_dwMainActorSkillGroup = MainChrPacket.bySkillGroup; m_rokNetActorMgr->SetMainActorVID(m_dwMainActorVID); CPythonPlayer& rkPlayer=CPythonPlayer::Instance(); rkPlayer.SetName(MainChrPacket.szName); rkPlayer.SetMainCharacterIndex(GetMainActorVID()); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_LOAD], "LoadData", Py_BuildValue("(ii)", MainChrPacket.lX, MainChrPacket.lY)); //Tracef(" >> RecvMainCharacter\n"); SendClientVersionPacket(); return true; }
Client/Packet.h:
Spoilertypedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lX, lY, lZ; BYTE empire; //Here is the change BYTE bySkillGroup; } TPacketGCMainCharacter;
Server/Packet.h:
Spoilertypedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lx, ly, lz; BYTE empire; //Here is no change BYTE skill_group; } TPacketGCMainCharacter;
Or like this?
SpoilerClient/PythonNetworkStreamPhaseLoading.cpp:
Spoilerbool CPythonNetworkStream::RecvMainCharacter() { TPacketGCMainCharacter MainChrPacket; if (!Recv(sizeof(TPacketGCMainCharacter), &MainChrPacket)) return false; m_dwMainActorVID = MainChrPacket.dwVID; m_dwMainActorRace = MainChrPacket.wRaceNum; m_dwMainActorEmpire = MainChrPacket.byEmpire; //Here is the change m_dwMainActorSkillGroup = MainChrPacket.bySkillGroup; m_rokNetActorMgr->SetMainActorVID(m_dwMainActorVID); CPythonPlayer& rkPlayer=CPythonPlayer::Instance(); rkPlayer.SetName(MainChrPacket.szName); rkPlayer.SetMainCharacterIndex(GetMainActorVID()); PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_LOAD], "LoadData", Py_BuildValue("(ii)", MainChrPacket.lX, MainChrPacket.lY)); //Tracef(" >> RecvMainCharacter\n"); SendClientVersionPacket(); return true; }
Client/Packet.h:
Spoilertypedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lX, lY, lZ; BYTE byEmpire; //Here is the change BYTE bySkillGroup; } TPacketGCMainCharacter;
Server/Packet.h:
Spoilertypedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lx, ly, lz; BYTE byEmpire; //Here is the change BYTE skill_group; } TPacketGCMainCharacter;
Should I change it and which change should I apply and what kind of bug it can cause, if I'll use it as it is? Check all the spoilers and compare them too see what should be probably changed.
I hope it's more clear now.
Thanks for your answer!
-
Sysser clean?
-
@supraCheck your loginwindow.py, it looks like you did some syntax mistake.
-
Hey guys,
I'm wondering, if this packet function can cause some bug, because there're missing some values:
SpoilerClient/PythonNetworkStreamPhaseLoading.cpp:
bool CPythonNetworkStream::RecvMainCharacter() m_dwMainActorEmpire = 0; // Possible bug?
Client/Packet.h:
typedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lX, lY, lZ; BYTE bySkillGroup; //Missing BYTE empire or byEmpire;??? } TPacketGCMainCharacter;
Server/Packet.h:
typedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lx, ly, lz; BYTE empire; //Exist here. Should be here byEmpire???? BYTE skill_group; } TPacketGCMainCharacter;
Shouldn't it be like:
SpoilerClient/PythonNetworkStreamPhaseLoading.cpp:
bool CPythonNetworkStream::RecvMainCharacter() m_dwMainActorEmpire = MainChrPacket.empire; //or byEmpire???
Client/Packet.h:
typedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lX, lY, lZ; BYTE empire; // or byEmpire?? BYTE bySkillGroup; } TPacketGCMainCharacter;
Server/Packet.h:
typedef struct packet_main_character { BYTE header; DWORD dwVID; WORD wRaceNum; char szName[CHARACTER_NAME_MAX_LEN + 1]; long lx, ly, lz; BYTE empire; //or byEmpire??? BYTE skill_group; } TPacketGCMainCharacter;
I will be glad, if someone with programming experience can check it and tell me, if I'm right.
Thanks for possible answers!
Sincerely,
ReFresh
-
Hey guys,
I'm trying to extend def AppendPrice(self, price): function by getItemCount, so I can use in this function something like: if getItemCount >1:. Is here anyone who can help me with that? I was trying to make it work but I was getting errors.
Thanks for possible answers!
Sincerely,
ReFresh
-
@SDlongju2Set item flag in database to 4 instead of 132.
-
-
-
@ Syreldar Yes, there is no better solution by Lua, but I was talking about the leaving the group or destroying group trough channels automatically, but it will be a little bit complicated to make something like that in C++. So I'll stay with what you wrote.
-
@ SyreldarThanks for your answer. I wanted to do something like this:
Spoilerfunction party_member_counting() local pids = {party.get_member_pids()} local player_count = 0 for i, pid in pids do player_count = player_count + 1 end return player_count end
And then in empire change process:
Spoilerif party.is_party() then local party_member_count = change_empire.party_member_counting() if party_member_count == 2 then party.delete_party() end if party_member_count >= 3 then if party.is_leader() then party.delete_party() elseif not party.is_leader() then party.leave_party() end end end
But after you said, there are more things which can be passed by just a channel change, it will probably require many source changes. So in this case it's better use what you wrote, because I don't have a c++ knowledge to change things like this in source. So thanks anyway. But would be nice, if someone could provide us a c++ part to make this thing working like I wrote.
-
Hey guys,
I'm trying to find a way how to change function below to check member pids on every map index, because it's checking party members count only on map where everyone of party is.
I know, I could use this function: ForEachOnlineMember, but I need to check party members count when they're offline too.
Why I need to do that? I need to remove party member from party when the party member change the empire.
File: questlua_party.cpp
SpoilerALUA(party_get_member_pids) { CQuestManager & q = CQuestManager::instance(); LPCHARACTER ch = q.GetCurrentCharacterPtr(); LPPARTY pParty = ch->GetParty(); if (NULL == pParty) { return 0; } FPartyPIDCollector f; pParty->ForEachOnMapMember(f, ch->GetMapIndex()); for (std::vector <DWORD>::iterator it = f.vecPIDs.begin(); it != f.vecPIDs.end(); it++) { lua_pushnumber(L, *it); } return f.vecPIDs.size(); }
Anyone know the solution? I'll be really really glad for that!
Thanks for possible answers!
Sincerely,
ReFresh
boss victim calculation problem
in Community Support - Questions & Answers
Posted · Edited by ReFresh
GameLib/ActorInstanceBattle.cpp:
1. #include "../UserInterface/PythonNonPlayer.h" at the top under the other includes.
2. Look for:
Below add:
This will fix the problem with bosses, which are using skills. If you're talking about player sync delay this is the only solution: