I'm using the 5th Edition OGL Character sheet. What I'd like to do is use ChatSetAttr to compare the attributes of an NPC to the corresponding attributes of a named PC character and potentially make changes to the NPC's attributes based on the results. I'm not sure if what I'm attempting is beyond the scope of the evaluate function (given the very different potential contents of the attributes involved) or if I'm simply not getting the syntax right. For the specific use example below, the starting values of the attributes are: For NPC: pb_custom = 2 npc_str_save_flag = 0 npc_con_save_flag = 0 For Snow White: pb = 3 strength_save_prof = 0 con_save_prof = (@{pb}) which evaluates to (3) in chat results When I try this: !setattr {{ --sel --evaluate --pb_custom| (%pb_custom% < @{Snow White|pb}) ? @{Snow White|pb} : %pb_custom% --npc_str_save_flag| (@{Snow White|strength_save_prof} > 0) ? 1 : %npc_str_save_flag% --npc_con_save_flag| (@{Snow White|constitution_save_prof} > 0) ? 1 : %npc_con_save_flag% }} It works for the proficiency bonus part: Setting attributes Setting pb_custom to 3 for character Copy of Animal Testing. However it doesn't work for the others, giving these errors: Errors Something
went wrong with --evaluate for the character Copy of Animal Testing.
You were warned. The error message was: SyntaxError: Unexpected end of
input. Attribute npc_con_save_flag left unchanged. Something went
wrong with --evaluate for the character Copy of Animal Testing. You were
warned. The error message was: SyntaxError: Unexpected end of input.
Attribute npc_str_save_flag left unchanged. I get the same error even if I manually change the con_save_prof attribute to a plain 3. I also get it when trying different comparison operators such as: !setattr {{ --sel --evaluate --pb_custom| (%pb_custom% < @{Snow White|pb}) ? @{Snow White|pb} : %pb_custom% --npc_str_save_flag| (@{Snow White|strength_save_prof} !== 0) ? 1 : %npc_str_save_flag% --npc_con_save_flag| (@{Snow White|constitution_save_prof} !== 0) ? 1 : %npc_con_save_flag% }} Can anyone point out where I'm making mistakes and a solution that might work?