0

I want to use Tiddlywiki to document GURPS "Magic as Powers" spells. The most important thing, is to do the math correctly.

For example, a spell's original cost might be 50, but when we apply "limitations" totaling -50%, the cost drops to 25.

The final cost = {Original Cost} * (100% + ("sum of all limitations")).

I thought that I would make each of the limitations a Tiddler, and I would include a "reference" to them in the Spell tiddler (sorry, still too new to Tiddlywiki to know the correct terminology).

It might look like this (and again, sorry, I don't really know the syntax):

{Current Tiddler Name}
"Spell description.. just some test that I type in"
Original Cost: 50
Limitations:
   Limited Use: 1/day
   Cost 1 Fatigue
Final Cost:  XXX

Where "Limited Use: 1/day" would be its own tiddler... and just contain the value -40 (or -0.40), and "Cost 1 Fatigue" would just contain -10 (or -0.1)

Then we would sum up the values of all of the "Limitation" tiddlers, and calculate the Final Cost.

1 Answers1

0

When you give the "Limited Use: 1/day" and "Cost 1 Fatigue" tiddlers the tag "limitation" and put the cost value as a field "cost" in each of those tiddlers then you can sum up their values as follows using widget operators and filters:

<$set name="costSum" filter="[tag[limitation]get[cost]sum[]]">
Sum of costs: <$text text=<<costSum>>/>
</$set> 
Kosi2801
  • 22,222
  • 13
  • 38
  • 45