Kelendor
January 17th, 2015, 04:24
Here is the challenge I'm currently working on:
I'm trying to understand how FG adds all the various bonuses on the character sheet.
I have two goals I am working towards: I'd like to add a level/2 bonus to skills like 4th edition does and have a trained check box (once ticked) add +5 to a skill. I have the checkbox and the tool tip already done, but I can't seem to find where the math for total skill bonus is calculated.
This is from 4th edition record_char_main.xml:
<number_linked name="levelbonus">
<anchored to="level" position="righthigh" offset="50,0" width="32" height="20" />
<displaysign />
<readonly />
<frame name="fieldlight" offset="7,5,7,5" />
<source>
<name>level</name>
<op>+</op>
</source>
<script>
function onSourceUpdate()
setValue(math.floor(calculateSources() / 2));
end
</script>
</number_linked>
And this is from record_char_skills.xml
<simplenumber name="level" source="...levelbonus">
<anchored width="32" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<displaysign />
<hideonvalue>0</hideonvalue>
<disabled />
</simplenumber>
<number_charskillfield_static name="stat">
<anchored width="32" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<script>
function update(statname)
setValue(DB.getValue(window.getDatabaseNode(), "...abilities." .. statname .. ".bonus", 0));
end
</script>
As can be seen in BOLD these are the only things I can find for calculations but they seem arcane. No comments anywhere. I don't see a definition of "floor" or of "bonus" and thus can't really try to edit them.
I've even pasted those lines into the appropriate files but was not successful.
In d20 modern record_char_skills.xml there is a similar line:
<number_charskillfield_static name="stat">
<anchored width="32" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<script>
function update(statname)
setValue(DB.getValue(window.getDatabaseNode(), "...abilities." .. statname .. ".bonus", 0));
end
</script>
</number_charskillfield_static>
but again I have no definition of "bonus" and thus can't figure out how to add a piece to that. That is if that is actually the line that adds up the skill total to begin with.
As mentioned earlier I have a check box implemented "trained" (+5) and would like to add half the level of the character as a bonus.
It's already seems to be tracked as "level" on the main tab of the character sheet (record_char_main.xml)
I also checked under scripts: char_totalwithability.lua, char_skill.lua, char_skilllist.lua
for k, v in ipairs(aAbility) do
local nAbilityBonus = ActorManager2.getAbilityBonus(rActor, getAbility(k));
if k == 1 and nMaxMod and nMaxMod >= 0 then
if nAbilityBonus > nMaxMod then
nAbilityBonus = nMaxMod;
end
end
nBonus = nBonus + nAbilityBonus;
end
In Bold - I tried doing a straight +5 or plus anything but nothing changed it. Even setting it to a number with no other additions didn't change it.
Any help would be appreciated.
thanks.
I'm trying to understand how FG adds all the various bonuses on the character sheet.
I have two goals I am working towards: I'd like to add a level/2 bonus to skills like 4th edition does and have a trained check box (once ticked) add +5 to a skill. I have the checkbox and the tool tip already done, but I can't seem to find where the math for total skill bonus is calculated.
This is from 4th edition record_char_main.xml:
<number_linked name="levelbonus">
<anchored to="level" position="righthigh" offset="50,0" width="32" height="20" />
<displaysign />
<readonly />
<frame name="fieldlight" offset="7,5,7,5" />
<source>
<name>level</name>
<op>+</op>
</source>
<script>
function onSourceUpdate()
setValue(math.floor(calculateSources() / 2));
end
</script>
</number_linked>
And this is from record_char_skills.xml
<simplenumber name="level" source="...levelbonus">
<anchored width="32" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<displaysign />
<hideonvalue>0</hideonvalue>
<disabled />
</simplenumber>
<number_charskillfield_static name="stat">
<anchored width="32" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<script>
function update(statname)
setValue(DB.getValue(window.getDatabaseNode(), "...abilities." .. statname .. ".bonus", 0));
end
</script>
As can be seen in BOLD these are the only things I can find for calculations but they seem arcane. No comments anywhere. I don't see a definition of "floor" or of "bonus" and thus can't really try to edit them.
I've even pasted those lines into the appropriate files but was not successful.
In d20 modern record_char_skills.xml there is a similar line:
<number_charskillfield_static name="stat">
<anchored width="32" height="20">
<top offset="2" />
<right parent="rightanchor" anchor="left" relation="relative" offset="-5" />
</anchored>
<script>
function update(statname)
setValue(DB.getValue(window.getDatabaseNode(), "...abilities." .. statname .. ".bonus", 0));
end
</script>
</number_charskillfield_static>
but again I have no definition of "bonus" and thus can't figure out how to add a piece to that. That is if that is actually the line that adds up the skill total to begin with.
As mentioned earlier I have a check box implemented "trained" (+5) and would like to add half the level of the character as a bonus.
It's already seems to be tracked as "level" on the main tab of the character sheet (record_char_main.xml)
I also checked under scripts: char_totalwithability.lua, char_skill.lua, char_skilllist.lua
for k, v in ipairs(aAbility) do
local nAbilityBonus = ActorManager2.getAbilityBonus(rActor, getAbility(k));
if k == 1 and nMaxMod and nMaxMod >= 0 then
if nAbilityBonus > nMaxMod then
nAbilityBonus = nMaxMod;
end
end
nBonus = nBonus + nAbilityBonus;
end
In Bold - I tried doing a straight +5 or plus anything but nothing changed it. Even setting it to a number with no other additions didn't change it.
Any help would be appreciated.
thanks.