"BONUS:VAR|foo|var("BL=Class")" fails to add a value to foo, if any variable in the formula has a double underscore "__"

Description

This may be a moot point, but

BONUS:CASTERLEVEL|Wizard|SomeVar-var("BL=Wizard") completely nukes SomeVar to where the value is 0.

Aggravating to say the least... I can work around the issue, but it makes for another var for each class I'm supporting.

Environment

None

Activity

Show:
Andrew Maitland
May 26, 2015, 12:49 AM

Scratch that... it is inconsistent. Apparently ANY underscore in the variable name trying to grab a BL=x can cause an issue.

James Dempsey
May 26, 2015, 1:01 AM

Could you provide a concrete example that reliably demonstrates the problem please?

Andrew Maitland
May 26, 2015, 2:53 AM

Reproduction is sketchy currently.

This code is working:

However, this code had issues:

This was built with a Level 2 Wizard, Level 2 Cleric, Level 1 Mystic Theurge and inventory item equipped "Ioun Stone Orange"
That gave me a value of 4 total, a BL stripped total of 3.

WizardLVL=2
Caster_Level_Bonus=1
Caster_Level_BL_Wizard =1
Caster_Level_Wizard=4
Caster_Level_BL_Stripped_Wizard =3 (Will display 0)

What would happen is Caster_Level_BL_Wizard would be 0 or Caster_Level_Wizard would be 0. Very inconsistent.

I grabbed this from the higher log setting:

Andrew Maitland
May 26, 2015, 3:07 AM

James, there is definitely something that seems to be order dependent breaking. I tried the "working" version, and it was broken. The only factor I can find is the BL=XXX factor. It is a daisy chained variable to account for issues.

Caster_Level_Classname is derived from ClassLVL+Caster_Level_Bonus+CasterLevelBLClassname

Caster_Level_BL_Stripped_Classname is Caster_Level_Classname-CasterLevelBLClassname

CasterLevelBLClassname is from the var("BL=Classname")

Oddly, BL=Classname always displays the correct result. One of the subsequent vars does not attach the correct value though.

I have to both ADD and REMOVE the BL=Classname to get correct results. I add it to the Caster_Level_Classname to get a correct Value for the total caster level Arcane and highest caster level. I remove it from Cast_Level_BL_Stripped to avoid an incorrect value added by the BL via ADD:SPELLCASTER choice.

James Dempsey
June 2, 2015, 4:28 AM

Sorry, there is no quick fix for this in the code that I can see. A suggestion is to replace VAR("BL=WIZARD") with charbonusto("PCLEVEL", "WIZARD") which may break the dependency cycle that the code is reporting.

Also, you may find it more readable to rename Caster_Level_BL_Wizard to something like WixzardBonusLevel or BonusLevelWizard to make it distinct from the host of casterlevel variables. Also, my personal preference for readability is to use camel case variables rather than having embedded underscores.

Cancelled

Assignee

Unassigned

Reporter

Andrew Maitland

Labels

None

Theme

None

Epic/Theme

None

Pending User Input

No

Components

Affects versions

Priority

Minor
Configure