PDA

View Full Version : Help understanding tokeninstance vs. tokeninstance.ref



AmadanNaBriona
May 6th, 2020, 18:32
local actorToken = CombatManager.getTokenFromCT(actorNode);


Returns tokeninstance = { { container = image.id-00001.image, id = 28, scale = 2.58375, x,y = 125,209 } }

Okay, cool.


local ctrlImg = ImageManager.getImageControl(actorToken, false);

Returns nil, because the getImageControl() method in CoreRPG's ImageManager has this line:


local nodeImage = tokeninstance.ref.getContainerNode();

My tokeninstance does not have a ref. I think some tokens are references to their CT entry, and some to the actual token on the map? But I am not clear on how to get the one I want. I am starting with the CT combatant nodes (sources and targets), so how do I go from there to get the correct token instance?

Moon Wizard
May 8th, 2020, 03:37
I just looked at the ImageManager script for CoreRPG; and I do not see any line like this ("local nodeImage = tokeninstance.ref.getContainerNode();")

In fact, at line 207, I see exactly what I would expect ("local nodeImage = tokeninstance.getContainerNode();")

Try removing your old copy of CoreRPG files; and unpack the most recent version directly from the .pak file in the FG data directory.

Regards,
JPG