• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Help] Npcs not working

Status
Not open for further replies.
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
I'm making a clean v17 source , but I have a problem, I added the v17 npcs but most when I click the trade menu doesn't open or anything, what could be the cause?
 
Experienced Elementalist
Joined
Jan 7, 2020
Messages
257
Reaction score
97
did you add currency icon or whatever it calls?
There’s gotta be error log , Post it here.
 
Upvote 0
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
I only copied the original models, etc, its all working i see the maps correctly and npc's, but when i click them it simply i see no menu to click for trade or other.

On the error log i have only this (it only happens when i join the server), but i dont think that has any to do with an npc since the log is only when i join.

2022/ 5/12 01:44:32 ::LoadTextureFromRes : Icon\ not found
2022/ 5/12 01:44:32 CTexture::LoadTexture : Icon\ read error

The buff pang npc also not work, for now i only can see the [General] Lui and Housing npc working, the other i see no menu



Edit:

I fixed the

LoadTextureFromRes & LoadTexture errors, now 0 errors in logs, but still menu of almost all npc arent working.
 
Upvote 0
Newbie Spellweaver
Joined
Dec 17, 2018
Messages
33
Reaction score
25
The actions that are triggered by clicking an NPC's menu is not handled in the resource files, but in WndWorld.
Think about the game as windows. The world display is its own window, inside which you can find several more windows like status, taskbar, chat and so on.
When you open an NPC menu, that is another window as well.
And when you click a button on that menu, it sends a notification to the world window, handled in CWndWorld::OnCommand.

If you go there, you'll find the handle for (almost?) every single menu option that already existed in your source. It's up to you to add the new ones and what they do.
 
Upvote 0
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
The npcs have only the MMI_TRADE menu, that is already on the source and it still dont open
 
Upvote 0
Newbie Spellweaver
Joined
Dec 17, 2018
Messages
33
Reaction score
25
If MMI_TRADE is properly handled and fully functional, then the server should receive a "PACKETTYPE_OPENSHOPWND" packet.
If that packet is properly handled server-side, and the server determines that the player is able to open the NPC's shop, the client should receive a "SNAPSHOTTYPE_OPENSHOPWND" reply.

If you have added tabbed inventory to your source, the issue could come from handling that reply. (Edit: nvm vendors always had tabs lol)

Otherwise, you'll need to try and debug your worldserver : find where PACKETTYPE_OPENSHOPWND is handled, add debug printouts and/or stop points, so you can gather more informations about where do things go wrong.

I also notice the only errors you provided came from the client logs, is there really nothing from the server ones?
 
Upvote 0
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
I did debug like u said on WorldServer - OnOpenShopWnd i added a message at the top, on the npcs that work i receive the message, but on the npcs that i see no menu i received no message, so i see like OnOpenShopWnd on some npc is not called but idk why
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Dec 17, 2018
Messages
33
Reaction score
25
If CDPSrvr::OnOpenShopWnd is not called when you click on the Trade option, then something goes wrong before the packet is sent, which means the issue is somewhere in the client. Still not the answer we're looking for but it's progress.

Next step then is to debug the client. Try to navigate your way through the mess of CWndWorld::OnCommand, placing either stop points or debug logs every step so you can see which one doesn't get triggered. This will let you pinpoint the error more accurately.



Another thing, when you say that you see no menu, you mean clicking on the trade option doesn't do anything? Or you literally don't have any menu option for these NPC? (because if so, that'd be a completely different issue)
 
Upvote 0
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
I dont have a menu option, when i click them nothing happens, no gui to select a dialog or trade, nothing.

From what i saw is ShowMoverMenu which is the responsible of open the menu for the player.

I did debug and the code stops executing starting from this line, so is a problem with GetCharacter on ShowMoverMenu

LPCHARACTER lpCharacter = pTarget->GetCharacter();
if( lpCharacter ) // not running after that

Yeah, did a debug on GetCharacter method and it return nulls for the npcs that i see no menu, why
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Dec 17, 2018
Messages
33
Reaction score
25
My bad then, misunderstood the issue.
If GetCharacter returns null, that might be because the npc doesn't exist in character.inc, which is also where the content of the npc menu is set.
 
Upvote 0
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
All npc are on character.inc so is not because of that, but i did a debug on CProject::LoadCharacter

BOOL CProject::LoadCharacter( LPCTSTR szFileName )
{
CScript script;

if(script.Load(szFileName)==FALSE)
return FALSE;

CString strName;
LPCHARACTER lpCharacter;
script.GetToken(); // Mover name
strName = script.Token;
while( script.tok != FINISHED)
{
lpCharacter = new CHARACTER;
lpCharacter->Clear();
// 맵에 추가되는 것은 lowercase다. 그런데, 유일한 key 스트링이 lowercase로 맵에 추가되면
// 원본 자체가 손상되는 결과구 그 리스트를 뽑아낼 때도 모두 lowercase가 되므로 원본을 m_szKey에
// 보관해두는 것이다.
_tcscpy( lpCharacter->m_szKey, strName );
strName.MakeLower();

Error("Got %s", strName);

And for some reason i dont get "Got mafl_postbox" for example, or the others that dont work, i only receive the ones that i can open the menu that are like only 300 from the 1000+ that are on the character.inc, all npc are there on character.inc
 
Upvote 0
Newbie Spellweaver
Joined
Dec 17, 2018
Messages
33
Reaction score
25
Malformed character.inc then maybe? If you didn't change anything in ::LoadCharacter, that's the only thing I can think of.
 
Upvote 0
Newbie Spellweaver
Joined
May 11, 2022
Messages
11
Reaction score
1
Actually yes, that worked, but i dont know what is wrong since i copied the original v17 character.inc

now i put v15 character.inc and it worked

I used my character.inc, and i added the missing v17 characters and it worked, thanks a lot you the best Arektor
 
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top