Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Sheetworker Help] Update Repeating Sections based on change of non-repeating attribute?

1548205421
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
Ok this should be really simple. I have an attribute <input type="hidden" name="attr_target_form_selection" /> <input type="hidden" name="attr_target_location_selection" /> That I want to show up in a repeating section <fieldset class="repeating_ranged">     <div class="sheet-cell sheet-col4">         <span name="attr_target_form_selection"></span>     </div>     <div class="sheet-cell sheet-col4">         <span name="attr_target_location_selection"></span>     </div>..... Of course it's not showing up so what am I doing wrong?
1548206785

Edited 1548206947
GiGs
Pro
Sheet Author
API Scripter
When you put an attr in a repeating section, it is automatically treated as part of that repeating section: so those attributes are actually  repeating_ranged_id_target_form_selected . What you need to do is create a new inner attribute, with a reference to the outside attribute. Something like: <fieldset class="repeating_ranged">     <div class="sheet-cell sheet-col4">         <input type="text" name="attr_target_form_selection" value=@{target_form_selection} readonly>     </div>     <div class="sheet-cell sheet-col4">         <input type="text" name="attr_target_location_selection" value=@{target_location_selection} readonly>     </div>..... But that begs the question of how the attribute is set, since the original form is a hidden attribute. So I'm doubtful this is really what you need. Can you explain what the purpose is here? Why do you need to repeat these two attributes on every row of your fieldset?
1548207309
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
I have a combat modifiers calculation tab where all of the mods are added up. On that tab there is a target form and location selection that sent to a sheetworker for calculations. What I want is when the player selects target form and location for those selections to show in their melee / ranged row as target selected: "Humanoid": "Torso". Eventually I want all of the modifiers to the to hit roll will be added up and presented in the same row from the Combat Mods Tab.
1548209277
GiGs
Pro
Sheet Author
API Scripter
How are they selecting the target form and location? the inputs outside the fieldset are hidden. Normally with things like targeting, you have a button to launch the attack, and that prompts for the details like humanoid, torso as needed. You dont need to build that into the character sheet, and in most cases probably shouldn't, because players will need to jump around and click several different places on the sheet for each attack. 
1548210905
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
You're not following...I needed it for calculating the target location modifier...it's a GURPS thing.
1548211231
GiGs
Pro
Sheet Author
API Scripter
I know how gurps works. I'm saying that the macro would ask the player for the location, and then include the relevant modifier in the attack roll. It's exactly the same process you;re planning to use on the sheet, but structured in a different, more natural order.
1548211686
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
I was trying to avoid a bunch of macro asks when the player is making an attack roll. Furthermore the target info feeds into my api which adds to the roll template wound multiplier, wound modifier notes, critical table rolls, based on location selection even if its a random location. I was trying to do all of the calculations from the Combat mods tab and feed them back to the roll. Where ironically, it would ask in a macro if the player wanted to add in the pre-calculated mods.
1548213035
GiGs
Pro
Sheet Author
API Scripter
That makes sense. Personally i like to avoid lots of prompts during a macro too. But I'll say one last thing, at the risk of belabouring the point: If you dont prompt for them during the macro, players are going to sometimes slip up and leave them unchanged from their last attack. If you are using an API script, you can prompt during the attack, and handle all the inputs in the script, and have the script handle whatever complexity you need. Sorry for sidetracking, I'll get back to helping whatever approach you decide to follow.
1548213738
SᵃᵛᵃǤᵉ
Sheet Author
API Scripter
The hangup was that the players were not seeing there target choices reflecting the correct modifier...I am trying to fix that as well as finalize an API that does all of the target effects. What's more is I also need to do a repeating damage that repeats based on rounds hit and so on. I have a lot on my plate.