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

[BUG] ​Anyone know the work around for this?

1410364360
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
For reference, the error message generated was: /home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:1 orts, require, module, __filename, __dirname) { function f(a){throw a;}var j=v ^ Error: Firebase.child failed: First argument must be a non-empty string and can't contain ".", "#", "$", "[", or "]". at Error (<anonymous>) at Ha (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:12:204) at G.W.H (/home/symbly/www/d20-api-server/node_modules/firebase/lib/firebase-node.js:126:213) at TrackedObj._doSave ( Last I read on this was post from Riley: "And if I remember correctly there's an outstanding issue where if you try to set() things on new objects created with createObj() it causes an error. I believe there is a workaround that people have posted already, although this is definitely something I need to fix. Anywho, it's not specific to sheets at all, it's just that old bug." This is exact issue I am seeing.... error when trying "set() things on new objects created with createObj()" Anyone know the work around for this?
1410366671

Edited 1410366708
DXWarlock
Sheet Author
API Scripter
I can give you this. Im using it in one of my scripts. I didnt create it..all credit to Aaron, I totally stole it from Aarons turn script...as I was having the issue and realized he was making/moving a token in it. Call it directly after making the object/token: marker = createObj('foo bar', usual create info here); marker=fixNewObject(marker); then this function saved somewhere: //--Utility Function var fixNewObject = fixNewObject || function(obj){ var p = obj.changed._fbpath; var new_p = p.replace(/([^\/]*\/){4}/, "/"); obj.fbpath = new_p; return obj; };
1410368012
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Thanks.... I knew it was on here somewhere. Worked like a charm. I should put in the Random Dungeon Generator so you can turn the tiles before creating the Dynamic Lighting.
1410405406
The Aaron
Roll20 Production Team
API Scripter
I can't take credit for it either, actually. Here's the version I'm using in my more recent scripts: var fixedCreateObj = fixedCreateObj || (function () { return function () { var obj = createObj.apply(this, arguments); if (obj && !obj.fbpath) { obj.fbpath = obj.changed._fbpath.replace(/([^\/]*\/){4}/, "/"); } return obj; }; }()); You'd just call fixedCreateObj() like you call createObj ,and it handles all the rest. Here is the original source and discussion: <a href="https://app.roll20.net/forum/post/733277/api-firebase-dot-child-failed-error-help-please#post-747867" rel="nofollow">https://app.roll20.net/forum/post/733277/api-firebase-dot-child-failed-error-help-please#post-747867</a>