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

Extracting Macros efficiency

I'm new with Roll20 community and I still can't get along with macros. I want to create a macro where the variables are two players, but the data I want to get from them is previously fixed. It's something like this:  [(Attack - Defense) - @{PJ2|Armor}] * @{PJ1|Damage} Where the variables I want to fill are PJ2 y PJ1 so the macro could fetch me the Armor and damage from two different players that are engaged in battle. I need help with something like that, it would make the battles way faster than they already are.
1366662419
Gauss
Forum Champion
What are the values for attack and defense?  Assuming Attack is a die roll and defense is a static number you can do this: /roll (1d20-15-@{PJ2|Armor})*@{PJ1|Damage} Assuming both Attack and Defense are static (thus, there is not a die roll) you will need to add a die roll like this: /roll 0d1+(20-15-@{PJ2|Armor})*@{PJ1|Damage} - Gauss
Attack and Defense in that formula are rolled variables like [(1d100! + X - 1d100!) - @{PJ2|Armor}] * @{PJ1|Damage} where X is a number that I shall provide like any other variable.
You can't fill-in "variables" at run-time in macros. All variables have to be pre-defined. So you can't do for example /roll attack George John And have it fill in "George" for PJ2 and "John" for PJ1. You would have to create the macro knowing in advance that those were the two players.
Ok, thanks!
1366673798
Gauss
Forum Champion
Via a workaround there is a way to use fill-in variables. Name an attribute "X" with the numerator being some value, then have the GM assign that attribute to a token bubble. Change the bubble and you change the attribute. Some people go so far as to create a 'variable token' for multiple players to use.  - Gauss
Cool idea Gauss! Thanks!
Thanks! I'll see if I can get it done!
1366675248
Gauss
Forum Champion
Yup, you can do a number of variables this way.  - Gauss
1366991330
GiGs
Pro
Sheet Author
API Scripter
I'm new to Roll20 looking for ways to get the best out of it.  Gauss, can you explain how that fill-in variable method works in more detail? 
what would be helpful is adding more features to the tokens like AC, stats and saves ect. with that part of the macro would be able to target a token after activating a macro, then it would go based off the stat sets in the macro. Ex. Shava attacks with sly flourish which is 1d20+Dex (+x) after activating the macro Shava clicks on the target and it adds her roll vs the targets AC then the basic "if / then" of attack > AC = roll damage, then subtract damage total from specified effect IE. hit points.
1367023059
Gauss
Forum Champion
MeMeMe,  1) Create a Character sheet and name it (for this purpose I will name it 'Test') 2) Set up an Attribute in the character sheet (for this purpose I will name it 'Var'). 3) Save the character sheet.  4) Create a token and edit it.  5) In the 'Represents Character' dropdown menu select the Character sheet ('Test') you just created. 6) Link one of the bars (lets use Bar 1) to the Attribute ('Var') in the character sheet (use the dropdown menu on the right side of the bar). 7) Save the token. 8) Make a macro (you can use either the Macro system found in the settings or the Character sheet Abilities found in the character sheet you just edited. For a variable number of d10 dice the Macro should read: /roll @{Test|Var}d10. For a Character Sheet Ability put /roll @Var d10 and then delete the space between Var and d10.  9) Click save and test.  10) Place the macro in your macro bar. 11) To change the variable, click on the corresponding bubble (Bar 1) and change the value. 12) Hit the macro and it will roll the number of d10's you wanted it to roll. - Gauss
Gauss,  Question, about 8, 1) If you use Macro system found in the settings, it works and turns to /roll Test: Vard10  with the Test: Var part in light blue. 2) In the Character sheet Abilities, if you place  /roll @{Test|Var}d10 , the macro fails, showing (There was an error with your formula. Please try again.) and turns to /roll Test|Vard10 with the Test|Var part in light blue. As I am a Supporter could the 2nd one be something to do with not being on the Dev listings?
1367042845
Gauss
Forum Champion
Sorry, I forgot that it puts Test ahead of the attribute in the cast of character sheets which results in an error. I have fixed that element above.  So for character sheets just type: /roll @Var d10 and then delete the space between the Var and d10. - Gauss
1367089065
GiGs
Pro
Sheet Author
API Scripter
Thanks Gauss. That bit about deleting the space probably fixes a problem I was having. I couldn't get variable number of dice to work.
ok so then how do i set it up to roll for the following effect? so far the macro i got set up reads as follow. #LanceOfFaith /r 1d20@Adrik:Wis@Adrik:Symbol Of Life the roll then goes 1d20 (12) +5+1= 18 now setting it up to get it to do the macro vs the targets Reflex.  if the roll (18) > (targets Reflex) then /r 1d8 @Adrik: Wis {1d8+5} and then get it to subtract that from the targets health. this would help battle progression go a lot faster and smoother so that my players can enjoy more role playing and less figuring out battle mechanics figuring out if they hit then rolling the damage and then me adjusting the current hp
If I understand you right, you want to make the roll, have it automatically check against a target token's reflex, and automatically subtract from the target token's health if it succeeds?  I'm afraid Roll20 doesn't offer that kind of automation currently.  You can't do if/then types of statements.   It might be possible to set up the macro to refer to a variable on a token the DM controls, though.  You could assign an attribute to the bubble of a generic token, allowing you to just change the bubble's value to whatever the target number is (AC/Reflex/Will/Etc.).  You could then, maybe, make the roll something like /r 1d20+@Adrik:Wis+@Adrik:Symbol-Of-Life>@GenericToken:Var1 I'm sure I've actually got my syntax all wrong for that, but hopefully the idea comes across.  That way, if the roll is greater than or equal to @GenericToken:Var1, it will say it's a success.  You'd still have to roll the damage, though that could be part of the macro too, and subtract the damage manually, but it might be helpful for the players to see whether they hit or not.  On the down side, it means the DM has to constantly change the value of the GenericToken's bubbles... So it's a bit of a trade off.   To warn you, I haven't actually tried this tactic myself.  It's just an idea.
Thanks to everyone, to eliminate the problem now I gave every player a Macro for attack/defense, then I use those values for the final damage with another macro that I'll run. The problem with Anima's system is that the finals rolls of attack/defense need to be limited to 280 so id better if I run all those numbers apart. The final calculation goes like /r 1d1*(Attack-Def-Armor*10)/100 where the resulting number is deducted from the tokens life. The /r 1d1 it's just to force the math in the chat bar.
1367183048
Gauss
Forum Champion
You can also use /roll 0d1+ to force the math :) - Gauss