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

list of skills

1499169153

Edited 1499169198
Mickael N.
Sheet Author
API Scripter
Hi, On my custom character sheet, I search to build something like 5shaped sheet for spell section or weapon section. Have a fieldset to config the skill and then have a visual result like this : Skills: Handgun 6, Riffle 4, Athletics 8, .... When you click on the competence it roll the dice. But I don't know how do that. Then I read the 5eshaped sheet I have see : <span name="attr_name" class="sheet-heading"></span> on play it give : <span name="attr_name"class="sheet-heading">Name of the weapon</span> Could you help me please ?
1499286858
Lithl
Pro
Sheet Author
API Scripter
When you have a span element with a name attribute whose value begins with "attr_", it fills in the span with the value of that attribute. In this case, @{name}. The value of the attribute needs to be set somewhere else, either in something like an input element, or else with a sheet worker script.
1499341772
Mickael N.
Sheet Author
API Scripter
Thank, I have near success to do what I want. Just Auto calculation input put into the span the formula instead of the calculate value.... My span attr_emp = (ceil(@{hum}/10)) intead of the number value How I can do ? <div class='sheet-col' style="width:90px;"> <button type='roll' value='&{template:skill}{{skillname=Emp}}{{result=[[1d10!cf<1+@{emp}+?{mod.|0}]]}}' name='roll_emp'>EMP</button> <span name="attr_emp"></span> <input type="number" disabled=true maxlength="2" max="10" name="attr_emp" value="(ceil(@{hum}/10))" /> </div> <div class='sheet-col' style="width:90px;"> <button type='roll' value='&{template:humanity}{{type=Humanity}}{{save=[[{1d100}<@{hum}]]}}' name='roll_hum'>Hum.</button> <span name="attr_hum"></span> <input type="number" value="0" style="font-size: small" maxlength="3" max="100" name="attr_hum" /> </div>
1499345657
Jakob
Sheet Author
API Scripter
You will need to calculate the value via sheet workers instead of autocalc for it to display the result in a span.
1499353142
Mickael N.
Sheet Author
API Scripter
Ah..... Ok  Let's go work Thank ;-)
1499447675

Edited 1499455831
Mickael N.
Sheet Author
API Scripter
Hi I have another question. I have a repeting_list and I want to do an addition of a element into it. I have write it but it not exactly do what I want. on("change:repeating_cyber:cybHumLost", function() { getAttrs([ "repeating_cyber_cybHumLost", "hum", ], function (values) { var total = values.hum - values.repeating_cyber_cybHumLost; if (0 > total) { total = 0; } setAttrs({ hum: total }); }) });  I want to do the sum of all repeating_cyber_cybHumLost field value... But I don't know how. I have see something about "_reporder_repeating_"  But I need some help to understand.
1499721105
Mickael N.
Sheet Author
API Scripter
Hi, Sorry but I still need your help. I try to getAttrs on a element in a repeating_ section. I take it. Then I use it at a key in an array to retrieve a value. Then I put this new value in an "Attr_" in the same row of the repeating_section. So get caliber value, pass it in an array key : value (caliber:damage) and put the damage in a hidden input, and the caliber in a visible span. My problem is that I can put the value in the good attr_ because I think I need the ID of the row of the repeating section. But I don't know how I can retrieve the ID of the current row. Can you help me please ?
1499721364
Mickael N.
Sheet Author
API Scripter
on("change:repeating_weapon:attr_wpAmmo", function(){ var ammo = [ '9 mm' : '[[2d6+1]]', '11 mm' : '[[3d6]]', '12 mm' : '[[4d6+1]]', '.454' : '[[4d6+3]]', '.44' : '[[4d6]]', 'Cal.12' : '[[4d6]][[2d6]][[1d6+1]', '5.56' : '[[5d6]]', '7.62' : '[[6d6+2]]' ]; getAttrs([ "wpAmmo" ], function (values) { var ammo = setAttrs({ caliber : values.wpAmmo, dmg : ammo[values.wpAmmo] }); }); });