PDA

View Full Version : Problem with modifing Combat Tracker



Rook
January 27th, 2008, 18:52
I'm attempting to add the BAB/GRP to the Combat Tracker.

The problem is that the string is showing nothing.

Here's what I've done:



<stringcontrol name="babgrp">
<anchored>
<left>
<parent>name</parent>
<anchor>left</anchor>
<offset>35</offset>
</left>
<top>
<parent>init</parent>
<anchor>bottom</anchor>
<relation>current</relation>
</top>
<size>
<width>40</width>
<height>17</height>
</size>
</anchored>
<font>sheettextsmall</font>
<frame>
<name>textlinesmall</name>
<offset>0,-1,0,0</offset>
</frame>
</stringcontrol>
<stringcontrol name="babgrplabel">
<anchored>
<left>
<parent>name</parent>
<anchor>left</anchor>
<offset>10</offset>
</left>
<top>
<parent>babgrp</parent>
<anchor>top</anchor>
<offset>4</offset>
</top>
</anchored>
<font>sheetlabelsmall</font>
<static>babgrp</static>
</stringcontrol>



I'm missing something...however I don't know what. Can anyone point me in the right direction?

Thanks

Moon Wizard
January 28th, 2008, 05:32
Since the combat tracker does not actually link to the database directly, when you add a field to the combat tracker, it will not auto-populate. The fields that you see auto-updating in the combat tracker (PC only) are tied back via callback functions.

If you look in the combattracker.lua script file, you will find 2 functions which are used when adding new entries to the combat tracker. One called addPC, and another called addNPC. Assuming that you only want to add values in this field for NPCs, you just need to add another line similar to ones under active properties in the addNPC function.


if source.getChild("babgrp") then newentry.fullatk.setValue(source.getChild("babgrp").getValue()) end;

Hope this helps,
JPG

Rook
January 28th, 2008, 13:26
I'll give this a try when I get home tonight. Thank-you for taking the time to lend a hand.

Best Regards,

Rook

Rook
January 28th, 2008, 23:47
Your adviced worked great ... after modifying "newentry.fullatk" to "brbgrp" :)

Once again...thanks

Rook

Foen
January 31st, 2008, 06:19
I imagine that code will correctly populate the new field when a PC/NPC is dropped onto the tracker, but will not keep the field linked back to the source character sheet for PCs.

Additional code is needed for that (you will see a setLink call in addPC, and the combat r=tracker field has a setLink function built in to it).

Cheers

Stuart