(Pathfinder) I've been trying to simplify my updating and adding of abilities and attacks by turning common portions of rolls into macros and inserting them into ability rolls. Essentially what I have been doing (and what I want to get away from) is to have a bunch of attributes which in reality are multiples of some existing attribute and having to track those with specific ability values. An example of this is a calculation of 1/2 Str or Str*1.5. What I have now forces me to manually update all of these when I level up, rather than simply updating the base attribute or base modifier calculation, which takes forever and results (occasionally) in missed opportunities. I've compounded the problem a bit by transforming my rolls to being based on character sheet attributes. For instance, for a rolling a particular damage calculation I'm currently doing something like this: @damage-ability = [[#Dmg-dice + @{character|Str-mod*1.5} +@{character|miscmod} +@{character|Pwr-dmg-mod} + @{character|Str-mod/2} ]] And I'm trying to link it directly to the abilities in my character sheet so when I change the values in the str-mod calculation everything just works. @damage-ability = [[#Dmg-dice + @{character|Str-mod} + (floor(@{character|Str-mod}/2))) +@{character|miscmod} +@{character|Pwr-dmg-mod} + (floor(@{character|Str-mod}/2)) ]] This expands out to something ridiculous, as Str-mod itself expands into the entire (floor) calculation of it's components. I'd really like to nest my macros even further, for readability, IE #Dmg-Dice = [[1d10]] #Dmg-Str-Base = [[ @{Character|Str-Mod} +@{Character|MiscMod} + @{Character|Pwr-dmg-mod} + (floor(@{character|Str-mod}/2)) ]] @Dmg-Ability = [[#dmg-dice + #Dmg-str-base]] @Dmg-Ability-plus-onepointfive = [[#dmg-dice + #dmg-str-base + (floor(@{character|Str-mod}/2))) ]] because for the most part the computations I'd be macroing away would be calculations of more-or-less static values. Then when I change parts of the Str attribute, it changes the modifiers and everything is factored in properly. When I actually try to execute this sort of thing though, i get results like this: Could not determine result type of:
[{"type":"M","expr":"0+(floor(((21+2+0+0))/2)-5)"},{"type":"C","text":" +
(Floor((floor(((21 + 2 + 0 + 0)) / 2) - 5)/2)) + -2"}] Or worse some value where the math is totally out because it just stops calculating the values at some point, dropping the remainder of the math. The second ability macro above is a great example of this: When I run it I get some result like 1d10+6 when it should really be 1d10+16 as it only bothers to parse the first str-mod calculation and then basically gives up on the rest. (str-mod should be 6 currently, str-mod/2 =3 which we're adding in twice (once for the 1.5 calculation, and once for an additional 1/2 str-mod) and the power-attack bonus should be 4). From what I can tell, you can only include a single # macro per line? and a single(floor(floor)) ? I'm really trying to answer this stuff myself, but the macro documentation on the wiki only goes so far. Am I stuck building a bunch more attributes I'll have to constantly update? Or is there a better way of doing this?