But I'm not using the charms within the conditionals tags. I restricted the charms to the tag following the target list. Even though? Here is what I did. I made these changes: * add a new parameter 'iteration' to the getTargetInfo function * use the variable TagCount as value for this new parameter * add a new option for charm content replacing, in getTargetInfo: case 'target_list':
return iteration; Then my previous macro --target_list| @{target|1st|token_id} | @{target|2nd|token_id} |
@{target|3rd|token_id} | @{target|4th|token_id} | @{target|5th|token_id}
| @{target|6th|token_id} | @{target|7th|token_id} |
@{target|8th|token_id} | @{target|9th|token_id}
--Ataque#?{Nº de objetivos|1}|[[ [$Atk%%target_list%%] 1d20 + 4 ]] vs %%ref%% (%%token_name%%)
--?? $Atk1.base > 1 ?? Crítico|[[18]] fire (@{target|1st|token_name})
--?? $Atk2.base > 1 ?? Crítico|[[18]] fire (@{target|2nd|token_name})
--?? $Atk3.base > 1 ?? Crítico|[[18]] fire (@{target|3rd|token_name})
...
--?? $Atk9.base > 1 ?? Crítico|[[18]] fire (@{target|9th|token_name}) almost works (tested for 2 targets): Each attack roll is identified by its iteration order. Therefore, only conditionals referencing actual rolled attacks are shown (if conditions are met, which is allways the case in the macro of the example). My problem now is somewhere whithin inline processing. This is the PowerCard of the example before the script calls JSON.stringify : ...
"Ataque #1":"[[ [$Atk1] 1d20 + 4 ]] vs [[[[10+[[floor(1/2)]]]]+[[[[[[floor((18-10)/2)]]]]]]+0+1+0+0+0+0]] (Ezren)",
"Ataque #2":"[[ [$Atk2] 1d20 + 4 ]] vs [[[[10+[[floor(1/2)]]]]+0+2+1+0+0+1+0]] (Seelah)",
"?? $Atk1.base > 1 ?? Crítico":"[[18 ]] fire (Ezren)",
"?? $Atk2.base > 1 ?? Crítico":"[[18 ]] fire (Seelah)",
"?? $Atk3.base > 1 ?? Crítico":"[[18 ]] fire (Seelah)",
...
"?? $Atk9.base > 1 ?? Crítico":"[[18 ]] fire (Seelah)",
... It should work. However, this is after: ...
\"Ataque #1\":\"$[[1]] vs $[[15]] (Ezren)\",
\"Ataque #2\":\"$[[2]] vs 14 (Seelah)\",
\"?? $Atk1.base > 1 ?? Crítico\":\"$[[3]] fire (Ezren)\",
\"?? $Atk2.base > 1 ?? Crítico\":\"$[[4]] fire (Seelah)\",
\"?? $Atk3.base > 1 ?? Crítico\":\"$[[5]] fire (Seelah)\",
... I don't understand what happened. Why does it treat different the inline rolls of Ezren and Seelah's ref ? And what does happen then with critical conditionals? Any help would be appreciated.