PDA

View Full Version : getActor(sActorType, varActor) - deprecation notice - what is it telling me?



Varsuuk
January 31st, 2021, 23:48
I came across this while tracing code into CoreRPG - what is this telling me?
1. The method is deprecated? (normally what I assume a "DEPRECATED" in front means.
2. The sName member should no longer be accessed?
3. ?

-- DEPRECATED v3.3.6 - .sName actor member no longer used
function getActor(sActorType, varActor)

Moon Wizard
February 1st, 2021, 00:20
Yes, the .sName variable should no longer be used. There is an ActorManager.getDisplayName(rActor) function to be used to get the actor's display name. I will be removing at some point in the near future; and people left using it in their systems will run into errors.

Also, getActor is being deprecated next month, and ActorManager.resolveActor(node) will be used instead. See this thread:
https://www.fantasygrounds.com/forums/showthread.php?65561-2020-02-Ruleset-Updates

Regards,
JPG

SilentRuin
February 1st, 2021, 01:03
Yes, the .sName variable should no longer be used. There is an ActorManager.getDisplayName(rActor) function to be used to get the actor's display name. I will be removing at some point in the near future; and people left using it in their systems will run into errors.

Also, getActor is being deprecated next month, and ActorManager.resolveActor(node) will be used instead. See this thread:
https://www.fantasygrounds.com/forums/showthread.php?65561-2020-02-Ruleset-Updates

Regards,
JPG

Ok I did a quick search on .sName and got multiple hits in CoreRPG and 5E and several of my extensions that get dice rolls back for rSource. So... I think I need some clarification on this particular statement about the .sName variable no longer being used. Especially as I don't know where what I'm receiving is coming from and have done what CoreRPG and 5E do currently. Scary statement that was.

Varsuuk
February 1st, 2021, 01:33
Yes, the .sName variable should no longer be used. There is an ActorManager.getDisplayName(rActor) function to be used to get the actor's display name. I will be removing at some point in the near future; and people left using it in their systems will run into errors.

Also, getActor is being deprecated next month, and ActorManager.resolveActor(node) will be used instead. See this thread:
https://www.fantasygrounds.com/forums/showthread.php?65561-2020-02-Ruleset-Updates

Regards,
JPG


Thanks for the heads up - I found getActor in 10 places in my code. All of them extracted from MoreCore code that I borrowed. I'll take care of it on my end and when I update after your changes, I should be good.

Moon Wizard
February 1st, 2021, 02:50
@SilentRuin,

.sName is used in several places in CoreRPG as a generic variable within a table. I'm talking about specific usage for actor records, which have been previously removed from CoreRPG, 5E and others that I maintain. The only current reference is the one that creates it to prevent other rulesets from breaking. However, since it requires a fair bit of lookup code to look up the name, it doesn't make sense to look up the name unless you actually need it for your use of the actor record.

Regards,
JPG

Varsuuk
February 1st, 2021, 02:57
Yup that makes total sense - decouples the two actions and increases granularity.

If you need sName, he listed a method to get it - just need to make a separate call.

damned
February 1st, 2021, 04:16
I have I think 68 instances in MoreCore
Some testing to be done!

SilentRuin
February 1st, 2021, 04:55
@SilentRuin,

.sName is used in several places in CoreRPG as a generic variable within a table. I'm talking about specific usage for actor records, which have been previously removed from CoreRPG, 5E and others that I maintain. The only current reference is the one that creates it to prevent other rulesets from breaking. However, since it requires a fair bit of lookup code to look up the name, it doesn't make sense to look up the name unless you actually need it for your use of the actor record.

Regards,
JPG

Whew! Thank goodness! Well when you are about to do it - make sure there is a BIG GIANT WARNING - so I know to retest the old extensions, just in case.