I can think of three general options here:
- On each skill/spell/trait tiddler, add a field corresponding to each character who has that skill, with field value equal to their current level in that skill.
- On each character tiddler, add a field corresponding to each skill the character has. Again, the field value is their current level in that skill. Optionally, give each field a prefix describing the category to which it belongs, e.g.
skill-acrobaticsvs.spell-fireball. This would a) guarantee that members of the same category appear in the same section of the field list, and b) make it easy to filter for a certain category of fields (and their contents). - For each character, store the skills/levels as matched pairs separated by some divider character(s) that won’t otherwise appear in the skill names.
Personally, I’d tend to favor this third option. You could do this either within fields on the character’s tiddler (use an <$edit-text field="field-name" tag=textarea /> widget for a multi-line field editor), e.g.
title: Character's Name
skills: acrobatics = 1
athletics = 5
spells: fireball = 3
wall of wind = 6
and split the field value first by line (splitregexp[\n]), then at your divider character (=):
<$list filter="[{!!title}get[skills]splitregexp[\n]]" variable="line">
<$let
skill={{{ [<line>split[ = ]first[]] }}}
level={{{ [<line>split[ = ]butfirst[]] }}}
>
<$link to=<<skill>> />: <<level>><br>
</$let>
</$list>
IMO, this would be the best option if you want to keep all the data pertaining to a particular character in the same tiddler.
On the other hand, if you don’t mind having some associated data tiddlers/subtiddlers, you could use dictionary tiddlers, which are a special type of tiddler specifically designed for storing paired values. This would let you make, for instance, Character Name/Skills, Character Name/Spells, and Character Name/Traits, all as stand-alone tiddlers with type: application/x-tiddler-dictionary and text fields containing paired values:
title: Character Name/Skills
acrobatics: 1
athletics: 5
title: Character Name/Spells
fireball: 3
wall of wind: 6
The nice thing about working with data tiddlers is that we have a couple of operators, indexes and getindex, specifically for retrieving values. In this case, your character template might look more like this:
<$tiddler tiddler=`$(currentTiddler)$/Skills`> <!-- see "Substituted Attribute Values" -->
<$list filter="[<currentTiddler>indexes[]]" variable="skill">
<$let level={{{ [<currentTiddler>getindex<skill>] }}}>
<$link to=<<skill>> />: <<level>><br>
</$let>
</$list>
</$tiddler>
IIRC Mohammad’s dynamic tables are also designed to accommodate data tiddler indexes (that is, as an alternative to tiddler fields) so that might be another advantage of this approach… though if you want to display both the current character’s level in a skill and info about that skill taken from the skill’s tiddler, you’d need to make some custom column templates in any case.
Of course, with any of these approaches, you can also make buttons to expedite adding the appropriate fields/indexes to a character. ![]()
IIRC, within a dynamic table row, Mohammad uses the variable <<currentRecord>> to refer to the “title” tiddler for that row. You might try using that in place of <<currentTiddler>> and see if that produces the desired behavior.
Oh, and if you got Shiraz from the public site, you’re probably using 2.9.7… but Mohammad’s working on a rewritten Shiraz 3.0 in which he’s done a lot of work simplifying and updating the dynamic table code in particular. I’ve done a fair bit of dynamic table tinkering myself and found the new version much easier to work with, so if you haven’t done too much work already, this might be a good time to switch!