PDA

View Full Version : Edit formatted text link tags in lua



brainArid
July 30th, 2020, 19:49
Hello,

Is there a way to get/set the attributes of link tags in formattedtext from the exposed lua API? When looking at getValue() for formattedtext-type DB nodes, it looks like the complete link does not correlate 1:1 with the representation of formattedtext in the xml.

Looking at the 5E SRD Data module for an example:


In client.xml: <link type="windowreference" class="reference_classability" recordname="reference.classdata.barbarian.abilities.pathoftheb erserker@DD5E SRD Data">Path of the Berserker</link>
From API node.getValue(): "<linklist>Path of the Berserker</linklist>"


Thanks for the guidance,

bmos
July 30th, 2020, 19:52
try referencing node.recordname :)
or node.linklist

EDIT: didn't realize you wanted to edit, not sure how do do that.

Moon Wizard
July 30th, 2020, 22:19
You can only get or set the full value. Look at the story_template_generate.lua script in the CoreRPG ruleset for one example where a script is modifying formatted text.

Regards,
JPG

brainArid
August 2nd, 2020, 19:26
try referencing node.recordname :)
or node.linklist

EDIT: didn't realize you wanted to edit, not sure how do do that.

Where can I learn more about the definition for node. I'm not seeing a 'recordname' or linklist' mentioned in the reference documentation: https://www.fantasygrounds.com/refdoc/

brainArid
August 2nd, 2020, 19:35
You can only get or set the full value. Look at the story_template_generate.lua script in the CoreRPG ruleset for one example where a script is modifying formatted text.

Regards,
JPG

Ah yes this is a step in the right direction. Thank you. But is seems that the functional bits of information that I'd care to edit, like the target database address of the reference ("reference.classdata.barbarian.abilitie s.pathoftheberserker@DD5E SRD Data" in the example above) are not stored in text form within a formattedtext node type. It makes me think that this information is read in from xml upon load and then handled differently. Any idea where I can find more information on how these references are handled?

Thanks