open-campaign-logger / generator-library

This repository contains the generator library files for https://campaign-logger.com/generator which can be referenced like this: "{lib:adjColor}".
Apache License 2.0
31 stars 13 forks source link

Non-repeating table calls #17

Open evesala opened 6 years ago

evesala commented 6 years ago

Often it would be good to be able to avoid results like this:

In his pockets are a button, a button and a button.

This could be avoided by the ability to specify a table call to be non-repeating, i.e. the 'dice rolls' on a table are remembered for the duration the resultPattern parsing, and any repeated results are rerolled.

Regarding the potential syntax, in TableSmith (if my memory serves) this is designated by adding an exclamation mark in front of the table call, and TableRunner uses a minus sign after the call ( http://dxcontent.com/TRHelp.html ) . So no established standards here...

hkokko commented 6 years ago

This would indeed be good...

JochenLinnemann commented 6 years ago

I like the exclamation mark.

JochenLinnemann commented 6 years ago

Using {!table} now selects a result from table by removing it from the unique instance of that table, i.e. {table} might produce this same result, but {!table} won't.

Technically {table} references the normal instance of the table while {!table} references the unique instance. The normal instance's entries stay as they are. The unique instance's entries get fewer and fewer until depleted.

Unique instances share the same variables and globals with normal instances, just entries are handled differently. Unique instances have the same scope as variables, i.e. strictly local.

evesala commented 6 years ago

Most! Excellent! Cheers!