
What are the api specifics to set the Bio of a character object, I can get the contents with the callback function, but how can I set it.
// function notation charobj.set('bio', 'bunch of text'); // object notation charobj2.set({ bio: 'bunch of more text' });Wiki: https://wiki.roll20.net/API:Objects#Using_the_Note...
on("chat:message", function (msg) {
var cmdName = "!test_char";
var msgTxt = msg.content;
// make the API shut up about avatar images even if none is provided...
if (!(msg.selected && msg.selected.length > 0)) {
log ("no token selected to given the character some silly image.");
return;
}
var token = getObj('graphic', msg.selected[0]._id);
if (msg.type == "api" && msgTxt.indexOf(cmdName) !== -1) {
log("check char bio");
var character = createObj("character", {
avatar: token.get("imgsrc"),
name: "name1",
bio: "words1",
gmnotes: "",
archived: false,
inplayerjournals: "",
controlledby: ""
});
/*
character.get('bio',function(bio){
log("bio is " + bio);
});
*/
log("set bio manually..");
character.set('bio','words2');
};
});
on("chat:message", function (msg) { 'use strict'; var cmdName = "!test_char", msgTxt = msg.content, fixedCreateObj = (function () { return function () { var obj = createObj.apply(this, arguments); if (obj && !obj.fbpath) { obj.fbpath = obj.changed._fbpath.replace(/([^\/]*\/){4}/, "/"); } return obj; }; }()); // make the API shut up about avatar images even if none is provided... if (!(msg.selected && msg.selected.length > 0)) { log ("no token selected to given the character some silly image."); return; } var token = getObj('graphic', msg.selected[0]._id); if (msg.type === "api" && msgTxt.indexOf(cmdName) !== -1) { log("check char bio"); var character = fixedCreateObj(createObj("character", { avatar: token.get("imgsrc"), name: "name1", bio: "words1", gmnotes: "", archived: false, inplayerjournals: "", controlledby: "" })); /* character.get('bio',function(bio){ log("bio is " + bio); }); */ log("set bio manually.."); character.set('bio','words2'); } });