PDA

View Full Version : Trouble with nodeCreature



Blackfoot
December 6th, 2013, 17:19
I'm still puttering with my Champions ruleset and I've run into yet another problem.
ActorManager2 (manager_actor2.lua) is looking for nodeCreature in rActor and can't find it... I'm not sure why I haven't run into this problem before now, perhaps I'm down deeper into the guts of things. It 'seems' like nodeCreature should be the character sheet... but I can't find where that is getting set. I see it getting set in relationship to spell_classes... but I'm not really using that code for anything... this is a more major thing than that.

I guess I'm finding some confusion between rActor and nodeCreature.

Moon Wizard
December 6th, 2013, 17:42
Just changed up the Actor record/functions. I was running into problems where nodes did not exist on client, since the client did not own them. (ie targeting other players)

If you look in CoreRPG : manager_actor.lua ; you can find the helper functions to get data from the actor variable. I think it's ActorManager.getCreatureNode(rActor) ; but I'm away from machine right now to look up exactly.

Regards,
JPG

Trenloe
December 6th, 2013, 17:51
Look at the getActor(sActorType, varActor) function in manager_actor.lua in the CoreRPG ruleset.

This is where rActor is usually created - you can see how the different information within the structure of rActor are created based off the arguments sActorType and varActor passed to this function. If you are finding that rActor.nodeCreature is not there, then you will need to step back through the code to see where rActor was created, usually with ActorManager.getActor(sNodeType, node), and see why nodeCreature might be missing. nodeCreature is the databasenode object (not a character sheet) pointed to by the varActor argument.

Moon Wizard
December 6th, 2013, 18:07
It's not there, because I changed the structure of the actor variable to deal with another issue. Use the helper functions instead.

Cheers,
JPG

Trenloe
December 6th, 2013, 18:23
I was looking at slightly older code.

I see that in manager_actor2.lua in the 3.5e ruleset, the getAbilityScore function uses "local sActorType, nodeActor = ActorManager.getTypeAndNode(rActor);" to get nodeActor, whereas previously it would have used rActor.nodeCreature.

Blackfoot - looks like you may have to go through the code you have based your custom ruleset on and see what has changed in the recent release of 3.5e.

Blackfoot
December 6th, 2013, 23:19
So... if I go through and do a global search and replace of
rActor.nodeCreature
with
ActorManager.getCreatureNode(rActor)
that should resolve the issue? I tried some tests and it seems like that might do it.

Moon Wizard
December 7th, 2013, 00:09
Yeah, you also should replace any references to rActor.nodeCT, rActor.sCreatureNode and rActor.sCTNode (if any). Also, you might try rSource and rTarget permutations as well, since those names are used for actor variables in several of my roll scripts.

Cheers,
JPG

Moon Wizard
December 7th, 2013, 01:49
On a related note, I made a change today that might affect you:
not TokenManager.isClientVisible(node) -> CombatManager.isCTHidden(node)

Cheers,
JPG