#Simple syntax question

1 messages · Page 1 of 1 (latest)

random grove
#

Okay this is probably stupid simple and I could figure it out by trial and error over time, but looking at the "Intro to Macro Writing" did not apparently tell me all I needed here, as I'd guess I'm missing a step or other syntactical issue.

I'm trying to set up a simple set of macros to roll multiple dice of the same type; this doesn't look like it needs to mess with loops or anything, but what it appears should probably do it, well, doesn't. I tried simply [r: N D20] (with or without the space) and while it asks you for the value of N, it just outputs it instead of following the dice expression. I note that there's a comment in the dice expressions that the macro is "roll()" but I'm not clear how that's applied here.

Could someone enlighten an old man here?

wary gate
#

[eval(N+"d20")]

#

It knows how to evaluate a string with an actual number before the d, but you have to construct that string

#

eval() takes a string and evaluates it as if it were a macro. And once a value is assigned to N, it concatenates with "d20" to make an evaluable string

normal roost
#

There are many ways to do this, but using input() in some way is the best practice.

[H: abort(input("N|1,2,3,4|Roll D20s|radio|value=string"))]
[R: roll(N,20)]
random grove
random grove
wary gate
#

Yeah either way, whether you use roll or eval, I recommend using input rather than just an unassigned variable

random grove
#

Got it. Since I sometimes work better with examples than just explanation, I'm putting away both yours for later, since I kind of plan to use dice macros from here on out, and want to teach myself how to do them.

#

Though I'm questioning whether its actually worth the steps needed to do macros that do multiple distinct dice in one (i.e. that will handle things like "roll 2D6+1D8+1D10+4); currently I'm setting up for 13th Age which doesn't mix dice in one roll very often, and often do games that are "roll a die pool" resolution so not needed, but if I run Pathfinder down the line its a question.

wary gate
#

In my Pathfinder framework, I just have individual macros for all the things you can do, and each one calculates the appropriate dice. If you need something nice and easy, you can just have your players type [2d6] or whatever into the chat

#

Generally I've found, in whatever system, the players end up needing the same specific dice sets over and over

#

So figuring out what those are and macroing them up is all you need to do

random grove
#

Yeah, I suppose at least in some cases, custom macros will get the job done too. I kind of don't want them to have to do things like the example I gave manually, and sometimes there's a lot of modifiers that can come up only some of the time in some games.
I'm still trying to make up my mind if I want to actually bother to have the macro bake in the ability to do modifiers (i.e. +/- modifiers) or just have people do that manually; its not that painful to add or subtract one digit numbers after all.

wary gate
#

Sure but it's also easy to put that into an input box