
I want to make a simple solution to enter Health ( HP ) Max and Current numbers, for ease of enemies Health management on tokens. However, when I try to enter Health Max on particular sheet, it stays at 0 when reopening it. It also is empty value on token of character itself. Current value not changing, it always taking full Max value - where Max becomes empty. What am I doing wrong? On sheet opening... After sheet editing... On sheet re-opening, after filling... <h2>Health<h2>
<h3>Max:</h3> <input class="number" name="attr_health_max">
<h3>Current:</h3> <input class="number" name="attr_health" value="0">
<fieldset class="repeating_health">
<div class="sheet-flex-container">
<input type="checkbox"class="normal" name="attr_healthbox" value="1"><span></span>
<select name="attr_healthlevel">
<option value="" selected disabled>Level...</option>
<option value="+1">Bruised</option>
<option value="+2">Injured</option>
<option value="+4">Maimed</option>
<option value="0">Taken Out</option>
<option value="-1">H. Armor</option>
</select>
<input type="hidden" class="hider" name="attr_healthlevel" value="0">
<div class="flex-container">
<input type="text" name="attr_healthcondition">
<span name="attr_healthlevel"></span>
</div>
</div>
</fieldset> And sheetworks, in background... <script type="text/worker">
on("sheet:opened", function(){
getSectionIDs("health", function(idarray){
if (idarray.length < 1){
var values = {};
var levels = ["+1", "+2", "+4", "0"];
for (var i = 0; i < levels.length; i++){
var rowID = generateRowID();
values["repeating_health_" + rowID + "_healthlevel"] = levels[i];
}
setAttrs(values);
}
});
});