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

[API] Changing deleted text creates new text

1457620814

Edited 1457620927
Instead of throwing an exception, the set method for deleted text objects creates trash on screen. Before deleting After deleting (by hand)
1457638034
Phil B.
Forum Champion
Sheet Author
Hey Jean-Luc, sorry you're having issues with the API. So that I can try and figure out exactly what the issue is, can you paste a snipit the specific API code you are using that is causing this issue, please.
Here is a minimal testcase: var test = test || {     a: 0,     counter: 0,     job: 0,          myFunction: function () {         sendChat("gm", "creating object");         var page = Campaign().get("playerpageid");         test.a = createObj("text", {             text: "aaa",             font_size: 200,             pageid: page,             layer: "map",             top: 200,             left: 500,             font_family: "contrail"         });         setTimeout(test.myFunction2, 1000);          },          myFunction2: function() {         sendChat("gm", "removing object");         test.a.remove();         test.job = setInterval(test.myFunction3, 2000);     },          myFunction3: function() {         sendChat("gm", "changing object");         if (test.couter < 10) {             clearInterval(test.job);         } var str = ""; for (i = 0; i < test.counter; i++) { str += "bugbugbug"; }         test.a.set("text", str);         test.counter++;     },          register: function () {         test.myFunction();     } }; on("ready", function(){ test.register(); }); The most obvious guess is that roll20 is not correctly tracking objects that have been deleted.