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

Variables in macros?

Is there any plan to incorporate the use of variables? I see a lot of posts saying you can't reference a roll within a macro i.e. vampiric touch healing half the dmg done. In theory dmg1=[[3d6]] sets the dmg1 variable to whatever the dice rolls result in, should you not be able to call in dmg2 something like dmg2=[[(dmg1)/2]] to get the appropriate calculation? Just curious because I know the API can do this stuff but standard variable calling being something you can't do just seems like an oversight to me. @{Manshune|wtype}&{template:atkdmg} {{mod=-}} {{rname=Vampiric Touch}} {{r1=[[0d20cs>20]]}} {{r2=[[0d20cs>20]]}} 0 {{range=Self}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[3d6]]}} {{dmg1type=Necrotic }} {{damage=1}} {{dmg2flag=1}} {{dmg2=[[3d6]]}} {{dmg2type=Healing }} {{crit1=[[3d6[CRIT]]]}} {{crit2=[[3d6[CRIT]]]}} 0 {{desc=}}   {{spelllevel=3}} {{innate=}} {{globalattack=@{Manshune|global_attack_mod}}} {{globaldamage=[[0]]}} {{globaldamagecrit=[[0]]}} {{globaldamagetype=@{Manshune|global_damage_mod_type}}} ammo= @{Manshune|charname_output}
Unfortunately that falls into the "can't re-use roll results" category. The API could certainly handle this, but not a macro by itself. You can reuse queries (?{}) within a macro and so you can define them as variables, but not inline expressions like you are hoping.