-
July 30th, 2020, 19:49 #1
- Join Date
- Aug 2019
- Posts
- 11
Edit formatted text link tags in lua
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.abilitie s.pathoftheberserker@DD5E SRD Data">Path of the Berserker</link>
- From API node.getValue(): "<linklist>Path of the Berserker</linklist>"
Thanks for the guidance,
-
July 30th, 2020, 19:52 #2
try referencing node.recordname
or node.linklist
EDIT: didn't realize you wanted to edit, not sure how do do that.Last edited by bmos; July 30th, 2020 at 19:54.
bmos' extensions
he/them
-
July 30th, 2020, 22:19 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
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
-
August 2nd, 2020, 19:26 #4
- Join Date
- Aug 2019
- Posts
- 11
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/
-
August 2nd, 2020, 19:35 #5
- Join Date
- Aug 2019
- Posts
- 11
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
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks