Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Macro Variable Syntax Question

So I'm a bit new to writing macros for Roll20 and I have a question concerning using multiple Repeating Resource values in mathematical expressions with each other. What I'm attempting to do is write macros to handle exploration on ships for my upcoming pirate-themed DnD 5e campaign and I'm a bit stuck on this one for calculating Ration Consumption. Here's the macro: !power {{ --name|Ration Consumption --inlinereplace|Rations|@{repeating_resource_$4_resource_right} --inlinereplace|Crew|@{repeating_resource_$3_resource_left} --inlinereplace|Passengers|@{repeating_resource_$6_resource_left} --?? {Select Action|Full Rations,FullRations|Half Rations,HalfRations} == FullRations ?? skipTo*1|FullRations --?? {Select Action|Full Rations,FullRations|Half Rations,HalfRations} == HalfRations ?? skipTo*2|HalfRations --:FullRations| --Total People| [[ [$People] @{repeating_resource_$3_resource_left} + @{repeating_resource_$6_resource_left} ]] --Ration Total| [[ [[ [$Rations] @{repeating_resource_$4_resource_right} - $People ]] --api_setattr*1|_silent _charid @{character_id} _repeating_resource_$4_resource_right|[^Rations] --skipTo*3|EndOfCard --:HalfRations| --Total People *2| [[ [$People] @{repeating_resource_$3_resource_left} + @{repeating_resource_$6_resource_left} ]] --Ration Total *2| [[ [$Rations] @{repeating_resource_$4_resource_right} - ^People.halftotal ]] --api_setattr*2|_silent _charid @{character_id} _repeating_resource_$4_resource_right|[^Rations] --:EndOfCard| }} The error I'm getting is:  Could not determine result type of: [{"type":"L","text":"$People"},{"type":"M","expr":"40+10"}] I will admit that I'm not familiar with the syntax usage for [^Variable] vs [$Variable] and I imagine that probably is the underlying issue. Either way, any help would be much appreciated, thanks!
Oh, I should be clear: the reason that my inlinereplaced values don't show up in the macro is since I tried using them in the formulas first and I was getting an error: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "~" found. So I swapped them out for the direct references. At this point they're more akin to a comment than anything.