Believe me, I've been looking at them for days, and only now it struck me how to use them. I'm still trying to understand if there's a formula to have only 2 action-setfield performing the whole operation (one for the first field and one for the second, that needs the first to compute). Thanks On Thursday, 11 March 2021 at 23:39:42 UTC+1 saq.i...@gmail.com wrote:
> 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/e42cf4d3-142d-46f0-b3b9-df70160dc657n%40googlegroups.com.