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 .
×

Macro newbie needs help :(

Hello together, I'm playing MajiMonsters with some newbies and since they have some problems calculating their damage I wanted to write up some macros for them to use. Since I'm not very involved into any kind of programming, I've encountered two difficulties I can't quite figure out: 1. I want a simple 2d6 + character's attribute (in this case 'Magic') + a situationally changeable modifier compared to the enemies discipline score, so i went this way: #Attack /em : @{selected|character_name} attacks @{target|character_name}: /r {2d6 +@{selected|magic} +?{Modifier|0}}>@{target|discipline} Since the querry ends at the first closing bracket, I replaced the ones inside the querry with html entities, but everything I get in return is: No attribute was found for @{selected|magic} +?{Modifikator|0}} 2. Okay, here is the big one. Since damage calculation in MajiMonsters factors in a lot of variables, I decided to try a mainly simple choice driven approach (I've inserted a break before every new modifier for clarity: /r ?{Critical?|Yes,1|No,2[Crit!]}d?{Die Type} +?{Empowered|No,0|Yes,@{selected|grade}d6} +?{Technique Bonus|Brawn,@{selected|brawn&#125|Talent,@{selected&#124talent&#125|None,0} +?{Affinity Bonus|Yes,[[@{selected&#124grade&#125*2]]|No,0} +?{Enemy Vulnerable|No,0|Yes,[[@{selected&#124grade&#125*2]]} Here I get following response: TypeError: d is undefined I'm very sorry if these questions are pretty dumb, actually these are the first 'complex' macros I'm making, apart from typical 'roll NdX+Y' macros. Thank you for your help and patience ;)
1481827493

Edited 1481827521
Both of your macros worked for me without the need for HTML equivalents. As far as I know, HTML equivalents are only needed inside a macro when it is called from another macro inside a ?{} query. Also, when using HTML equivalents, don't forget the ';' at the end. These are the macros that worked for me: /r {2d6 +@{selected|magic} +?{Modifier|0}}>@{target|discipline} /r ?{Critical?|Yes,1|No,2[Crit!]}d?{Die Type}+?{Empowered|No,0|Yes,@{selected|grade}d6}+?{Technique Bonus|Brawn,@{selected|brawn}|Talent,@{selected|talent}|None,0} +?{Affinity Bonus|Yes,[[@{selected|grade}*2]]|No,0}+?{Enemy Vulnerable|No,0|Yes,[[@{selected|grade}*2]]}
Well, now I feel very stupid ;) Thank you very much! The damage works perfectly now, but there's still something odd with the attack check: The roll is resolved correctly and everything is nicely added together, as it should be, but it always claims there were no successes. It looks like this: rolling {2d6 +2 +0}>10 {(6+6)+2+0} = 0 Successes
Julian H. said: Well, now I feel very stupid ;) Thank you very much! The damage works perfectly now, but there's still something odd with the attack check: The roll is resolved correctly and everything is nicely added together, as it should be, but it always claims there were no successes. It looks like this: rolling {2d6 +2 +0}>10 {(6+6)+2+0} = 0 Successes Ok, so what your calculation is doing is comparing each roll + the modifiers against the target number. In your example it is doing {(6) + 2 + 0} > 10 twice. Since 8 < 10, there is no success.  If you want to do the sum of the two rolls with the modifiers, you will need to utilize  Conditional Statements (Math Only) to change your roll to the following /r {[[2d6]]+@{selected|magic}+?{Modifier|0},0}>@{selected|discipline}
2[Crit!]d6 won't work; I recommend [Crit!] 2d6 instead. i.e. ?{Critical?|No, 1|Yes, [Crit!] 2}d?{Die Type}
Thank you very much, both of you :) I fixed everything... One last question: Is it possible, that Roll to Initiative only works, when the GM is rolling? I made a macro for that too, that looks like this: /em : @{selected|character_name} rolls for initiative: /r 2d6+@{selected|speed}+?{Modifier|0} &{tracker} When I try it on any token, it works just fine, but if my player (the one that is online right now) tries it, it neither displays the emote, nor does it add a turn to the counter or updates it.
1481832805

Edited 1481832908
Make sure that they're selecting a Token that Represents a Character as well as Submitting the Roll Query.
1481832829
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Roll to inititiative works for all, but make sure they have a token selected for it.
She selected a token and used the button for token actions... we tried it with different tokens, but it doesn't work.
Can you verify that the Token being selected Represents a Character ? Can you also verify that your player is submitting the Roll Query that pops up? Furthermore, what does the chat output (e.g. exact error messages) when this occurs?
1481835797

Edited 1481835822
The token definitely represents a character, I used it myself to test the initiative macro and it worked. And yes, she submits the roll query. The chat output is the plain processing of the roll command. Here she used it 4 times in a row: Agnes: rolling 2d6+6 (5+1)+6 = 12 rolling 2d6+6 (3+2)+6 = 11 rolling 2d6+6 (1+5)+6 = 12 rolling 2d6+6 (3+2)+6 = 11 But it should look like this: (GM) : Lycanne [Agnes] rolls for Initiative: 10:01PM (GM): rolling 2d6+6+0 (2+4)+6+0 = 12
Julian H. said: Agnes: rolling 2d6+6 (GM): rolling 2d6+6 +0 It looks like you're using two different macros. Double check that she is not using a macro from a different source.
Okay, so now I found out, she indeed wrote her own macro, with exactly the same name. That explains that the wrong macro was used. Thanks everybody for your help, I'm happy now :D