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 here.
×
×
Cookie Preferences
We use Cookies to help personalize and improve Roll20. For more information on our use of non-essential Cookies, visit our Privacy Policy here.
When trying to use this feature I get an error mesaage of: "ERROR: You must specify a valid layer to create this object type." I have quite a few macros running so it might be a conflict, but maybe someone has a quick answer...
Is this a script that you are using, or is it one of the new default settings? If it's a script, can you provide a link to its forum thread, wiki entry, and/or code page?
Its a feature of the Roll20 OGL 5e Companion script. Because it is an official script I am assuming it works, and there must be a problem with my collection in some way. I was hoping that it was something obvious, a conflict with a script would be hard to find as I use quite a few, sigh.
Went through and removed all non-Library (one click) scripts and it still throws the error. I am using creatures imported from the D&D Manual, is there a chance the artwork from these is not being moved over properly?
Kevin Flynn said: When trying to use this feature I get an error mesaage of: "ERROR: You must specify a valid layer to create this object type." I have quite a few macros running so it might be a conflict, but maybe someone has a quick answer... Was there anymore info with this, like a call stack?
I manually configured a NPC creature and the Auto tool works ok. So the problem only exists with creatures dragged from the Monster Manual. So far I have opened the Compendium, found a monster, dragged it to the Objects layer. This creates a new creature in the Journal. If I drag that Journal entry to the map it is ok. If I open the Journal entry and click the HPs bar (button?) it is supposed to create a new creature, but it throws the error.
Oh? Interesting! Found the issue. There is an assumption in the script that the token is on a given layer. Changing Line 231 to this should fix it: layer: (_.contains(["gmlayer", "objects", "map"], t.layer) ? t.layer : 'gmlayer'),
If you wanna test that real quick, I can submit a patch.
You'll also need to change the getCleanImgsrc function on line 241: var getCleanImgsrc = function (imgsrc) {
var parts = imgsrc.match(/(.*\/(?:images|marketplace)\/.*)(thumb|med|original|max)([^\?]*)(\?[^?]+)?$/);
if(parts) {
return parts[1]+'thumb'+parts[3]+(parts[4]?parts[4]:`?${Math.round(Math.random()*9999999)}`);
}
return;
}; Apparently, Compendium monster's default tokens come in without the ?#### on the end, which is required. You end up getting this error if you don't do the above: "ERROR: You must include the query string in your URL. For example, use '<a href="https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png?12345678" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png?12345678</a>', not '<a href="https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png" rel="nofollow">https://s3.amazonaws.com/files.staging.d20.io/images/123456/med.png</a>'"
This is a one click script, do your comments get passed to the author? I will do so later on anyway. Thanks. Surprised this hasn't happened to anyone else?
I dropped them to the author directly (Roll20's Steve). They'll likely get rolled in in the next week or two. The Monster Manual having only just come out, I'm not surprised it hasn't come up yet. =D
So, the tokens you've set up will be created on the layer you had them on when you stored it. (I can't say if that's right or wrong, it's the behavior Steve had there). What I added was setting the layer to the GM Layer if the token had no layer set (Which was the case for monsters from the Monster Manual). The API can't tell what layer you are on, so it has no way to intelligently decide which layer to put them on. I erred on the side of caution and created them where players wouldn't see them.