Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

ScriptCard not updating value from table query?

Perhaps some one can clarify my error, or is this a bug? I have a simple ScriptCard  based encounter check, it runs a loop for a number of times and queries a table to get an animal, if an encounter needs to be generated. Everything looks fine, but it retains the value returned from the table, even though a new check should generate a new query... do i need to clear/flush the values, or am missing something here? In this example I compare generating three values from the table, string, variable and the writing the variable to persistent storage ,for example I loop through 5 checks, and the values from the table do not update, staying "Owl", "Chicken" "Cat " through all 5 loops, screen shot to follow. Here is the script: !scriptcard  {{    --#title|Encounter --#debug|1 --=Count|1  --=CountLimit|?{Limit|1} --:CheckEncounter|   --=ERoll| 1d6  --+CurrentCount|  [$Count] of [$CountLimit] ERoll: [$ERoll]    --?[$ERoll] -le 5|>AnEncounter   --?[$ERoll] -ge 6|>NOEncounter   --:AnEncounter|     --+[#FF0000] [$Count] Encounter| [/#]                     --=ThisRoll|[[1t[Animals-Woodland] ]]                     --+ThisRoll| [$ThisRoll.RollText]                          --&StringTest|[[1t[Animals-Woodland] ]]                           --+StringRoll| [&StringTest]                                --&MyStr|[[1t[Animals-Woodland] ]]                               --~MyStr|stateitem;write;stringvariable                               --~RetrievedStr|stateitem;read;stringvariable                               --+stateitem:|[&RetrievedStr]           --=Count| [$Count] + 1 --?[$Count] -gt [$CountLimit]| EndEncounterCheck --^CheckEncounter| --:NOEncounter|     --+[#006400] [$Count] NOEncounter|[/#]   --=Count| [$Count] + 1 --?[$Count] -gt [$CountLimit]| EndEncounterCheck --^CheckEncounter|  --:EndEncounterCheck|  --X:| }} As always thanks for any insights as to what my error is.
here is the Debug info, if that is of any interest.... "Condition 2 -gt 5 evaluation result: false" "Line Counter: 22, Tag:^CheckEncounter, Content:" "Line Counter: 6, Tag:=ERoll, Content:1d6" "Line Counter: 7, Tag:+CurrentCount, Content:[$Count] of [$CountLimit] ERoll: [$ERoll]" "Line Counter: 8, Tag:?4 -le 5, Content:>AnEncounter" "Condition 4 -le 5 evaluation result: true" "Line Counter: 11, Tag:+[#FF0000] 2 Encounter, Content:[/#]" "Line Counter: 12, Tag:=ThisRoll, Content:Owl" "Line Counter: 13, Tag:+ThisRoll, Content:[$ThisRoll.RollText]" "Line Counter: 14, Tag:&StringTest, Content:Chicken" "Line Counter: 15, Tag:+StringRoll, Content:[&StringTest]" "Line Counter: 16, Tag:&MyStr, Content:Cat" "Line Counter: 17, Tag:~MyStr, Content:stateitem;write;stringvariable" "Line Counter: 18, Tag:~RetrievedStr, Content:stateitem;read;stringvariable" "Line Counter: 19, Tag:+stateitem:, Content:[&RetrievedStr]" "Line Counter: 20, Tag:=Count, Content:2 + 1" "Line Counter: 21, Tag:?3 -gt 5, Content:EndEncounterCheck" "Condition 3 -gt 5 evaluation result: false" "Line Counter: 22, Tag:^CheckEncounter, Content:" "Line Counter: 6, Tag:=ERoll, Content:1d6" "Line Counter: 7, Tag:+CurrentCount, Content:[$Count] of [$CountLimit] ERoll: [$ERoll]" "Line Counter: 8, Tag:?6 -le 5, Content:>AnEncounter" "Condition 6 -le 5 evaluation result: false" "Line Counter: 9, Tag:?6 -ge 6, Content:>NOEncounter" "Condition 6 -ge 6 evaluation result: true" "Line Counter: 24, Tag:+[#006400] 3 NOEncounter, Content:[/#]" "Line Counter: 25, Tag:=Count, Content:3 + 1" "Line Counter: 26, Tag:?4 -gt 5, Content:EndEncounterCheck" "Condition 4 -gt 5 evaluation result: false" "Line Counter: 27, Tag:^CheckEncounter, Content:" "Line Counter: 6, Tag:=ERoll, Content:1d6" "Line Counter: 7, Tag:+CurrentCount, Content:[$Count] of [$CountLimit] ERoll: [$ERoll]" "Line Counter: 8, Tag:?6 -le 5, Content:>AnEncounter" "Condition 6 -le 5 evaluation result: false" "Line Counter: 9, Tag:?6 -ge 6, Content:>NOEncounter" "Condition 6 -ge 6 evaluation result: true" "Line Counter: 24, Tag:+[#006400] 4 NOEncounter, Content:[/#]" "Line Counter: 25, Tag:=Count, Content:4 + 1" "Line Counter: 26, Tag:?5 -gt 5, Content:EndEncounterCheck" "Condition 5 -gt 5 evaluation result: false" "Line Counter: 27, Tag:^CheckEncounter, Content:" "Line Counter: 6, Tag:=ERoll, Content:1d6" "Line Counter: 7, Tag:+CurrentCount, Content:[$Count] of [$CountLimit] ERoll: [$ERoll]" "Line Counter: 8, Tag:?4 -le 5, Content:>AnEncounter" "Condition 4 -le 5 evaluation result: true" "Line Counter: 11, Tag:+[#FF0000] 5 Encounter, Content:[/#]" "Line Counter: 12, Tag:=ThisRoll, Content:Owl" "Line Counter: 13, Tag:+ThisRoll, Content:[$ThisRoll.RollText]" "Line Counter: 14, Tag:&StringTest, Content:Chicken" "Line Counter: 15, Tag:+StringRoll, Content:[&StringTest]" "Line Counter: 16, Tag:&MyStr, Content:Cat" "Line Counter: 17, Tag:~MyStr, Content:stateitem;write;stringvariable" "Line Counter: 18, Tag:~RetrievedStr, Content:stateitem;read;stringvariable" "Line Counter: 19, Tag:+stateitem:, Content:[&RetrievedStr]" "Line Counter: 20, Tag:=Count, Content:5 + 1" "Line Counter: 21, Tag:?6 -gt 5, Content:EndEncounterCheck" "Condition 6 -gt 5 evaluation result: true" "Line Counter: 29, Tag:X:, Content:"
and a screen shot fo the output of a loop check, 5 times.
NeverMind I think i found my error, wrong table format.                     --=ThisRoll|[T#Animals-Woodland] NOT                     --=ThisRoll|[[1t[Animals-Woodland] ]] When in doubt go back and read the documentation. thanks