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

[Help] My script makes a character's sheet un-openable

Hi! New, strange problem here.  I have a script that populates some char-sheet text boxes with values from an array.  When I only loop the first level of this array, everything is fine.  When I try to expand into the next levels, something weird happens that makes the character not open (that is to say, I click on the character and the sheet does not open at all).  I get no errors in my API  when this happens.  It seems like I'm crashing the character sheet in some way that is separate from the game itself? Also, if I open the character's sheet ahead of time then run the script, none of the fields populate as usual.  Not just the fields related to this particular script, but none whatsoever.  The scripts is running through multiple loops within loops with like 5 times 3 times 1 (15) objects, creating attributes that appear on the char sheet.   How could I  be crashing the char sheet to the point that it won't even open for this character while no error is registered by the API?  Thanks
1515800511
The Aaron
Pro
API Scripter
The Character Sheet runs in the Browser, so if it has any errors, they will show up in the Javascript Console (usually accessible in something like View->Developer->Console Log).  I'd load that up and see what it says.  Additionally, if you want to post your script, we can look at it and see if anything jumps out.
Very cool.&nbsp; Ya, the browser console is chock-a-block full of errors when I run this script. This error gets thrown about 12 times. FIREBASE WARNING: Exception was thrown by user callback. TypeError: t.toLowerCase is not a function &nbsp; &nbsp; at T.s.updateSheetValues (<a href="https://app.roll20.net/assets/app.js?1515604619:91:29018" rel="nofollow">https://app.roll20.net/assets/app.js?1515604619:91:29018</a>) &nbsp; &nbsp; at T.s.&lt;anonymous&gt; (<a href="https://app.roll20.net/assets/app.js?1515604619:91:29463" rel="nofollow">https://app.roll20.net/assets/app.js?1515604619:91:29463</a>) &nbsp; &nbsp; at T.s.trigger (<a href="https://app.roll20.net/assets/base.js?1515518527:1:15755" rel="nofollow">https://app.roll20.net/assets/base.js?1515518527:1:15755</a>) &nbsp; &nbsp; at T.s._onModelEvent (<a href="https://app.roll20.net/assets/base.js?1515518527:1:23841" rel="nofollow">https://app.roll20.net/assets/base.js?1515518527:1:23841</a>) &nbsp; &nbsp; at T.s.trigger (<a href="https://app.roll20.net/assets/base.js?1515518527:1:15843" rel="nofollow">https://app.roll20.net/assets/base.js?1515518527:1:15843</a>) &nbsp; &nbsp; at T.s.add (<a href="https://app.roll20.net/assets/base.js?1515518527:1:21195" rel="nofollow">https://app.roll20.net/assets/base.js?1515518527:1:21195</a>) &nbsp; &nbsp; at i._add (<a href="https://app.roll20.net/assets/app.js?1515604619:3:51" rel="nofollow">https://app.roll20.net/assets/app.js?1515604619:3:51</a>) &nbsp; &nbsp; at i.child_added (<a href="https://app.roll20.net/assets/app.js?1515604619:3:196" rel="nofollow">https://app.roll20.net/assets/app.js?1515604619:3:196</a>) &nbsp; &nbsp; at <a href="https://app.roll20.net/assets/firebase.2.4.0.js:2" rel="nofollow">https://app.roll20.net/assets/firebase.2.4.0.js:2</a>... &nbsp; &nbsp; at gc (<a href="https://app.roll20.net/assets/firebase.2.4.0.js:52:165" rel="nofollow">https://app.roll20.net/assets/firebase.2.4.0.js:52:165</a>)&nbsp; S @ firebase.2.4.0.js:45 (anonymous) @ firebase.2.4.0.js:52 setTimeout (async) gc @ firebase.2.4.0.js:52 cc @ firebase.2.4.0.js:30 dc @ firebase.2.4.0.js:29 h.Kb @ firebase.2.4.0.js:220 h.Ld @ firebase.2.4.0.js:188 Eh.Ld @ firebase.2.4.0.js:178 (anonymous) @ firebase.2.4.0.js:176 yh @ firebase.2.4.0.js:170 La.onmessage @ firebase.2.4.0.js:169 firebase.2.4.0.js:52 Uncaught TypeError: t.toLowerCase is not a function &nbsp; &nbsp; at T.s.updateSheetValues (app.js?1515604619:91) &nbsp; &nbsp; at T.s.&lt;anonymous&gt; (app.js?1515604619:91) &nbsp; &nbsp; at T.s.trigger (base.js?1515518527:1) &nbsp; &nbsp; at T.s._onModelEvent (base.js?1515518527:1) &nbsp; &nbsp; at T.s.trigger (base.js?1515518527:1) &nbsp; &nbsp; at T.s.add (base.js?1515518527:1) &nbsp; &nbsp; at i._add (app.js?1515604619:3) &nbsp; &nbsp; at i.child_added (app.js?1515604619:3) &nbsp; &nbsp; at firebase.2.4.0.js:203 &nbsp; &nbsp; at gc (firebase.2.4.0.js:52)
1515855351
GiGs
Pro
Sheet Author
API Scripter
As Aaron says, it's a good idea to post your code. We can't easily tell what might be going on without it.
Welp, found my problem already.&nbsp; Something stupid, as usual.&nbsp; The attributes I was creating all had a 0 where I meant to put their names cause I was lazy while initially formatting my JSON stuff.&nbsp;&nbsp; Anyway, I always learn something new when I stump myself with a silly mistake.&nbsp; Thank you Aaron. -Will
Ya, my code's just really messy and embarrassing and 9 times out of 10 the problem is something silly like this.&nbsp; Luckily, his advice to look at the browser log was all I needed to notice my mistake and avoid exposing my amateurish code.
1515859535
The Aaron
Pro
API Scripter
No worries, happens to all of us! &nbsp;I’ve written some pretty horrendous stuff (don’t look and my Mystara calendar code!!).