PDA

View Full Version : Problems synchronising a label cycler field to the combat tracker.



Valarian
October 27th, 2019, 20:20
In the One Ring, the combat stance of a character determines the initiative order. I've implemented this in the combat tracker using a label cycler. For the latest version of the ruleset, I had the idea of placing a similar label cycler (with the same values) on the character sheet so that the player could control the stance rather relying on the GM to change the stances. Unfortunately, I've not managed to get the link to synchronise to the tracker.

Debug output would indicate that the change to the field on the character sheet is being picked up by the code, but not making through to the cycler on the combat tracker.
s'DEBUG : onLinkUpdated(): sLink/bLocked/value: ' | s'charsheet.id-00002.defaultstance' | bFALSE | s'Open'
s'DEBUG : onUpdateDisplay(): sLink: ' | s'charsheet.id-00002.defaultstance' | s'Fwd'

Anyone tried this or something similar?

Moon Wizard
October 28th, 2019, 01:22
Maybe you can try implementing the "stance" as a hidden stringfield which is linked like other PC fields, and then attach the cycler to that field.

Regards,
JPG

Valarian
October 28th, 2019, 11:58
I've managed to get the label cycler synchronisation to work by moving some of the update code into the onLinkUpdated function instead of calling the update function on the cycler itself.
Attached the ct_labelcycler code for future reference (change the extension from .txt to .lua).