Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Random quantity of random rolls?

edited February 2014
Hi folks,

I've been playing around with Inspiration Pad, and so far it's great! But I've come across something that seems like it should be easy, and I can't figure it out.

I want to generate an encounter of creatures (say, rats in this example) and to keep the return values succinct I want to get the results as close to one line as I can. Something like this:

6 rats. AC 6, HD 0.5, HP 3, 4, 3, 3, 1, 2.

The syntax I've attempted is along these lines:

[roll={1d6}] rats. AC 6, HD 0.5, HP [@roll {1d6} >> implode].

..but the [@ ] syntax is pretty clearly looking for a table, so I'm getting errors. Am I missing something?

• First solution that came to me was to "give it a table", so, let's try:
```Table: RatEncounter
&#91;roll={1d6}&#93; rats. AC 6, HD 0.5, HP &#91;@{roll} RatHP &gt;&gt; implode&#93;.

Table: RatHP
{1d6}
```
That's the only way I figured out. If anyone knows a way to handle is without additional table, please share.

Also, a small [when] statement can be useful
```&#91;when&#93;{roll}==1&#91;do&#93;rat&#91;else&#93;rats&#91;end&#93;
```
It can be closed in magic table and used like that:
```Table: RatEncounter
&#91;roll={1d6}&#93; rat&#91;@s with {roll}&#93;. AC 6, HD 0.5, HP &#91;@{roll} RatHP &gt;&gt; implode&#93;.

Table: RatHP
{1d6}

Table: s
&#91;when not&#93;{\$1}=1&#91;do&#93;s&#91;end&#93;
```
Surly doesn't solve all problems (like with "wolf" and "wolves") but may be helpful.

Good luck
• Thanks for the response, Warenhari. I finally hit upon a solution that looks quite a bit like yours. As you say, the second bit needs to be a table. So I created "Roller":
```Table: RatEncounter
&#91;qty={1d6}&#93; rats. AC 6, HD 0.5, HP &#91;@{qty} Roller with 1, 4 &gt;&gt; implode&#93;

Table: Roller
{{\$1}d{\$2}}
```

I later modified Roller to handle the possibility of super rats (1d4+2 hp):
```Table: RatEncounter
&#91;qty={1d6}&#93; rats. AC 6, HD 0.5, HP &#91;@{qty} Roller with 1, 4, 2 &gt;&gt; implode&#93;

Table: Roller
Set: bonus=&#91;when&#93;{\$3}&gt;0&#91;do&#93;{\$3}&#91;else&#93;0&#91;end&#93;    // If the third parameter is excluded, {bonus} gets set to zero.
{{\$1}d{\$2}+{bonus}}
```

Having a table for dice rolls isn't pretty, but this is the cleanest solution I've found.

p.s. Plural/singular solutions are never satisfactory or complete, so I've resigned myself to just ignoring the occasional "1 rats".