PDA

View Full Version : Module Node Paths



RTFallen
July 20th, 2014, 07:35
EDIT: Still would like to know, but found a way around my problem.

Is there any way to use relative node paths in a module like you can in extensions and rulesets?

Resire

Moon Wizard
July 20th, 2014, 17:22
Perhaps, but I'd need to review what you are trying to do against code. Currently, relative node paths are allowed in some API calls, but not sure about link data.

Links in modules (windowreference and formattedtext) always assume that the links point within the same module, unless specifically pointing to a different module.

Regards,
JPG

RTFallen
July 21st, 2014, 01:23
I was looking at this: https://www.fantasygrounds.com/modguide/database.xcp.
A the bottom of the page it shows different relative paths used in extension/ruleset modification. Was just curious if it was possible in modules as well.

I had an idea for a code structure, but the links were way too long to be feasible.

Resire

Moon Wizard
July 21st, 2014, 01:51
I think it should work, since several modules use ".." to self-reference from a windowreference data value within the same record. The upward traversal (i.e. "..", "...", etc.) only works at the beginning of the path.

I haven't tried this, so not sure if it works.

Regards,
JPG

RTFallen
July 21st, 2014, 02:14
Thanks JPG. I'll do some more experimenting with this and see what I come up with.

Resire

RTFallen
July 21st, 2014, 03:47
Ok, so after playing around with it for a little bit I keep on getting this error:

Unable to create window with data source (referencefeat : ...racialTraits.abilityModifiers@PFRPG Advanced Race Guide)
Unable to create window with data source (referencefeat : ..racialTraits.abilityModifiers@PFRPG Advanced Race Guide)
Unable to create window with data source (referencefeat : ..abilityModifiers@PFRPG Advanced Race Guide)

And using one dot just brings up an empty feat box.

For the last two I moved the data into the same tag as the link.

Resire

Dakadin
July 21st, 2014, 05:07
Can you get the node for the current window and use that to build the string for the node you want to use? Something like:


newNodeName = getDatabaseNode().getNodeName() .. ".abilityModifiers@PFRPG Advanced Race Guide"

Then use newNodeName.

RTFallen
July 21st, 2014, 05:49
Can you get the node for the current window and use that to build the string for the node you want to use? Something like:


newNodeName = getDatabaseNode().getNodeName() .. ".abilityModifiers@PFRPG Advanced Race Guide"

Then use newNodeName.

As far as I know lua can't be used in modules. I might be able to add something to that effect in my reference manual widoclass extension, but that would be a long term project for me. I've found a structure that I can work with, so this is more curiosity than anything now.

Resire

Moon Wizard
July 21st, 2014, 06:48
Did you try it without the module name (i.e. @PFRPG Advanced Race Guide)?

JPG

RTFallen
July 21st, 2014, 07:29
Did you try it without the module name (i.e. @PFRPG Advanced Race Guide)?

JPG

That's was added to the chat message. The XML doesn't include the module name.

Resire

Dakadin
July 21st, 2014, 16:01
As far as I know lua can't be used in modules. I might be able to add something to that effect in my reference manual widoclass extension, but that would be a long term project for me. I've found a structure that I can work with, so this is more curiosity than anything now.

Resire

Sorry about that.I misunderstood what you were trying to do.

RTFallen
July 22nd, 2014, 07:56
Sorry about that.I misunderstood what you were trying to do.

No problem. Thanks for trying to help. :)

Resire

Moon Wizard
July 22nd, 2014, 19:36
Can you send example to [email protected] reference to this thread?

Thanks,
JPG

RTFallen
July 22nd, 2014, 23:54
Can you send example to [email protected] reference to this thread?

Thanks,
JPG

Sent what I ended up with, and a sample of what I was trying to do.

Resire

Moon Wizard
July 24th, 2014, 06:51
Just verified that relative node paths are not supported in formattedtext fields, but are supported by windowreference fields.

Regards,
JPG

RTFallen
July 24th, 2014, 07:28
Just verified that relative node paths are not supported in formattedtext fields, but are supported by windowreference fields.

Regards,
JPG

Thanks JPG.

Resire