Get Level of selected char in TargetInfoNewUI
#15


7 hours ago, Andrein95 said:





pObject2


is NULL,



Still doesn't work:




ObjectBase* pObject1 = ACTORMGR()->GetObject(eOBJ_CHARACTER, pInfo->GetTargetServerIdx(eTARGET));
ObjectBase* pObject2 = ACTORMGR()->GetObject(eOBJ_CHARACTER, pInfo->GetTargetLevel(eTARGET));

CCharacterTarget *pTarget1, *pTarget2;
if (pObject1 != NULL)
pTarget1 = static_cast<CCharacterTarget*>(pObject1);
if (pObject2 != NULL)
pTarget2 = static_cast<CCharacterTarget*>(pObject2);


2



2



Since CCharacterTarget is a casted object of ObjectBase, where is filled ObjectBase, in other terms:



1 - Wich methods is called in CmdMsg? I think AppearMsg



2 - Wich class are we talking about in server side for this Object Base class?




ObjectBase* pObject2 = ACTORMGR()->GetObject(eOBJ_CHARACTER, pInfo->GetTargetLevel(eTARGET));

Oh, I didn't look at that line of yours.





the GetTargetLevel() function does not need to be called, you will receive information about the level in a different way, through the class pointer CCharacterTarget* :

ObjectBase* pObject2 = ACTORMGR()->GetObject(eOBJ_CHARACTER, pInfo->GetTargetServerIdx(eTARGET));
CCharacterTarget* ptrTarget = static_cast< CCharacterTarget* >(pObject2);




As you can see, in your screenshots, there is no level variable in the CCharacterTarget class, which I specified as your_var_for_level .



And of course you need to create it and fill it with the SetData() method. I wrote about this above.



On the server side you also need to create a variable in ptype_appear.h - struct appearPc{ } And fill it in void AppearMsg() .





 



Messages In This Thread
[No subject] - by Andrein95 - 04-25-2022, 04:28 PM
[No subject] - by Desarija - 04-25-2022, 09:50 PM
[No subject] - by Andrein95 - 04-25-2022, 10:17 PM
[No subject] - by Desarija - 04-26-2022, 12:05 PM
[No subject] - by Andrein95 - 04-27-2022, 07:30 PM
[No subject] - by Desarija - 04-27-2022, 08:57 PM
[No subject] - by Andrein95 - 04-28-2022, 08:10 AM
[No subject] - by Desarija - 04-28-2022, 08:43 AM
[No subject] - by Andrein95 - 04-28-2022, 03:32 PM
[No subject] - by Andrein95 - 04-28-2022, 08:31 PM
[No subject] - by Dimaflash - 04-28-2022, 09:05 PM
[No subject] - by Andrein95 - 04-29-2022, 07:52 PM
[No subject] - by Dimaflash - 04-29-2022, 08:05 PM
[No subject] - by Andrein95 - 04-30-2022, 01:01 PM
[No subject] - by Dimaflash - 04-30-2022, 09:33 PM
[No subject] - by Andrein95 - 05-01-2022, 03:47 PM
[No subject] - by Andrein95 - 05-03-2022, 06:04 AM
[No subject] - by Dimaflash - 05-03-2022, 06:52 AM
[No subject] - by Andrein95 - 05-04-2022, 09:34 PM
[No subject] - by Andrein95 - 05-06-2022, 10:18 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)