; D100OE.ipt ; created 1-7-24 ; Created by NanoEther ; Inspired by thread: https://forum.nbos.com/discussion/1402/open-ended-dice-rolls ; with helpful comments from JDale, and OldeMusicke ; ; This will generate negative as well as positive results ; IPP does not currently handle negative lookups, the following might work ; Add a base value to your table and your rolls (like 200) ; This will shift your table values and rolls upwards. ; I would also create traps to cap the values: ; [when]{Roll}<{0}[do]{Roll}=={0}[end] ; ; OE = Open Ended, if values are between 1-5 or 96-100, additional rolls are ; either subtracted or added to the first roll ; OEH = Open Ended High, as above, but only values from 96-100 are tested ; ; Subtables: ; D100OE [main table] (rolls 1d100 Open Ended, calls FirstRoll) ; FirstRoll [subtable] (requires D100OE to work right, calls D100OEH) ; D100OEH [subtable] (rolls 1d100 Open Ended High, calls itself) // Initial roll Set:Basenumber={1d100} //subsequent rolls if first roll meets OE requirements //Set:Bonusnumber={1d100} //Passes Basenumber to Firstroll Table:D100OE [#{Basenumber} FirstRoll] Table:FirstRoll Type:Lookup 1-5: {$Basenumber+((-1)*([#{Bonusnumber} D100OEH]))} 6-95: {$Basenumber} 96-100: {$Basenumber+([#{Bonusnumber} D100OEH])} EndTable: ; the following table was originally meant to be added or subtracted from D100OE results ; but I was planning on doing a D100OEH roller too, and realized that I'd already done it ; so I changed the name. Ta Da! Table:D100OEH Set:Bonusnumber={1d100} Type:Lookup 1-95: {$Bonusnumber} 96-100: {$Bonusnumber+([#{Bonusnumber} D100OEH])} EndTable: