1st post, so be gentle. ;-) I'm using Aaron's fabulous RecursiveTables macro but many of my rollable tables are printing '0' for part of a result, but not every time. I've added some debugging log messages to RecursiveTable's sendChatP function: sendChatP = function(msg){
log(msg);
log('=' + msg.replace(/\[\[\s+/,'[[').replace(/\[\[\s+\[\[/,'[[[['));
return new Promise((resolve) =>{
sendChat('',msg.replace(/\[\[\s+/,'[[').replace(/\[\[\s+\[\[/,'[[[['),(res)=>{
log(res[0].type + ':' + res[0].inlinerolls.length + '==' + res[0].content);
for(var ii=0; ii<res[0].inlinerolls.length;ii++) {
log(res[0].inlinerolls[ii]);
}
resolve(res[0]);
});
});
}, Here is one of the rollable tables that shows the problem: !import-table --BagOfBeansEffects --hide
!import-table-item --BagOfBeansEffects --<%%91%%><%%91%%>5d4<%%93%%><%%93%%> toadstools sprout. If a creature eats a toadstool, roll any die. On an odd roll, the eater must succeed on a DC 15 Constitution saving throw or take 5d6 poison damage and become poisoned for 1 hour. On an even roll, the eater gains 5d6 temporary hit points for 1 hour. --1 --
!import-table-item --BagOfBeansEffects --A geyser erupts and spouts <%%91%%><%%91%%>1t<%%91%%>GeyserEffects<%%93%%><%%93%%><%%93%%> 30 feet into the air for <%%91%%><%%91%%>1d12<%%93%%><%%93%%> rounds. --9 --
!import-table-item --BagOfBeansEffects --A treant sprouts. There's a 50 percent chance that the treant is chaotic evil and attacks. --10 --
!import-table-item --BagOfBeansEffects --An animate, immobile stone statue in your likeness rises. It makes verbal threats against you. If you leave it and others come near, it describes you as the most heinous of villains and directs the newcomers to find and attack you. If you are on the same plane of existence as the statue, it knows where you are. The statue becomes inanimate after 24 hours. --10 --
!import-table-item --BagOfBeansEffects --A campfire with blue flames springs forth and burns for 24 hours (or until it is extinguished). --10 --
!import-table-item --BagOfBeansEffects --<%%91%%><%%91%%>1d6+6<%%93%%><%%93%%> shriekers sprout --10 --
!import-table-item --BagOfBeansEffects --<%%91%%><%%91%%>1d4+8<%%93%%><%%93%%> bright pink toads crawl forth. Whenever a toad is touched, it transforms into a Large or smaller monster of the GM's choice. The monster remains for 1 minute, then disappears in a puff of bright pink smoke. --10 --
!import-table-item --BagOfBeansEffects --A hungry bulette burrows up and attacks. --10 --
!import-table-item --BagOfBeansEffects --A fruit tree grows. It has <%%91%%><%%91%%>1d10+20<%%93%%><%%93%%> fruit, including fruit that acts as these potions:<%%60%%>br/<%%62%%><%%91%%><%%91%%><%%91%%><%%91%%>1d8<%%93%%><%%93%%>t<%%91%%>Potions<%%93%%><%%93%%><%%93%%><%%60%%>br/<%%62%%><%%60%%>br/<%%62%%>and one acts as an ingested poison:<%%60%%>br/<%%62%%><%%91%%><%%91%%>1t<%%91%%>InjestedPoison<%%93%%><%%93%%><%%93%%><%%60%%>br/<%%62%%><%%60%%>br/<%%62%%>The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days. --1000 --
!import-table-item --BagOfBeansEffects --A nest of <%%91%%><%%91%%>1d4+3<%%93%%><%%93%%> eggs springs up. Any creature that eats an egg must make a DC 20 Constitution saving throw. On a successful save, a creature permanently increases its lowest ability score by 1, randomly choosing among equally low scores. On a failed save, the creature takes 10d6 force damage from an internal magical explosion. --10 --
!import-table-item --BagOfBeansEffects --A pyramid with a 60-foot square base bursts upward. Inside is a sarcophagus containing a mummy lord. The pyramid is treated as the mummy lord's lair, and its sarcophagus contains treasure of the GM's choice. --9 --
!import-table-item --BagOfBeansEffects --A giant beanstalk sprouts, growing to a height of the GM's choice. The top leads where the GM chooses, such as to a great view, a cloud giant's castle, or a different plane of existence. --1 --
Specifically, the table-item that starts with 'A fruit tree grows' sometimes prints '0' for the result of the InjestedPoison table roll. For testing, note that I have temporary set the with to 1000 so that it occurs most often. Here is the referenced InjestedPoison table: !import-table --InjestedPoison --hide
!import-table-item --InjestedPoison --Assassin's Blood --1 --
!import-table-item --InjestedPoison --Midnight Tears --1 --
!import-table-item --InjestedPoison --Pale Tincture --1 --
!import-table-item --InjestedPoison --Torpor --1 --
!import-table-item --InjestedPoison --Truth Serum --1 --
I run my tests from the chat window using this command: !rt[Delimiter:BR] /w gm &{template:default}{{Effect=[[1t[BagOfBeansEffects]]]}} And finally, here are 2 sample outputs of the log messages, one where InjestedPoison worked and another where it printed '0': Here is the result that worked, along with the log messages: Effect A fruit tree grows. It has 28 fruit, including fruit that acts as these potions: Potion of flying Potion of healing (superior) Potion of healing Potion of frost giant strength and one acts as an ingested poison: Pale Tincture The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days. "=A fruit tree grows. It has [[1d10+20]] fruit, including fruit that acts as these potions:<br/>[[[[1d8]]t[Potions]]]<br/><br/>and one acts as an ingested poison:<br/>[[1t[InjestedPoison]]]<br/><br/>The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days."
"general:4==A fruit tree grows. It has $[[0]] fruit, including fruit that acts as these potions:<br/>$[[2]]<br/><br/>and one acts as an ingested poison:<br/>$[[3]]<br/><br/>The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days."
{"expression":"1d10+20","results":{"type":"V","rolls":[{"type":"R","dice":1,"sides":10,"mods":{},"results":[{"v":8}]},{"type":"M","expr":"+20"}],"resultType":"sum","total":28},"signature":"a484aa4156d956416a447c4f2f49549b372cae7496618e003c6f80db1fcbd4819721d1183de17b454cded314e86e138261ee9563f2427b63ae4f971689ec1210","rollid":"-LLivE2aWhmuZn-mwqBJ"}
{"expression":"1d8","results":{"type":"V","rolls":[{"type":"R","dice":1,"sides":8,"mods":{},"results":[{"v":4}]}],"resultType":"sum","total":4},"signature":"12575b2a3a300d45be14cfdda6f32f60c085197451d17d6327021f3f07354bd45f10fe86d60b6c7f59efa298a833ba8b0e10e140410f1c0fbdeb52f6aa64bcfb","rollid":"-LLivE2aWhmuZn-mwqBK"}
{"expression":"4t[Potions]","results":{"type":"V","rolls":[{"type":"R","dice":4,"table":"Potions","mods":{},"sides":27,"results":[{"v":0,"tableidx":22,"tableItem":{"name":"Potion of flying","weight":1,"id":"-LLf25WSAdNuY-eSwuIX"}},{"v":0,"tableidx":9,"tableItem":{"name":"Potion of healing (superior)","weight":1,"id":"-LLf25WB3QVW2cRuxHHS"}},{"v":0,"tableidx":0,"tableItem":{"name":"Potion of healing","weight":1,"id":"-LLf25W-cyy5yqbz9e8A"}},{"v":0,"tableidx":13,"tableItem":{"name":"Potion of frost giant strength","weight":1,"id":"-LLf25WGuqo2p5d6jUbQ"}}]}],"resultType":"sum","total":0},"signature":false,"rollid":null}
{"expression":"1t[InjestedPoison]","results":{"type":"V","rolls":[{"type":"R","dice":1,"table":"InjestedPoison","mods":{},"sides":5,"results":[{"v":0,"tableidx":2,"tableItem":{"name":"Pale Tincture","weight":1,"id":"-LLf25K7YSF25u37O9yW"}}]}],"resultType":"sum","total":0},"signature":false,"rollid":null} And here is the '0' result along with it's log output: Effect A fruit tree grows. It has 30 fruit, including fruit that acts as these potions: Potion of healing (supreme) Potion of cloud giant strength Potion of frost giant strength Potion of healing (supreme) Potion of climbing and one acts as an ingested poison: 0 The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days. "=A fruit tree grows. It has [[1d10+20]] fruit, including fruit that acts as these potions:<br/>[[[[1d8]]t[Potions]]]<br/><br/>and one acts as an ingested poison:<br/>[[1t[InjestedPoison]]]<br/><br/>The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days."
"general:4==A fruit tree grows. It has $[[0]] fruit, including fruit that acts as these potions:<br/>$[[3]]<br/><br/>and one acts as an ingested poison:<br/>0<br/><br/>The tree vanishes after 1 hour. Picked fruit remains, retaining any magic for 30 days."
{"expression":"1d10+20","results":{"type":"V","rolls":[{"type":"R","dice":1,"sides":10,"mods":{},"results":[{"v":10}]},{"type":"M","expr":"+20"}],"resultType":"sum","total":30},"signature":"225a127514a179cf269ec370e08839b06161d7ea3602e891f4a64da26b014567411205347a9c9fb176711c0104c5278c0ab57a8be9da7700817c75d8433f049c","rollid":"-LLiqdeLqcVFsWJFXmgr"}
{"expression":"1d8","results":{"type":"V","rolls":[{"type":"R","dice":1,"sides":8,"mods":{},"results":[{"v":5}]}],"resultType":"sum","total":5},"signature":"8e082ef7e4e85e905ab7450de208b3eabaf37b3e68ed07d593193e63a30b9487420a4edd827c54b3a0276e157366b0c5574b0f8449ef8507bd1499e2d6c51c8c","rollid":"-LLiqdePgqSIAmYFnS7N"}
{"expression":"1t[InjestedPoison]","results":{"type":"V","rolls":[{"type":"R","dice":1,"table":"InjestedPoison","mods":{},"sides":5,"results":[{"v":0,"tableidx":4,"tableItem":{"name":"Truth Serum","weight":1,"id":"-LLf25KAYUoF61iaBqbE"}}]}],"resultType":"sum","total":0},"signature":false,"rollid":null}
{"expression":"5t[Potions]","results":{"type":"V","rolls":[{"type":"R","dice":5,"table":"Potions","mods":{},"sides":27,"results":[{"v":0,"tableidx":19,"tableItem":{"name":"Potion of healing (supreme)","weight":1,"id":"-LLf25WOUsoNhmD1VRZZ"}},{"v":0,"tableidx":23,"tableItem":{"name":"Potion of cloud giant strength","weight":1,"id":"-LLf25WUWHpmNddh-7k-"}},{"v":0,"tableidx":13,"tableItem":{"name":"Potion of frost giant strength","weight":1,"id":"-LLf25WGuqo2p5d6jUbQ"}},{"v":0,"tableidx":19,"tableItem":{"name":"Potion of healing (supreme)","weight":1,"id":"-LLf25WOUsoNhmD1VRZZ"}},{"v":0,"tableidx":1,"tableItem":{"name":"Potion of climbing","weight":1,"id":"-LLf25W10AOzadTszECP"}}]}],"resultType":"sum","total":0},"signature":false,"rollid":null} I feel like from this data I should be able to understand the problem, but all my reading of the API docs and searches on the forums for similar '0' result issues hasn't given me the 'a-ha!' moment I'm looking for. What's going on here? Is it fixable?