Calculation doesn't work then does work

Here's a weird one.

Working on the character generator and it seems to be working out well. Then, for reasons unknown, it decides to stop calculating one set of skills. The odd thing about this is that the skill calculation is used in two separate spots. This specific calculation is as follows:

[#2 SkillList] {TotalSkill={!{$OCCBaseLevel}+{$IQSkillBonus}+0+{$OCCPerLevel}*{$MercOCCLevel}}}%

The first table SkillList successfully pulls the skill name to be calculated. The variables in the calculation (OCCBaseLevel, OCCPerLevel) are successfully pulled along with the skill name. MercOCCLevel is previously defined and is working normally. The IQSkillBonus is pulled from a different table further up in the process, so the value should already be in the variable.

I've been able to track down to a point where it appears that the IQSkillBonus does not contain a value, essentially it's blank, not even zero, so the calculation is not producing a value.

The fun part is that I use the exact same formula two lines down from where the first use of it is done, and the calculation works. The IQSkillBonus field is populated with a non-blank value, even if zero.

The IQSkillBonus value is generated separate from the skills calcs values. It is calculated only once as well and it is done well before the skills calculations begin. Logically the variables should not change, so the question is why would the value not appear in the first use of calculation, but would appear in the second use of the calculation. The variable is defined the same in both calculations - no changes from upper to lower case or vice versa, no spaces or anything else.

Comments

  • Its hard to say without seeing the generator's code. But it sounds like you're on the right track if that one variable is ending up empty.

Leave a Comment