[TQ Binaries] Discussion and documentation

01/14/2012 23:38 Kiyono#16
Well I at least have the information now. Time to figure out how to actually apply this but judging from the huge list of possible action types and my rather poor coding skills; I won't get very far. Is there any source out there with a working TQ style npc system? I would like to have a reference.
01/14/2012 23:42 Korvacs#17
I know of 1 other source other than the l2h source that me and lat are working on that has it, and its not public to my knowledge, the implementation is also incorrect in it.
01/14/2012 23:43 Kiyono#18
How exactly can the implementation be incorrect? I mean if it works, doesn't that mean that it's correct? It wouldn't work otherwise.
01/14/2012 23:51 Korvacs#19
The decision process wasnt correct, so to counter that they had to also manually write in some npcs. As a result it was more of a hybrid system, some basic actiontypes and npcs worked with it, and the rest were done manually, no way near a fully correct implementation.
01/14/2012 23:56 Kiyono#20
So how hard is it to at least implement a basic working system? (click npc, show dialog and dialog options)
//edit Skimming through the old Eudemons source (and found out that C++ is incomprehensible to me) and I saw that they had a auction system. Since it's in this source, conquer should have it too yet TQ never bothered to implement it =/
01/15/2012 00:03 Lateralus#21
Quote:
Originally Posted by Kiyono View Post
So how hard is it to at least implement a basic working system? (click npc, show dialog and dialog options)
Not bad at all, as easy as doing your own implementation. Just start getting intimately familiar with the EO source.
01/15/2012 00:06 Korvacs#22
Heres how i did the basic system:


01/15/2012 00:14 Kiyono#23
Quote:
Originally Posted by Lateralus View Post
Not bad at all, as easy as doing your own implementation. Just start getting intimately familiar with the EO source.
I'm currently tracing through the EO source but not understanding C++ is a bit of a problem. I'm currently here:
Code:
case EVENT_BEACTIVED:
		{
			CNpc* pNpc;
			IRole* pRole = RoleManager()->QuerySet()->GetObj(m_pInfo->id);
			if (pRole && pRole->QueryObj(OBJ_NPC, IPP_OF(pNpc)) && pUser->GetMapID() == pNpc->GetMapID())
			{
				pNpc->ActivateNpc(pUser->QueryRole(), 0);
			}
		}
		break;
Which apparently is where the NPC task thing starts, not sure though since this case is a part of some switch that I've never seen before.
These enums don't tell me a lot either:
Code:
enum {
		EVENT_BEACTIVED = 0,				// to server		// ´¥·¢
		EVENT_ADDNPC,						// no use
		EVENT_LEAVEMAP,						// to client		// ɾ³ý
		EVENT_DELNPC,						// to server
		EVENT_CHANGEPOS,					// to client/server
		EVENT_LAYNPC,						// to client(id=region,data=lookface), answer MsgNpcInfo(CMsgPlayer for statuary)
};
Quote:
Originally Posted by Korvacs View Post
Heres how i did the basic system:

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
Will watch when my internet stops being annoying and the video loads.
01/15/2012 00:15 lostsolder05#24
Quote:
Originally Posted by Kiyono View Post
Well I at least have the information now. Time to figure out how to actually apply this but judging from the huge list of possible action types and my rather poor coding skills; I won't get very far. Is there any source out there with a working TQ style npc system? I would like to have a reference.
[Only registered and activated users can see links. Click Here To Register...]

Have fun, It's not a great implementation but last time I checked the majority of stuff worked.

There's also a few other sources off the top of my head I can think of that implement a TQ based NPC system (PMCO, ImmuneOne has one that does I believe(very basic), there's also a CoEmu one with a really poor implementation).
01/15/2012 00:15 Lateralus#25
Quote:
Originally Posted by Kiyono View Post
I'm currently tracing through the EO source but not understanding C++ is a bit of a problem. I'm currently here:
Code:
case EVENT_BEACTIVED:
		{
			CNpc* pNpc;
			IRole* pRole = RoleManager()->QuerySet()->GetObj(m_pInfo->id);
			if (pRole && pRole->QueryObj(OBJ_NPC, IPP_OF(pNpc)) && pUser->GetMapID() == pNpc->GetMapID())
			{
				pNpc->ActivateNpc(pUser->QueryRole(), 0);
			}
		}
		break;
Which apparently is where the NPC task thing starts, not sure though since this case is a part of some switch that I've never seen before.
These enums don't tell me a lot either:
Code:
enum {
		EVENT_BEACTIVED = 0,				// to server		// ´¥·¢
		EVENT_ADDNPC,						// no use
		EVENT_LEAVEMAP,						// to client		// ɾ³ý
		EVENT_DELNPC,						// to server
		EVENT_CHANGEPOS,					// to client/server
		EVENT_LAYNPC,						// to client(id=region,data=lookface), answer MsgNpcInfo(CMsgPlayer for statuary)
};
Those are subtypes of packet 2031, so this is packet processing for subtype 0.
01/15/2012 00:18 Korvacs#26
Quote:
Originally Posted by lostsolder05 View Post
[Only registered and activated users can see links. Click Here To Register...]

Have fun, It's not a great implementation but last time I checked the majority of stuff worked.
Aha! That's the one, so i guess it is public, anyways yeah the implementation in this isn't correct, and is extremely limited.
01/15/2012 00:34 Kiyono#27
Quote:
Originally Posted by lostsolder05 View Post
[Only registered and activated users can see links. Click Here To Register...]

Have fun, It's not a great implementation but last time I checked the majority of stuff worked.

There's also a few other sources off the top of my head I can think of that implement a TQ based NPC system (PMCO, ImmuneOne has one that does I believe(very basic), there's also a CoEmu one with a really poor implementation).
I noticed that Exodus had it right before you posted, also found master15's CoEmuv2 guide on this and I apparently already had the RedemptionCO source but it never even occurred to me that it might have TQ's npc system, lol Not sure what PMCO is? Link?
Quote:
Originally Posted by Lateralus View Post
Those are subtypes of packet 2031, so this is packet processing for subtype 0.
It could be me but 2031 doesn't have subtypes?
[Only registered and activated users can see links. Click Here To Register...]
But since you say so, it's either the unknown or the npc_mode.

//edit For some reason, RedemptionCO's system and Exodus use exactly the same structs (ActionStruct/TaskStruct even the spaces are in the same place) so that either means that Exodus' system is based on this or vice versa but since RedemptionCO's implementation was flawed (what was wrong with it again?) Exodus' version should be flawed too.
01/15/2012 00:40 lostsolder05#28
Quote:
Originally Posted by Kiyono View Post
I noticed that Exodus had it right before you posted, also found master15's CoEmuv2 guide on this and I apparently already had the RedemptionCO source but it never even occurred to me that it might have TQ's npc system, lol Not sure what PMCO is? Link?

it could be me but 2031 doesn't have subtypes?
[Only registered and activated users can see links. Click Here To Register...]
But since you say so, it's either the unknown or the npc_mode.
[Only registered and activated users can see links. Click Here To Register...]
01/15/2012 00:45 Kiyono#29
Quote:
Originally Posted by lostsolder05 View Post
[Only registered and activated users can see links. Click Here To Register...]
Oh, well that doesn't use TQ's system as that's the source that I'm trying to implement it in, lol
First time I've seen it be called PMCO btw
01/15/2012 00:46 lostsolder05#30
Quote:
Originally Posted by Kiyono View Post
Oh, well that doesn't use TQ's system as that's the source that I'm trying to implement it in, lol
First time I've seen it be called PMCO btw
ConquerServer_v2 Project (Project Manifest Source)

Lol my bad I just thought I remembered seeing it have them... Guess not then.