Thread: ModulePlus Extension
-
February 27th, 2014, 20:30 #1
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
ModulePlus Extension
I began this work as a result of this thread over in the House of Healing area, and I thank Nickodemus and Trenloe for their assistance. I'm just getting started on this extension, but here's what I currently want to do with it:
This extension addresses several issues with 3.5E and PFRPG module data. If a player uses manage characters to work on characters before and between games, this extension will take advantage of any modules the player may have. Specifically:
1) When you drag module data onto the relevant fields of a character sheet or mini-sheet, the extension causes both the link to the source and the data itself to be copied into the database. This permits use of the information even when the module(s) is/are not loaded and also permits access to the original source material if the module is loaded.
2) When a character sheet is opened or when a module is loaded or unloaded, the extension will see if necessary modules are loaded.
a) If a module is loaded, any reference in a character sheet to that module will have a tooltip that suggests holding down the control key to access the data within the module itself rather than the copied data.
b) If a module is not loaded, the tooltip will show the module that should be loaded if the user wants to get to the data source.
3) For module data display, this extension adds a control to return to the parent window. Although this is probably not that useful if you navigate to the content through the library and its nested windows, it is vital if you get to the information from a character sheet, since the parent windows most likely wouldn't be open.
4) For library module data that use the generic reference windows, there is now a description text block above all the referencelist data. Existing modules will, of course, not provide anything in this field, but they could be modified to provide the data.
5) The character information that supports the features above are:
race
class(es)
skills
items
weapons
spells
feats
special abilities
armor proficiencies
weapon proficiencies
EDIT: (Fixed file name to hopefully work automatically)
Okay, here is version 0.1. I have not tested it in 3.5E, but since the code I'm extending is in that ruleset, it should work there as well as PFRPG, which is where I did my testing. All this currently does is take care of Nickademus' most pressing problem. That is, if you drag data from a module to the Abilities tab of your character sheet, this extension stores not only the link to that data but also the data itself. This is advantageous because the GM will not need to have the module loaded at game time in order to access the information.
I have tested it with feats and with special abilities, but since I don't know the format of the data in the weapon and armor proficiencies (and where you might drag that from), I have not tested it for those areas of the character sheet. In theory, it should work.
I'd sure appreciate it if someone can tell me what the format of that data is and what module you'd drag it from so I can test it more fully.
Attachment 6192Last edited by Bidmaron; March 3rd, 2014 at 18:52. Reason: Release
-
February 27th, 2014, 20:39 #2
This will be a very useful extension.
Do you plan on storing the data in the <charsheet> database record so that it will work fine if the GM does not have the extension loaded? Or will it require the extension to be loaded all the time to access the data?Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
February 27th, 2014, 21:41 #3
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
I plan to do it so that it works without the extension, but of course none of the functionality will be there without it. I intend to implement so that it functions just like you manually typed it.
-
March 1st, 2014, 14:43 #4
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
There doesn't appear to be any documentation on the shortcut database node, and searching the forum comes up with 17 pages of stuff related to everything except database nodes.
It obviously has a type attribute (is anything but windowreference okay?).
It has a class subnode, which is obvious what it does and is.
It also has a recordname child. Apparently, if that is blank, it extracts the record information from the sibling nodes of the shortcut node, right?
-
March 1st, 2014, 14:59 #5
Here's what I tend to use:
Code:<shortcut type="windowreference"> <class>name of windowclass</class> <recordname>fully qualified database node path</recordname> </shortcut>
FG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
March 1st, 2014, 15:15 #6
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Yeah, that's what I've seen. I was just hoping there was some official documentation somewhere I was missing, as this node type seems to be intrinsic to FG and not manipulated by rulesets or extensions (well, what I mean is that you obviously create these in your ruleset or extension, but your window class code doesn't have to do anything with it, as FG populates the window class with the nodes from the record name (or, apparently, if the record name is blank, the nodes in the siblings to shortcut).
-
March 1st, 2014, 15:40 #7
Here's the documentation from the Library for windowreferencecontrol, you can see you can define a relative path (window) for the recordname
<class > The name of the window class used for an opened window instance <recordname > ... </recordname> A relative (to the window data source) database identifier pointing to the data source to assign to the opened window </class> FG Project Development
Next Project(s)*: Starfinder v1.2 Starship Combat
Current Project: Starfinder v1.1 - Character Starships
Completed Projects: Starfinder Ruleset v1.0, Starfinder Core Rulebook, Alien Archive, Paizo Pathfinder Official Theme, D&D 5E data updates
* All fluid by nature and therefore subject to change.
-
March 1st, 2014, 19:34 #8
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
Thanks, Zeus. I guess I should have known to check that class.
-
March 1st, 2014, 20:38 #9
Archangel
- Join Date
- Apr 2008
- Location
- Virginia Beach
- Posts
- 3,096
First Code Question
Okay, I'm sure I'm going to feel stupid when I see the answer, but I am seeing the following error when I start up FG with my extension loaded:
Console window:
Runtime Notice: Reloading ruleset
Script Error: [string "charsheet_abilities:feats"]:1: 'end' expected near '<eof>'
Script Error: [string "charsheet_abilities:specialabilities"]:1: 'end' expected near '<eof>'
Script Error: [string "charsheet_abilities:armorprofs"]:1: 'end' expected near '<eof>'
Script Error: [string "charsheet_abilities:weaponprofs"]:1: 'end' expected near '<eof>'
Code:<?xml version="1.0" encoding="iso-8859-1"?> <root version="3.0"> <properties> <name>ModulePlus</name> <version>0.1</version> <author>Charles Sykora (Bidmaron) with help from Trenloe and Nickademus</author> <description>A plugin to improve use of modules</description> <ruleset> <name>3.5E</name> </ruleset> <ruleset> <name>PFRPG</name> </ruleset> </properties> <base> <template name="list_charabilities"> <list_text> <anchored> <top offset="35" /> <left offset="15" /> <right offset="-15" /> <bottom offset="-15" /> </anchored> <sortby><control>value</control></sortby> <newfocus>value</newfocus> <script> function onDrop(x, y, draginfo) if isReadOnly() then return false; end local winLevel = getWindowAt(x, y); if not winLevel then return false; end <!-- -- Draggable spell name to move spells if draginfo.isType("shortcut") then local sDropClass, sSource = draginfo.getShortcutData(); -- Module ability information if sDropClass == "referencefeat" then local nodeSource = DB.findNode(sSource); local nodeAbilityList = nil; -- Create the new ability entry local nodeNewAbility = nodeAbilityList.createChild(); if not nodeNewAbility then return nil; end -- Build the list details win.value.setValue(DB.getValue(nodeSource, "name", "")); win.shortcut.setValue(draginfo.getShortcutData()); DB.setValue(nodeNewAbility,"storelink","string",win.shortcut.recordname.getValue()); win.shortcut.recordname.setValue(""); return true; end end --> end </script> </list_text> </template> <script name="ModPlusExtStart" file="extension_start.lua"/> </base> </root>
-
March 1st, 2014, 20:44 #10
Remove the whole section that you have commented.
Comments work differently in scripts in XML.
See the "Using Scripts" section here: https://www.fantasygrounds.com/modguide/scripting.xcpPrivate Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks