-
Contributor
Originally Posted by
mrsmitee
ty,but how to make the icon a bit larger to see?
use "SkillRatio" via customization
greetz gjuz
-
Member
Hi gjuz! Tell me how to fix a bug in version 9.1
NecSkeletalMagePlugin.cs(60,23) : error CS1061: 'IPlayer' does not contain a definition for 'ActorId' and no accessible extension method 'ActorId' accepting a first argument of type 'IPlayer' could be found (are you missing a using directive or an assembly reference?)
thx in advance
-
Contributor
Originally Posted by
Romanmas
Hi gjuz! Tell me how to fix a bug in version 9.1
NecSkeletalMagePlugin.cs(60,23) : error CS1061: 'IPlayer' does not contain a definition for 'ActorId' and no accessible extension method 'ActorId' accepting a first argument of type 'IPlayer' could be found (are you missing a using directive or an assembly reference?)
thx in advance
I guess just could just comment out line 60 and test if it works.
Code:
if (p.ActorId == 0) continue;
It might be that testing ActorId is kind of sanity checks after test on line before (that checks if player in the loop is me - the current player).
-
Member
Originally Posted by
JarJarD3
I guess just could just comment out line 60 and test if it works.
Code:
if (p.ActorId == 0) continue;
It might be that testing ActorId is kind of sanity checks after test on line before (that checks if player in the loop is me - the current player).
so what's the solution ? how to fix the error
-
Contributor
Originally Posted by
Romanmas
so what's the solution ? how to fix the error
Change line 60 from:
Code:
if (p.ActorId == 0) continue;
to this:
Code:
// if (p.ActorId == 0) continue;
and save.
(No guarantees as I don't have the source code to try it.)
-
Legendary
Originally Posted by
Romanmas
so what's the solution ? how to fix the error
As a precaution (I haven't really looked at the rest of the code) I would not eliminate that line , better follow the advice that bm206 gave you for another plugin ( https://www.ownedcore.com/forums/dia...ml#post3880121 ([v7.5] [INTERNATIONAL] [gjuz] CoEPowerfullPlugin) ), change line 60 :
Code:
if (p.ActorId == 0) continue;
for this :
Code:
if (!p.HasValidActor) continue;
The problem comes because ActorId has been considered "deprecated" for some time, we should abandon its use, and in this version of TH it must have been permanently eliminated.
Checking that player is a valid actor allows you, for example, to use IActor properties, in practice it also means that it is detected, that it is close, and you can for example look at its buffs with some reliability.
Last edited by RNN; 08-10-2019 at 04:17 AM.
-
Post Thanks / Like - 1 Thanks
JarJarD3 (1 members gave Thanks to RNN for this useful post)
-
Contributor
Originally Posted by
RNN
As a precaution (I haven't really looked at the rest of the code) I would not eliminate that line , better follow the advice that bm206 gave you for another plugin (
https://www.ownedcore.com/forums/dia...ml#post3880121 ([v7.5] [INTERNATIONAL] [gjuz] CoEPowerfullPlugin) ), change line 60 :
Code:
if (p.ActorId == 0) continue;
for this :
Code:
if (!p.HasValidActor) continue;
The problem comes because ActorId has been considered "deprecated" for some time, we should abandon its use, and in this version of TH it must have been permanently eliminated.
Checking that player is a valid actor allows you, for example, to use IActor properties, in practice it also means that it is detected, that it is close, and you can for example look at its buffs with some reliability.
That was a really helpful lesson!
I have seen HasValidActor used only in a few plugins, like DavPlayer\DAV_COE and Default\BuffLists\ConventionOfElementsBuffListPlugin when I search for it. But I have quite a few plugins myself.
IMHO using IPlayer.HasValidActor is a bit tricky as IPlayer is inherited from IActor and you have to know when you refer IActor properties and check is that they are available.
I'll try to remember to check this.
It might be that you should use it (only?) when you iterate over Hud.Game.Players, as other network players might not have everything available like "local" player has.
-
Legendary
Checking that the player is a valid actor before consulting certain data of that player avoids some exceptions, (because they are not available), the other alternative is to see if these data return a null value before using them.
-
Contributor
You can use my plugin, It have more function
https://www.ownedcore.com/forums/dia...on-plugin.html ([ENG] Active Commend Skeleton Plugin)
Originally Posted by
Romanmas
so what's the solution ? how to fix the error
-
Member
I got this error:
2019.09.01 18:17:42.388 19.8.29.1 error while initializing plugins
2019.09.01 18:17:42.388 19.8.29.1 D:\Games\ess64\Plugins\gjuz\NecSkeletalMagePlugin.cs(60,23) : error CS1061: 'IPlayer' does not contain a definition for 'ActorId' and no accessible extension method 'ActorId' accepting a first argument of type 'IPlayer' could be found (are you missing a using directive or an assembly reference?)
Last edited by Alexz.; 09-01-2019 at 10:46 AM.