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

Folder changes messing with handouts?

var note = findObjs({ _type: "handout" }); log(note); => [] Either I'm making a very stupid mistake, or that should be returning an array of all of the handout objects. The wiki says... var currentPageGraphics = findObjs({ _pageid: Campaign().get("playerpageid"), _type: "graphic", }); And... _type | "handout" | Can be used to identify the object type or search for the object. Read-only So whatever mistake I'm making is probably a good sign to stop writing code for the day. Any suggestions would be helpful. I even went so far as to check against HoneyBadger's [Script] PowerCards 2 (Thread 2) script on github lines 330-332: var PowerCard_FormatHandout = findObjs({ _type: "handout", name: "PowerCard Formats" })[0]; I'm stumped.
I did have HoneyBadger's stuff linked for citation, but it previewed his entire script in the thread, which was unintentional.
1431464314
The Aaron
Pro
API Scripter
dumb question, but do you know that you have handouts in the campaign where you are testing?
I have 3, 1 in the "Main" area (not in any folder), 1 in the Handouts folder, and one in the Characters folder.
1431468465
The Aaron
Pro
API Scripter
So, I'm going to guess you don't have that in an on('ready',...) call. // unlikely to find anything, the API is still loading objects var note = findObjs({ _type: "handout" }); log(note); // executes when the API is done loading objects on('ready', function(){ // will find things var note = findObjs({ _type: "handout" }); log(note); }) When I ran this in my test campaign, the first find found nothing, the second find found oodles of stuff.
That'll do it. >_> Appreciate the help. I was having trouble with a different aspect of my use-case, and started stripping things out to simplify things. Looks like I threw the baby out with the bathwater.
1431473072
The Aaron
Pro
API Scripter
Happens to the best of us!