While looking for solutions to my other problem (where you replied!), I 
found another solution to this by using =[field] =[field] +[sum[]] and 
+[product[]]. I didn't know how = and + worked, and I don't know if this is 
simpler - it has way less stratification of vars - but it works nonetheless.

<$action-setfield $tiddler=<<currentTiddler>> $field="level" $value={{{ 
=[<currentTiddler>get[level1]] =[<currentTiddler>get[level2]] +[sum[]] }}}/>

<$vars
hps={{{ [{!!class}get[hd]multiply[2]subtract[2]] }}}
hp1={{{ =[<currentTiddler>get[level1]] =[{!!class}get[hd]] +[product[]] }}}
hp2={{{ =[<currentTiddler>get[level2]] =[{!!class2}get[hd]] +[product[]] }}}
hocon={{{ =[<currentTiddler>get[modcon]] =[<currentTiddler>get[level]] 
+[product[]] }}}>

<$action-setfield $tiddler=<<currentTiddler>> $field="hitpoints" $value={{{ 
=[<hps>] =[<hp1>] =[<hp2>] =[<hpcon>] +[sum[]] }}}/>

</$vars>
On Thursday, 11 March 2021 at 17:30:53 UTC+1 [email protected] wrote:

> The key is that you cannot access the value of a variable, within the same 
> vars widget that sets it.
>
> So this:
>  <$vars a=2 b=3 c=a+b>
>
> Should be:
>
> <$vars a=2 b=3>
> <$vars c=a+b>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/217dd740-aef2-4a61-9a90-2497384874c5n%40googlegroups.com.

Reply via email to