Doswelk
June 14th, 2007, 14:09
I am still trying to get my head round how FGII works....
I am trying to calculate the fortitude defence value, below are the numbercontrols I am using:
<numbercontrol name="fortdefense" source="defense.fortitude.total">
<numbercontrol name="fortlvlarmor">
<numbercontrol name="fortclassbonus" source="defense.fortitude.classbonus">
<linkednumber name="fortstatbonus" source="abilities.constitution.bonus">
<numbercontrol name="fortmisc" source="defense.fortitude.misc">
Basically I need to set fortdefense to equal
10 + fortlvlarmor + fortclassbonus + fortstatbonus + fortmisc
I had a <script> entry similar to this:
function onInit()
addSourceWithOp("fortlvlarmor", "+");
addSourceWithOp("fortclassbonus", "+");
addSourceWithOp("fortstatbonus", "+");
addSourceWithOp("fortmisc", "+");
end
And it worked but I couldn't work out how to add 10 to that, also if one of the number changed it did not update.
I suspect that fortdefense needs to be a linked number and I need to somehow have a SourceUpdate event as well.
Any help would be appreciated....
On another note what would be nice (IMHO) would be a scripting forum to allow people to post useful scripts.
I am trying to calculate the fortitude defence value, below are the numbercontrols I am using:
<numbercontrol name="fortdefense" source="defense.fortitude.total">
<numbercontrol name="fortlvlarmor">
<numbercontrol name="fortclassbonus" source="defense.fortitude.classbonus">
<linkednumber name="fortstatbonus" source="abilities.constitution.bonus">
<numbercontrol name="fortmisc" source="defense.fortitude.misc">
Basically I need to set fortdefense to equal
10 + fortlvlarmor + fortclassbonus + fortstatbonus + fortmisc
I had a <script> entry similar to this:
function onInit()
addSourceWithOp("fortlvlarmor", "+");
addSourceWithOp("fortclassbonus", "+");
addSourceWithOp("fortstatbonus", "+");
addSourceWithOp("fortmisc", "+");
end
And it worked but I couldn't work out how to add 10 to that, also if one of the number changed it did not update.
I suspect that fortdefense needs to be a linked number and I need to somehow have a SourceUpdate event as well.
Any help would be appreciated....
On another note what would be nice (IMHO) would be a scripting forum to allow people to post useful scripts.