It looks like you're new here. If you want to get involved, click one of these buttons!
Set: var = 0 // declare a global variable for the number of times to make the deck pick
// makes 15 rolls on the table that makes the deck picks
Table: main
[@15 deck_pick_call]
// this table calculates the number of adjectives, then makes variable number deck picks
Table: deck_pick_call
Set: var = 0 // intended to reset the variable, may be redundant
shuffle: subtable // seems to be the correct usage but I cant tell since the deck picks aren't working
Type: Lookup
Roll: 1d100
1-50: [@calculate][when] {$var} > 0 [do][!{$var} deck >> sort >> implode]; [end]Antelope\n{var == 0}
51-100: [@calculate][when] {$var} > 0 [do][!{$var} deck >> sort >> implode]; [end]Rabbit\n{var == 0}
// this is the deck to draw adjectives from from
Table: deck
Type: Lookup
Roll: 1d100
1-30: fast
31-36: tired
37-50: slow
51: hungry
52-60: flying
61-63: eating
64-70: sneaky
71-72: slippery
73-80: round
81: dead
82-86: lively
87-99: short
100: tall
// adds 2 to var until 1-60 is rolled
Table: calculate
Type: Lookup
Roll: 1d100
1-60: \z
61-100: {var == {var} + 2}[@calculate] // add 2 and roll again
Comments
As far as I investigated, it's a problem, or rather the result of using lookup table.
I'll skip long explanation why it is so, but just use simple weighted table like: Using variable number of picks have nothing to do. Following example works like a charm for me: BTW You have shuffle: subtable but table named deck.
Regards
I guess I'll write a small program outside of IP to convert all of my decks to weighted tables instead of Lookups to save myself some time.
Thanks for pointing out the bad shuffle reference too. I wrote this smaller generator quickly and didn't catch that when I renamed the deck to make it clearer
- moosebiter
One more thing to be careful about:
"Set: var = 0" as written, with spaces, sets variable "var" with value "<space>0" that is auto-magically converted to numeric value zero "0", but "Set: var = a" gives us "<space>a" and leading space is not trimmed. but I like space formatted code as well, but for "Set", it's better to keep it space-less like "Set: var=value".
Inspiration Pad have it's quirks, but it's great, and really useful tool.
Good luck with your tables.