
Hello,
I've already been raising this question elsewhere, but in the meantime I was able to do some other tests, and I really cannot think of any reason why it's not working... Short of a bug (or some really dumb mistake I'm making that I cannot see, that is).
It is quite easy to replicate: create a character journal, create an attribute in it named STR. Put a token on the page and assign the character's journal to it.
Select the token, type !spawn.
The code creates a new character journal, copies into it the attributes and abilities from the character journal assigned to the selected token, assigns the newly created journal to the selected token, get the current value of the STR attribute from the new journal, adds 10 to it, puts the new value back into the current STR attribute.
This is the error I receive when the code tries to execute the last line (oAttrib.set("current", attrib);):
/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 () 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 (
The new journal is in fact created and assigned to the selected token. The attribute is taken from the new journal. But then I cannot put it back.
If I comment out the line where I assign the new journal ID (sheetID = character.id;) and the operation on the attribute is run on the original journal, all is fine.
Edit: Dev server
Any ideas?
Code: Gist .
I've already been raising this question elsewhere, but in the meantime I was able to do some other tests, and I really cannot think of any reason why it's not working... Short of a bug (or some really dumb mistake I'm making that I cannot see, that is).
It is quite easy to replicate: create a character journal, create an attribute in it named STR. Put a token on the page and assign the character's journal to it.
Select the token, type !spawn.
The code creates a new character journal, copies into it the attributes and abilities from the character journal assigned to the selected token, assigns the newly created journal to the selected token, get the current value of the STR attribute from the new journal, adds 10 to it, puts the new value back into the current STR attribute.
This is the error I receive when the code tries to execute the last line (oAttrib.set("current", attrib);):
/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 () 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 (
The new journal is in fact created and assigned to the selected token. The attribute is taken from the new journal. But then I cannot put it back.
If I comment out the line where I assign the new journal ID (sheetID = character.id;) and the operation on the attribute is run on the original journal, all is fine.
Edit: Dev server
Any ideas?
Code: Gist .