I just transposed your calculations exactly as they were, as I wasn't sure 
of the logic or which of the interim values you might need.

See https://tiddlywiki.com/#Filter%20Expression for an explanation on = and 
+ prefixes for filter runs.

On Thursday, March 11, 2021 at 7:50:58 PM UTC+1 dop...@gmail.com wrote:

> 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 saq.i...@gmail.com 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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6d6918bc-cfb6-4b29-93f8-b345de587a6cn%40googlegroups.com.

Reply via email to