I have been using TW5 to document my campaign.  Nothing fancy, just tags 
and lists, etc.   Now, I want to document the GURPS 
<http://www.sjgames.com/gurps/details.html> spells that I have been 
creating.   Sorry for the long example, but I wanted to give as much 
context as possible.

Here is what the spells would look like in GURPS:

“Magic MIssile 1”
Innate Attack (crushing) 1d-1, 3.5
  Cosmic, no roll required, +100% 
  Increased 1/2D, 5x, +10%   1/2D 10 yds
  Reduced Range, x1/5, -20%   Max 20 yds
  Spell w/components, -50%
  [40%/5]

“Magic MIssile 2”
Innate Attack (crushing) 1d+1, 6.5
  Cosmic, no roll required, +100% 
  Increased 1/2D, 5x, +10%   1/2D 10 yds
  Reduced Range, x1/5, -20%   Max 20 yds
  Spell w/components, -50%
  [40%/10]

I had 3 design goals:
Hide the information on how the spell was "built", using the GURPS rules, 
unless the player specifically wanted to read it.  This would reduce the 
clutter. 
Be able to "find all spells that cost 5"
Be able to "find all variants of 'Magic Missile"

I figured the best way to model this would be using a data tiddlers and a 
template.     Searching the group, I found a way to hide the "build" 
information so that it doesn't clutter up the interface.   The template 
tiddler is:

BasicSpellFormat
<$button class="tc-btn-visible" popup=<<qualify "$:/temp/popup1">>>
//{{##spell}}// ''{{##damage}}'' {{##range}} [{{##cost}}] 
</$button>
<$reveal type="nomatch" state=<<qualify "$:/temp/popup1">> text=""><br>
{{##build}}
</$reveal>

And the data tiddlers are:

MagicMissileData1

{
"spell":"Magic Missile",
"damage":"1d-1 cr",
"range":"(1/2D: 10 yds, Max: 20 yds)",
"cost":5,"build":"Innate Attack (crushing) 1d+1, 6.5<br>&nbsp;&nbsp;Cosmic, no 
roll required, +100%<br>&nbsp;&nbsp;Increased 1/2D, 5x, +10%   1/2D 10 
yds<br>&nbsp;&nbsp;Reduced Range, x1/5, -20%   Max 20 yds<br>&nbsp;&nbsp;Spell 
w/components, -50%<br>&nbsp;&nbsp;[40%/10]"
}


and
MagicMissileData2

{
"spell":"Magic Missile",
"damage":"1d+1 cr",
"range":"(1/2D: 10 yds, Max: 20 yds)",
"cost":10,"build":"Innate Attack (crushing) 1d+1, 6.5<br>&nbsp;&nbsp;Cosmic, no 
roll required, +100%<br>&nbsp;&nbsp;Increased 1/2D, 5x, +10%   1/2D 10 
yds<br>&nbsp;&nbsp;Reduced Range, x1/5, -20%   Max 20 yds<br>&nbsp;&nbsp;Spell 
w/components, -50%<br>&nbsp;&nbsp;[40%/10]"
}


And the final tiddlers are

[[Magic Missile 1]]
{{MagicMissileData1||BasicSpellFormat}}

and

[[Magic Missile 2]]
{{MagicMissileData2||BasicSpellFormat}}

It looks like this (when expanded):


*My questions:*

1.  Is there a better way to encode newlines (and non-breaking spaces) into 
the "build" index data?   Having to type "<br>;nbsp;&nbsp;" for each new 
line is a lot of redundant work.  I know I can't put newlines in a 
dictionary data tiddler, but it also seems that I cannot encode newlines in 
a JSON data tiddler either.  I could live with using an escape character 
sequence ("\n"), but I couldn't figure out how to parse the data in the 
template tiddler.  All I could do was output the data ({{##build}}), so I 
had to encode the raw HTML into the data itself (not ideal).  Can I use a 
"filter", or write some javascript?

2.  How would I list all tiddlers for "all spells that cost 5" or "all 
variants of 'Magic Missile'"?    Have I made it too complex?   I went with 
this approach because if I just used plain tiddlers with a few custom 
fields (i.e. "cost" and "name"), I would have to copy and paste the button 
code into each tiddler, and I was trying to save myself all of that 
copy/pasting.

I have more questions, but I shall refrain for now.   Any help would, of 
course, be greatly appreciated.

Chris

P.S.   I am a 20+yr Java programmer, so I am not afraid of a little syntax 
;-)  I just don't know what it is.


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/97f0e4b4-f6f7-401e-8b01-4ec289add4ed%40googlegroups.com.

Reply via email to