(TW5) Using a template for RPG character stats

482 views
Skip to first unread message

Kyle Blaine

unread,
Apr 2, 2017, 11:48:49 PM4/2/17
to TiddlyWiki
Hello all!

New here, and to TiddlyWiki in general. I'm mainly interested in using it as a tool to organize data for a tabletop roleplaying game (Savage Worlds) I will be running.
One thing I'm particularly frustrated with achieving is creating a standard template to essentially create a blank copy of a tiddler I've made and already fancied up.

For example, I've made a character template which displays a short summary about the character, and contains a few tabs to pull up relevant information as needed:

<<tabs "[[Character_Bio]] [[Character_Stats]] Inventory:" "$:/state/tab1">>

The stats tab should contain a table that lists the character's abilities so I can easily reference them. I went with the tabbed approach so the tiddlers didn't take up as much space, and I could possibly avoid scrolling up and down constantly to flip between pieces of information.

!!!''STATS:''
|Name:  |h
|''Attributes:'' |Agility:  | Smarts: | Spirit: | Strength: | Vigor: |h
|''Skills:'' | |h
|Charisma: |Pace: |Parry: |Toughness: |h
|Hinderances: | |h
|Edges: | |h
|Booty: | |h
|Gear: | |h

Do I need to clone the CharacterTemplate tiddler, set the tags again, make new tiddlers for the tabs, and copy-paste all their information every time?

I know there has to be a simpler way to do this, but if it's not obvious already, I have very little experience with web coding and markup.

I was really impressed with how the "TW5 for scholars" system was set up, where you could click "Person", fill in some fields, and it made a new Tiddler. I couldn't quite figure out how to modify that for my own purposes though. I have a feeling though, that if I'm not way out of my depth already, mimicking such functionality would be far beyond me...

If the tabs part is perhaps too advanced, is there an easy method to just make a new tiddler from a template, filled with variable fields that I can switch up, without trying to create any sub-tiddlers for the tabs?

Reading the template tiddler and transclusion documentation over and over didn't help me understand much better in a practical application sense. :(

Any nudges in the right direction would be greatly appreciated. (Or just letting me know I should stick to flipping between Google Docs until I learn to code web apps. I'd accept that too. :P  )

Thanks in advance!


Jed Carty

unread,
Apr 3, 2017, 9:53:14 AM4/3/17
to TiddlyWiki
I have actually made exactly this in the past, but nothing that could be shared unfortunately.

The way you want to do this is to make a single template for how you want everything displayed in a tiddler and then transclude that into the tiddler where you want it displayed.

For the stats block in particular you would make a tiddler called StatsBlockTemplate (or whatever you want to name it) with something like this in the text field:

!!!''STATS:''
|Name:  {{!!name}} |h
|''Attributes:'' |Agility: {{!!agility}} | Smarts: {{!!smarts}} | Spirit: {{!!spirit}} | Strength: {{!!strength}} | Vigor: {{!!vigor}} |h
|''Skills:'' | {{!!skills}} |h
|Charisma: |Pace: |Parry: {{!!parry}} |Toughness: {{!!toughness}} |h
|Hinderances: | {{!!hinderances}} |h
|Edges: | {{!!edges}} |h
|Booty: | {{!!booty}} |h
|Gear: | {{!!gear}} |h

You probably also want to give it a field called 'caption' with a value 'Stats Block', this is what will be displayed on the tab.

Then you make a tiddler for each character, and in those tiddlers you create fields for each attribute, like name, agility, etc. and in that tiddler you put <<tabs "StatsBlockTemplate">>
and it will display the stats block in a tab, but the values for each attribute will be taken from the containing tiddler. Then you can do the same thing for the other tabs. This way you can have all of your character data in a single tiddler and control how it is displayed using the other templates.

To make this easier you can tag the tiddler will all of the character information with Character, then make a conditional view template that automatically displays the information tabs in that tiddler also.

I have some stuff about making templates here: http://inmysocks.tiddlyspot.com/#Making%20templates
And Tobias explains conditional view templates here: http://tobibeer.github.io/tb5/#Conditional%20ViewTemplate%20Section

Kyle Blaine

unread,
Apr 4, 2017, 1:36:57 AM4/4/17
to TiddlyWiki
Wow, THANK YOU, JED!! :D

After following your instructions, (and your own tiddlyspot, bookmarked!) I managed to create a "Toolbox" tiddly, which currently contains a "Create New NPC" button. The fields like to arrange themselves in alphabetical order, which would get confusing, so I got around that by renaming the stat fields to "01agility, 02smarts"etc...
Lastly, I added a detailed Bio tab, and an empty tab labeled "Close", so I can shrink the tiddly if I need to without closing it. I'm beginning to feel the power! :)

After merging a bunch of cells so each entry in the table doesn't extend vertically, I dare say it's near-perfect and entirely usable! I can finally start working on my campaign instead of fiddling with the software.

Thank you so much for your help and the links to the excellent resources!

Is your conditional view template idea sort of like a table of contents? I followed a tutorial to make a basic ToC menu on the right side, but I'll still look into these anyway. :)

Seriously, I can't thank you enough for taking the time and helping me over a huge hurdle. Thanks to you, I also understand fields a lot better as well!
Reply all
Reply to author
Forward
0 new messages