PDA

View Full Version : Combat Tracker Update



augustgames
April 15th, 2024, 05:42
I am runnin into troubles getting my head around modifying the combat tracker. Some of the stuff I am finding online is outdated (I think). What is best current resource with a how to and examples so I can learn it?

Thanks

Moon Wizard
April 15th, 2024, 05:52
There is no specific example code for modifying the combat tracker, other than the implementations built into the rulesets themselves being examples.
CoreRPG is the base layer which almost every ruleset is built upon; and then each ruleset overrides the portions that make sense for their system.

I would start with having both CoreRPG and 5E unpacked and available as files to search over on disk; and play around with adding an extension to make small changes first until you are familiar with each piece you want to modify.

Regards,
JPG

augustgames
April 15th, 2024, 14:58
Thanks. That was my plan B. Here goes nothing. :)

Mike Serfass
April 18th, 2024, 20:15
Here's an example of someone extending the combat tracker. It may help get you started.
Effect Modification Extension (https://www.fantasygrounds.com/forums/showthread.php?81102-Effect-Modification-Extension)

augustgames
April 19th, 2024, 22:08
Thank you. I was able to reverse engineer what I wanted by looking at the other rulesets. Man, a bit of a pain but SUCCESS!

augustgames
April 20th, 2024, 17:08
Ok, perhaps I spoke too soon......

So the characters drag and drop into the combat tracker works perfectly! I am having an issue with the NPC. I used the same field names in the NPC and Charactersheet forms. Everything posts for NPC as expected except for Initiative and five movement number fields. The other number fields post fined (Ap, ep, etc). Here is the image: 60608


Per rour reccomendations I have included the ruleset .pak files in the link below. The HaRPG is my modified CoreRPG file where I made the changes to the combat tracker. The HereAfter Fantasy pak file contains the windows (I plan on making multiple HereAfter x files to work with the update HaRpg. I build the HereAfter file using Ruleset Wizard. I included the rwp file as well. I also included a zip file with just the CT files.


Dropbox Link: https://www.dropbox.com/scl/fo/729rnbqdmvzdl3nujdrgn/AH57DAdVEvZUaTdhNh49OKI?rlkey=kqxzsyilr3rre1dnoxxh bpj28&st=l74pfzod&dl=0


Any suggestions would be apprecated. I spend four hours combing through the ct files and I am stumped. Thanks in advance.

augustgames
April 20th, 2024, 19:22
I figured it out. I think some time away from it cleaning the kitchen helped. I figured there is value is showing my solution for the group.

I looked back at ct_entry.lua again since that is where all the heavy lifting happens. I found this onLinkChanged function and noticed it had a self.isPC if statement. My logic was that since this was not a PC and an NPC is was not triggering the link. I commented out the if and it worked. It still does not explain why SOME fields were working but I am not going to look a gift horse in the mouth.



function onLinkChanged()
-- If a PC, then set up the links to the char sheet
--

--if self.isPC() then
self.linkPCFields();
name.setLine(false);
--end

--
self.onIDChanged();
end

Within the LInkPCfields() function I used the if to not update the HP value of an NPC.

----hp_value
if self.isPC() then
hp_value.setLink(DB.createChild(nodeChar, "hp_value", "number"))
end