PDA

View Full Version : Combat Tracker



Jingo
March 9th, 2008, 06:10
Hi all,

I probably spent about 1/2 hour populating the Combat Tracker and rolling up the baddies' initiatives. I saved my campaign and reloaded it, and now all my entries are removed from the tracker... So I tried it again (save and reopen campaign) and it kept some in there, but about half were mysteriously removed.

Umm... what's going on? Any ideas on how to get them to "stick"?

Oberoten
March 9th, 2008, 09:01
Hmmm... I think it saves on close and open? Not entirely sure though. Would be preferable if it saved to the database though.

Griogre
March 9th, 2008, 10:31
I'm pretty sure you need to open the tracker and close the tracker before the tracker saves. I think opening and closing it with the button in the top right will save the tracker's data. There's a bug in there where the data is not saved on the tracker unless you close it (maybe) in a certain way.

Dachannien
March 9th, 2008, 13:32
Exactly. This bug was reported here (https://www.fantasygrounds.com/forums/showthread.php?t=7390).

Jingo
March 10th, 2008, 20:32
Thanks all. I'll give that a try.

Jingo
March 11th, 2008, 06:37
Oh man, this one is bugging me! I tried the suggestions but couldn't get it to work. I know Smitworks have done patches for things of lesser import; it seems this one should be critical enough to prompt a fix.

I tried the suggestions on that other post:

I tried populating it, then closing via combat using the side panel button and then saving. On restart combat tracker is wiped clean.

I tried populating it, then closing via radial button close and then saving. On restart combat tracker is wiped clean.

What am I missing?

Griogre
March 11th, 2008, 06:51
My tracker usually sticks and I always use the button on the right both to open and close it. I tend to open an close the tracker alot even during melee sometimes.

Jingo
March 11th, 2008, 07:15
Hi Griogre,

Well the CT works fine as long as I don't close FG. But no matter what I do (even using the script here (https://www.fantasygrounds.com/forums/showthread.php?t=7243) I can't get it to save the tracker and keep what I have when I restart FG.

I'm starting to wonder if there's a bug in my campaign (the Wizards Amulet one). I'm getting a script error in the console when I have a certain personality loaded in the combat tracker:

Script Error: Error parsing CampaignRegistry
Script Error: [string "return {..."]:13:unfinished string near "'Shortbow +3 ranged (1d6 20/x2);'

I'm not sure what this means...I wonder if this is causing the problem. I'm thinking it probably can't read the stored data properly and so loads an empty CT.

Griogre
March 11th, 2008, 07:55
It looks like that personality is screwed up. There is probably a bad character or something similar somewhere around the attack entries of the personality. Which personality is it?

Jingo
March 11th, 2008, 15:21
It was happening on two personalities in that adventure (and maybe more):
Grenac and Slaaroc

I'm not sure what I changed on their personalities, but I managed to make it work now.

I would like to know exactly how the info should be in there, because I noticed even if you're using rh4300's CombatTracker Tools script and have saved more than one combat tracker with functioning personalities, this bug wipes out ALL saved trackers.

Griogre
March 11th, 2008, 22:01
Grenac and Slaaroc had carrage returns in their attacks which I removed. I also went through and cleaned up all the personalities' attacks to work with the FG2 dice parser. The module was made before that feature so some of the attacks didn't work right.

I e-mailed you the changes.

Spyke
May 13th, 2008, 11:08
Grenac and Slaaroc had carrage returns in their attacks which I removed. I also went through and cleaned up all the personalities' attacks to work with the FG2 dice parser. The module was made before that feature so some of the attacks didn't work right.

I e-mailed you the changes.I was about to report this as I'm getting the same error - even with the standard d20 ruleset. You're right that it's caused by carriage returns, but I want those carriage returns to be there: I want to show multiple attacks as separate lines in the equivalent to this field in my ruleset.

Has anyone got any idea how to adapt the combat tracker so that it doesn't cause this error on restart if a GM pressed Enter while editing the attacks?

Griogre
May 13th, 2008, 18:31
The problem is how the data is read from the registry it expects the string list to be in a specific order and number. FG does not expect carrage returns in the middle of the attack and full attack string. It probably expects them at the end or not at all so when it hits one it begins evaluating the string and finds it can't parse it - so it bombs. You might be able to put CRs only after damage rolls. I don't think it would read anything after the CR but it might not crash.

I have not looked at it, but it might be possible to write your own parsing routine in lua to pull out the CRs and pass the correct form on to FG.

The only easy solution is don't put CRs in the attack entries.

Spyke
May 13th, 2008, 21:57
I have not looked at it, but it might be possible to write your own parsing routine in lua to pull out the CRs and pass the correct form on to FG.Thanks, Griogre. Yes, that worked.

You can add two functions to combattracker_entry.lua as follows:


function stripcarriagereturns(mystring)
return string.gsub(mystring,'\r',"@@");
end

function restorecarriagereturns(mystring)
return string.gsub(mystring,"@@",'\r');
endThen you use them in the store(entry) and restore(entry) functions to strip and restore the carriage returns from the relevant fields. The only quirk is that when restoring I seem to have to use a local variable to store the string first; I can't seem to set the value of the node directly to the string returned by the function.