Hi there ! I recently tried to make a macro with attributes coming from a repeating section. If you definitively know what will be the number of the row, it is pretty easy by referring to rows with $0, $1, $n. Anyway, the way I see repeating section is the possibility to have multiple rows without knowing their numbers at the beginning. Moreover, if repeating sections is used for evolving sections (like it looks like to be designed for) like stuff, skills, etc., you can't simply use a global macro for your sheet without knowing n, number of rows. My suggestion is to have a value for $ (let's say n) that will make the macro to loop for every values, and return all results as a different result of the macro. For example, it can really usefull with a query. Here is a piece of code regarding advanced skills using repeating fields.
<div >
<fieldset class="repeating_skill">
<input type="text" name="attr_skill_name"style="margin-left:5px;width:145px;"/>
<input type="text" name="attr_skillcarac"style="width:30px;margin-left:1px;font-weight:lighter;"/>
<input type="radio" name="attr_skill" value="1" style="margin-left:15px;" checked/> <!--1/2-->
<input type="radio" name="attr_skill" value="2"/> <!-- taken-->
<input type="radio" name="attr_skill" value="3" style="margin-left:20px;"/> <!-- +10%-->
<input type="radio" name="attr_skill" value="4"style="margin-left:23px;"/> <!-- +20% -->
<input type="text" value="0" name="attr_totalskill" style="width:40px;height:18px;background:black;margin-left:25px;"/>
<divstyle="width:10px;margin-left:1px;" >%</div>
</fieldset>
</div>
here is the macro I made :
!power {{
--corners|10
--charid|@{character_id}
?{Skill ? ?|
@{repeating_skill_$0_skillname} (@{repeating_skill_$0_totalskill} %),
--name|@{repeating_skill_$0_skillname}
--emote|**@{character_name}** rolls for **@{repeating_skill_$0_0_skillname}** !
--rightsub|Advanced Skill
--Skill:|**@{repeating_skill_$0_totalskill} %**
--Degree of Success:|[[ [$Roll] floor((@{repeating_skill_$0_totalskill}+?{Bonus|0}-1D100cs<@{repeating_skill_$0_totalskill}cf>@{repeating_skill_$0_totalskill})/10)]]
--?? $Roll >= 0 ?? Success| !
--?? $Roll< 0 ?? Fail| ! |
@{repeating_skill_$1_skillname} (@{repeating_skill_$1_totalskill} %),
--name|@{repeating_skill_$1_skillname}
--emote|**@{character_name}** rolls for **@{repeating_skill_$1_skillname}** !
--rightsub|Advanced Skill
--Skill:|**@{repeating_skill_$1_totalskill} %**
--Degree of Success:|[[ [$Roll] floor((@{repeating_skill_$1_totalskill}+?{Bonus|0}-1D100cs<@{repeating_skill_$1_totalskill}cf>@{repeating_skill_$1_totalskill})/10)]]
--?? $Roll>= 0 ?? Success| !
--?? $Roll< 0 ?? Fail| !
} }}
Problem is that players won't have the same number of advanced skills and not all players would be able to understand it or correctly modify it.
Here is an example of what could be done :
!power {{
--corners|10
--charid|@{character_id}
?{Skill ? ?|
@{repeating_skill_$n_skillname} (@{repeating_skill_$n_totalskill} %),
--name|@{repeating_skill_$n_skillname}
--emote|**@{character_name}** rolls for **@{repeating_skill_$n_skillname}** !
--rightsub|Advanced Skill
--Skill:|**@{repeating_skill_$n_totalskill} %**
--Degree of Success:|[[ [$Roll] floor((@{repeating_skill_$n_totalskill}+?{Bonus|0}-1D100cs<@{repeating_skill_$n_totalskill}cf>@{repeating_skill_$n_totalskill})/10)]]
--?? $Roll >= 0 ?? Success| !
--?? $Roll< 0 ?? Fail| ! |
In my proposal, checking $n would start to recover the n values of the repeating section and then pass all values in a loop : $0, $1, $2 to $n. It would then propose a drop down query based on the dynamic range of row permitted by repeating sections. Any macro embedded within a query would achieve far simplier results than having to manually check each time how many rows are present in a repeating section. Regards :)