PDA

View Full Version : Adding and Linking Attributes to the Combat Tracker



LordEntrails
February 23rd, 2026, 18:23
For a ruleset that is a child of CoreRPG I'm looking to add some fields to the Combat Tracker. I'm having a couple of challenges:

1) Unable to override the name/nonid_name fields in the ct_entry and keep the space/effects/etc spacing correct. I want to override the name/nonid_name because currently the underscore is too long, it goes under all my new fields. See image, notice how the field underline extends into the new fields on the right?
66677
Current code is:

<windowclass name="ct_entry" merge="join">
<sheetdata>
<number_ct_crosslink name="initresult">
<frame name="fielddark" />
<bounds>10265,5,30,30</bounds>
<tabtarget>
<prev>nonid_name</prev>
</tabtarget>
<hideonvalue>0</hideonvalue>
<script>function update()
window.windowlist.applySort();
end

</script>
</number_ct_crosslink>
<number_ct_crosslink name="bptotal">
<frame name="fielddark" />
<bounds>10295,5,35,30</bounds>
<tabtarget>
<prev>nonid_name</prev>
</tabtarget>
<script>function update()
window.windowlist.applySort();
end
</script>
</number_ct_crosslink>
<number_ct_crosslink name="wounds">
<frame name="fielddark" />
<bounds>10330,5,35,30</bounds>
<tabtarget>
<prev>nonid_name</prev>
</tabtarget>
<hideonvalue>0</hideonvalue>
<script>function update()
window.windowlist.applySort();
end
</script>
</number_ct_crosslink>
<button_stringcycler name="mapcurrent">
<frame name="buttonup" offset="0,0,0,0" />
<bounds>10365,5,35,28</bounds>
<color>#FFFFFFFF</color>
<parameters>
<defaultlabelres>ct_entry_mapcurrent_DefaultLabel</defaultlabelres>
<labelsres>ct_entry_mapcurrent_Label__20|ct_entry_mapcurrent_ Label__40|ct_entry_mapcurrent_Label__60|ct_entry_m apcurrent_Label__80</labelsres>
<values>-20|-40|-60|-80</values>
</parameters>
</button_stringcycler>
</sheetdata>
</windowclass>


If I add in the name/nonid string fields then the Space/Target/Effects windows end up loosing their anchors and end up on top of the main entry row.

66678
How can I control the length of the name and nonid_name fields and retain the stacking?

2) How to add the default Active (attacks) and Defenses icons to the CT entry. I've only just begun to look at this in DnD 5E, but advice would be appreciated. Is their someplace simple to turn this on in the templates or do I have to add more to the ct)entry field? And at that point should I still do the merge:join or just completely overwrite the windowclass?

3) How to Add a Round Reset. I want to be able to do a Reset Round to 1. Any examples of this? It's not tied to Rests like 5E, so I'm thinking a separate action int he round right mouse menu, but where to look for examples?

4) How to Add custom Items to the CT Menu Button. I want to add some GM "reset" actions (similar to rests) for my ruleset that will reset a Destiny points (FG CounterList) on the characters on the Combat Tracker. Similar to a Rest. Where to start? As Well I want to add/enable to the Roll Initiative action like 5E has. Where to start?

5) Linking CT Fields between the PC/NPC sheets and the CT. I've tried, and failed, to do this in the past. Would like for HP to be populated from the PC/NPC sheet to the CT when added to the CT. For wounds to be tracked between both (can players edit on their sheet and on the CT?). Also have another field (MAP=Multi Action Penalty) that has a list of values I would like linked between the PC and CT (NPCs only have on the CT). Where to start?

6) Reset field value on Character Turn Start. Low priority, but while I'm here... The MAP field on the CS and CT, I would like this to reset to zero when the actor starts there turn each round. Where to start?

superteddy57
February 23rd, 2026, 18:36
Bounds won't work here. You will also need to have the insertbefore flag as well.

If you look at the template for the name you will see it anchors to both the leftanchor and rightanchor points. If you wanted to add a control to the right, it should be anchored relative to the rightanchor.

LordEntrails
February 23rd, 2026, 19:03
What's the template name, where will I find it? Please :)

superteddy57
February 23rd, 2026, 19:05
There aren't many setup like you would see in the layout controls. It needs to be setup with the templates provided in the template_ct.xml

LordEntrails
February 23rd, 2026, 20:12
Thanks.

Any thoughts on the other items and which templates to look at or examples of similar changes?

superteddy57
February 23rd, 2026, 20:21
I would look at the templates used in 5E and CoreRPG in the combat tracker and reuse them in their base form. Make new templates for yourself. I would also look at the layout controls. In this case would be the listitem ones

LordEntrails
February 23rd, 2026, 23:55
Thanks. Will see what I can do :)

mccartysr
February 28th, 2026, 03:42
1. In standard FG terms, he is saying you need to define relative anchoring for the controls you are trying to add. You have to follow the templates back to "string_ct_entry_name" and you can see it uses relative anchoring so that it fills the space.
He also tells you to use insertbefore https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644522/Ruleset+-+Layering. If you look at how the ct entry is built, the entries are in order from right to left because the xml is parsed in order and each control is relatively anchored to the control to its left. Thus, you will want to use insertbefore with the name of the control that you want immediately to the left of your new controls. For examples of the layering, you can look at the 5E combat tracker.

2. You could copy the code where the 5E combat tracker adds the attack and defense icons. It uses merge, so that you keep the base functionality of the tracker from CoreRPG.

3. Same way 5E adds it. registerMenuIutem(...). It's in the ct_menu.lua script. Use the menu item to call a function where you reset the round.

4. Same as Question 3 for the menu item. I highly recommend you use the control linked to the database because then you can loop through the database to reset all of them. you will have to write a function to perform whatever you want the menu item to do.

5. The combat tracker uses crosslink templates. There are plenty of examples of how it works in CoreRPG. You may have to work your way back through a couple templates to get to the underlying control that has crosslink applied, but it is there. You may have an easier time seeing how crosslinking works by look at the ct_host_entry.xml for 5E.

6. CombatManager.setCustomTurnStart(...)

LordEntrails
March 1st, 2026, 00:46
Thank you! I'll see what I can do over the next week or three.

LordEntrails
March 1st, 2026, 23:35
#1 resolved here: https://discord.com/channels/274582899045695488/792625299878707210/1477766259100614747
Psicodelix's solution copied here, modified by actuals I used.

Set Merge > join
Create Custom Anchoring
(remove Advanced Template, not sure where/why I had this)
66713
EDIT: Resolved. The only thing not working as desired is the underline on the nonid_name is not at the narrower width, it still underlines the full width. I had set the value for height not offset!

LordEntrails
March 3rd, 2026, 04:29
#2 partially solved, buttons added to CT

FG Code:

<button_ct_section_defense name="button_section_defense" merge="join" insertbefore="button_section_space">
<anchored>
<right parent="rightanchor" offset="0" relation="relative" />
</anchored>
</button_ct_section_defense>
<button_ct_section_active name="button_section_active" merge="join" insertbefore="button_section_space">
<anchored>
<right parent="rightanchor" offset="0" relation="relative" />
</anchored>
</button_ct_section_active>


RSW Actions:
- Create FG Button
- Name button
- Remove Font and Frame
- Add custom Anchoring: anchor=right, offset=0, parent=rightanchor, relation=relative
- set insertbefore=button_section_space
66735

Moon Wizard
March 3rd, 2026, 18:06
You shouldn't need the "anchored" overrides; since the default templates already do that. (buttoncontrol -> button_ct_section (sets anchored) -> button_ct_section_defense)

Regards,
JPG

LordEntrails
March 4th, 2026, 01:43
You shouldn't need the "anchored" overrides; since the default templates already do that. (buttoncontrol -> button_ct_section (sets anchored) -> button_ct_section_defense)

Regards,
JPG
Thanks. That's a limitation of my knowledge of RSW, If I remove the anchor then RSW inserts Bounds. Which then cause problems :)

Moon Wizard
March 4th, 2026, 04:46
Sounds like something to take up with psicodelix. Seems like bounds should not be forced on an existing template; especially since it's anchored.

JPG

LordEntrails
March 4th, 2026, 05:23
Sounds like something to take up with psicodelix. Seems like bounds should not be forced on an existing template; especially since it's anchored.

JPG
It might be just that I don't know how to do it properly or could be a limitation. From my understanding, RSW needs Bounds values unless the control is explicitly anchored in RSW. So that's why I add the anchor tags. Even after all this time, I consider myself pretty green :)

Moon Wizard
March 4th, 2026, 06:31
The anchored tags are already part of the standard templates for the ct_entry stuff. If you're using all the same templates; you shouldn't need them.
See 5E ruleset : ct_host_entry.xml ; windowclass name="ct_entry". It doesn't need those tags; so not sure why you would even with RSW unless you are editing the ct_entry manually and moving stuff.

Regards,
JPG