Zakarius
November 29th, 2009, 05:21
Below is the codeblock I'm working with... as in ShadowRun, wound penalties are based on every three points of stun and physical damage. I wish I could get it to update whenever the stun or physical fields are altered, but the onInit() I'm using only changes the wound value when the character sheet is first opened. (And having to close one's character sheet and reopen simply to reflect the change is pretty silly.)
<standardsm name="woundmodifier" source="stat.wound.modifier">
<anchored>
<to>pdam</to>
<position>right</position>
<offset>60,0</offset>
</anchored>
<readonly />
<script>
function onInit()
local temp = 0;
temp = 0 - math.ceil((window.sdamact.getValue()-2)/3) - math.ceil((window.pdamact.getValue()-2)/3);
window.woundmodifier.setValue(temp);
end
</script>
</standardsm>
Is there something else I can use instead of onInit()?
Zak
<standardsm name="woundmodifier" source="stat.wound.modifier">
<anchored>
<to>pdam</to>
<position>right</position>
<offset>60,0</offset>
</anchored>
<readonly />
<script>
function onInit()
local temp = 0;
temp = 0 - math.ceil((window.sdamact.getValue()-2)/3) - math.ceil((window.pdamact.getValue()-2)/3);
window.woundmodifier.setValue(temp);
end
</script>
</standardsm>
Is there something else I can use instead of onInit()?
Zak