Building a character's skill list with respective levels, using individual tiddlers

This is a complicated structure, and I think we may be making some conflicting assumptions. Let me clarify some of mine:

  • Data tiddlers (like the “Character/spellbook” example in your screenshot) are purely for holding data; they don’t need a special UI (and in fact, can’t have one, since the type — set to application/x-tiddler-dictionary in this instance — is already defining a dictionary-type ViewTemplate.) Rather, our goal is to build an interface for editing the data tiddler without ever opening it, and then display that interface as part of a template used elsewhere.
  • <$let spellbook={{{ [<currentTiddler>] [[spellbook]] +[join[/]] }}}> ← This code sets the <<spellbook>> variable to a value = <<currentTiddler>>/spellbook.; the <<spellbook>> variable sets the name of the data tiddler being edited. This means that my code won’t be editing any indexes on <<currentTiddler>>, i.e. the tiddler where the template is displayed. I was envisioning it being used as part of an EditTemplate for a character tiddler, so <<currentTiddler>> would be the name of the character… but I’m not sure exactly what your ideal structure looks like.
    • Do make sure that, wherever this template is displayed, the <<currentTiddler>> is not a dictionary tiddler, and the tiddler whose title corresponds to <<currentTiddler>>/spellbook is.
    • It looks like, at present, you’re trying to use my code as part of a general list of spells, not a list of spells known by a particular character. In this case, I imagine you don’t actually want to edit the level at which a particular character knows the spell… because in this situation, there’s no character defined. Is that right?

First, to fix your code, tiddler="<<currentTiddler>>" should be tiddler=<<currentTiddler>>. You don’t want to use quotations marks around any <<variable>> or {{!!transclusion}} when it’s used as the value of an attribute (like tiddler in this $select widget). Quotation marks indicate a literal value, so your current code would be changing the spellbook field of the tiddler with the literal title “<<currentTiddler>>”.

If a character only has one spellbook and all character spellbooks (i.e., data tiddlers) following the CharacterName/spellbook naming convention, then no, you don’t need a field listing this title. I gave the $select example because you’d asked about how to build a dynamic dropdown, and at the time I wasn’t sure about the sort of character/spellbook relationship you were envisioning.

  • If, for example, you had a bunch of prebuilt spellbook data tiddlers with titles like Spellbook A, Spellbook B, etc., and you wanted each character to use one of these preset spellbooks rather than an individualized one whose title can be programmatically determined, it’d be helpful to have a spellbook field that specifies which spellbook should be used for that character.

I would try moving the level-editing code from GURPSSpellbookEditTemplate to GURPSCharEditTemplate.

Got it.

I will still keep the nomenclature for clarity, however, the option to select what spellbook is associated to a character is a good middle ground to some flexibility without diving into the complexity of having multiple spellbooks for one character (which would mean that we also have to deal with duplicates of spells in those spellbooks, for example).

So first, I fixed the code error in the <<selectspellbook>> macro as you indicated, which makes the drop down correctly assign a tiddler tagged with GURPS Spellbook in the spellbook field of a character.

Then changed the GURPSCharViewTemplate to switch to the spellbook field:

<$list filter="[all[current]tag[Char]]">
<$let spellbook={{!!spellbook}}>
''Spellbook'': <$link to=<<spellbook>>/>

<table><tr>
    <th>Spell</th>
    <th>Level</th>
  </tr><$list filter="[<spellbook>indexes[]]" variable="spell">
<$let level={{{ [<spellbook>getindex<spell>] ~0 }}}> <!-- displays "0" if the <<spell>> index does not exist or is blank -->  
<tr><td><$link to=<<spell>>/></td><td> <<level>></td></tr>

</$let>
</$list></table>
</$let>
</$list>

Which correctly toggles the display to whatever spellbook is specified in the field.

image image

Now for the edition of the levels in the spell/level pair of the spellbook data tiddler, I moved the edition code to the GURPSCharEditTemplate, and arranged it so it doesn’t display the value in a multiline, and the whole thing is displayed in a nice table:

|!Edit spell levels:|<|
<table><tr>
<th>Spell</th>
<th> Level</th>
</tr><$let spellbook={{!!spellbook}}><$list filter="[<spellbook>indexes[]]" variable="spell"><tr><td><<spell>></td><td><$edit-text tiddler=<<spellbook>> index=<<spell>> type=number default="0" size=2 tag=input/></td></tr></$list></$let></table>

Which works!

So thanks again a ton for all your help @etardiff, I’m getting somewhere :slight_smile:

For those watching this thread, a quick update to show where I’m at. Still a looooot of work to go, but the basics are starting to be usable :stuck_out_tongue_winking_eye:

Character edition, spell levels:
bookdatatiddleredition

Spellbook edition:
bookdatatiddleredition2

Thanks again @etardiff for you invaluable help!

2 Likes

I’m going to have to subscribe to this thread, because I’m hoping to do something similar for Warhammer Fantasy Roleplay 4th edition, but am a total blank slate when it comes to the kind of deep tiddler coding knowledge represented here. I’ve only previously used it with basic markup, with which I’m comfortable. But this, this is beautiful coding.

Agreed. Building a wiki for a self designed RPG, and currently I’m still busy adding mainly text.

When I started this I had the choice of working in TW or say Ulysses, and I’m glad I chose for TW, because a lot more seems to be possible.

Question for RaHaNGS, GURPs has also extensive rules for creating Magic Items, is that also in the works?

Some of the Magic Crafting rules of GURPS I have adapted, others I have invented on my own (as far as I know).

1 Like

GURPS has extensive rules for EVERYTHING lol

Personally, I’m not into comprehensive systems like GURPS can be, I like to keep things as simple and streamlined as possible for players, so I doubt I will dig all that deep into translating every single rule (for instance there are some logarithmic tables or super-complex modifiers I don’t intend to use). My objective is to round up a nice looking and easy enough to use GURPS frame to create character sheets (stats, skills, traits), and background elements. I haven’t used GURPS since the 2nd edition and I’m currently re-learning most of it as I go on the 4th one. I’ll see what I want or need to integrate as I progress (slowly). My most pressing concern and first really advanced feature after I set up the basic scope I’m currently working on is to provide character points counts, and that alone can be tricky with traits that have their own unique cost mechanics. Assume I will simplify stuff here and there :stuck_out_tongue_winking_eye:

Oh, and I hate that it’s using imperial scales rather than metric. So I have some macros that convert what’s in the books, because I’m trying to keep the numbers in line with the books (and I input everything in the OG measurements).

update: getting the hang of it.

my TW now checks in the spell list of a character if the prerequisites of any given spell are fulfilled, giving relevant details if they are not; as long as the prerequisites are either:

  • another spell
  • a certain level of the Magery advantage
  • a certain number of spells in a certain college
  • Edit: a certain number of spells in each college of set number of colleges (e.g. “2 spells each in 2 colleges”)

Examples below (with a character named “Character” and fake data on the spells for testing):


That should cover a majority of the prerequisites types a spell can have. I’ll update the code if I stumble upon other types of prerequisites (which is very possible given the nature of GURPS rules). Yay!

Edit: Also happy to report that one can now edit spells and advantages themselves, not just their levels, directly in the character tiddler:
bookdatatiddleredition3

1 Like

Hello lurkers!
Good amount of progress, since the trait modifiers are now in! (the logic, anyway, I’m not inputing all the content before the features have been engineered to satisfaction ;P)

Here’s the current view of advantages on a Character:

One can now add, remove, level advantages to a character, including potential modifiers. The UI shows how those modifiers impact the cost in character points for the advantage, and all those costs are calculated on the fly accordingly, right up to the total cost of all the advantages, as shown on the first screenshot.

An advantage:

A special modifier:

I’d like to give a massive thankful shoutout to @etardiff, @Scott_Sauyet, @EricShulman and everyone here for being so kind, patient and helpful as I pester the forums of questions about how to do things in TW. I wouldn’t make such progress without the help of the community!

3 Likes

Adding a built-in help system, as the implementation of such a complex system as GURPS can impact the amount of interface elements and data to enter into the system for it to work faithfully with the written rules.

TW_helptooltip

Also have improved the advantages/disadvantages, modifiers, and skill/spell lists systems so that a user cannot input values that are not legal (like a 0 for something that can only be level 1 minimum), nor benefit from exceptions like Magery level 0 not being reducable in character point cost below 5 regardless of of the Limitations one could attach to it.

I’m also starting to play with the visual display of a character’s sheet:
image

Hey there! It’s been a bit since I last gave an update; I have been swamped with work this past month, so not a lot of time to work on this project. I still managed to make some progress though :slight_smile:

The Character code (edition and display) now includes the tertiary elements of:

  • Build, complete with the the tables for height and weight implemented, which means that depending on build choices, you not only automatically get the advantages/disadvantages related to build choice, but also correctly bounded fields to choose within the related ranges (with the bounds displayed). Size Modifiers (Gigantism and Dwarfism) are also implemented, as well as other mechanics specific to these two traits (meaning that if the character picks up one of those traits, changes to basic move from Dwarfism, and ST/HP discount for Gigantism are implemented).
  • Appearence, with related advantages and disadvantages automatically added and removed depending on your choice, same as for Build.


With Gigantism:

With Dwarfism:

If you’d like to take a look, I regularly update an online test version here (please refrain from saving any changes you make ;P).

2 Likes

I visited recently to look at it, but as far as I know I haven’t made any changes.

With my own wiki If I’m not logged in to Tiddlyhost myself and try to make changes It won’t allow you to save.

Perhaps you could try to see if that is also the case for yours?

That is totally the case, and I didn’t know! Fantastic! Thank you :slight_smile:

On a related note, I’m now using your and yaisog random rolls, as a practice combat is coming up, to test the system.

One issue is if it is possible to make several different dice rolls at once, as the tiddlywiki system updates all tiddlers if one changes.

For example with your roller if you have 4 identical calls, they all change when one of the four is changed, as they use the same storage location.

With a practical rolling system you typically want at least two rolls, one for the to hit (or saves) and one for damage. A critical hit or fumble may mean an additional roll too.

I haven’t been working at all on a roller, the one that may be lingering in my TW was imported from somewhere else. But if I ever need to make one, it would be less of an issue for GURPS, I think, since all rolls are made with 3D6 and usually you don’t have a ton of them to do for any given action… I don’t know, but stick around, if I ever get into that, you may have valuable input to contribute :stuck_out_tongue_winking_eye:

Edit: Is that the issue you mean?
image

If your rollers are called in the same tiddler this is indeed expected behaviour from this:

<$action-setfield $field="roll$DiceCount$d$DiceSides$+$Adjuster$" $value=<<thisResult>>/>

That should be easily fixable; rather than using a field of the tiddler holding the button for rolls to store the result of any given roll, I’d use a generated, unique temp tiddler to store the result for any single button.

Edit2: actually, not that easy after trying a bit, that may be above my ability :stuck_out_tongue_winking_eye:

Creating unique tiddlers is easy enough using this function:

\function now.stamp() [<now YYYY0MM0DD0hh0mm0ss0XXX>]

But recalling them has me puzzled.

I will probably store them where they are used, for example a To Hit roll could be stored in the Character Tiddler of the character that made the roll. Or maybe the Weapon(s) wielded by that character =)

Yet another option would be a data tiddler that stores them in successive fields, with the index containing the link to where the roll was for…

But currently I’m satisfied if I can get some rolls and the 4 tortles can make a dent in Shred…