PDA

View Full Version : Adding PCs and NPCs to New Tracker



bigbluepaw
January 28th, 2017, 23:54
Hey all. Hope all is good.

I am in the middle of building a new tracker from the components of the Combat Tracker. Pretty amazing how you can reuse stuff from an existing tool in FG. I'm pretty excited.

One issue I've encountered is that the drag and drop functionality to add NPCs and PCs to a tracker is not working in the new tracker. I am pretty confident that it is tied to this XML snippet.


<list_ctbox_host />

But I'm not sure what scripts this references. Any insight or help?

Thanks so much for the help so far. I actually think I can do what I want to do with this tool. I'm really excited.

Trenloe
January 29th, 2017, 00:37
A major hint for working out how everything hands together it to use a text editor that allows for "find in files". I use Notepad++ (https://notepad-plus-plus.org/) (free) which allows you to search through all of the FG files to see where things are used and defined.

list_ctbox_host is a template that is defined in ct\template_ct.xml and only applies to the GM (host). This is a windowlist (https://www.fantasygrounds.com/refdoc/windowlist.xcp) control which has a script attached to it: ct\scripts\ct.lua. Check through the onDrop (https://www.fantasygrounds.com/refdoc/windowcontrol.xcp#onDrop) function within that LUA file, this is what is executed when something is dropped on the control. Trace through the calls in that function to see what is a valid record for dropping within that control and what occurs to populate the combat tracker. There are a number of other script packages (FG Managers) that get called, so you'll need to trace through to get familiar with how this LUA hierarchy hangs together.

bigbluepaw
January 29th, 2017, 00:50
Thank you. Awesome. But how do you get Notepad ++ to search all of those files? I am currently using it and only seen a search function for files that are currently open.

Thanks again so much. I'll hunt it down.

Trenloe
January 29th, 2017, 00:52
Extract all of the files from the ruleset .pak file into a directory somewhere (not the FG \rulesets directory) then use "Find in Files" (Search -> find In files or CTRL+SHIFT+F) and set the Directory to be the location you extracted the ruleset files to. Make sure "In all sub-folders" is checked too.