Oh, maybe you mean that you want to allow users to write ANIMAL = {import:my-animal-list} directly in their scratchpad (without it being pre-imported by your generator's code)? If so you could maybe use regex to replace ANIMAL = {import:my-animal-list} with something like ANIMAL = [dynamicImport("my-animal-list")], assuming you have imported https://perchance.org/dynamic-import-plugin already. You may want to check that the parseVariables code in the t2i framework will be adjusted to support that, if it doesn't already. I think it should already support it, so only the regex transformation should be required (though I could be wrong).
Sorry I should have been more clear that the [ANIMAL=lists.animal, COLOR=lists.color, ""] should go in the HTML of the generator that you want to use the lists in, not in the furchancetxt generator. When you import a generator like furchancetxt, only the lists are imported - the HTML of furchancetxt will be completely ignored.
And regarding the "cannot find generator" but it somehow works for noun gemeratpr: I think that's because you're importing noun already (possibly indirectly - i.e. importing a generator that imports noun)? The {import:furchancetxt} would only work if you have already imported it somewhere else. So you should either pre-import the things you want to use "dynamically", or use dynamic imports if there are too many things to pre-import (that may not be used very often):
Also, I'm not sure if list = {import:furchancetxt} will work at all in scratchpad. IIRC it only parses all-caps variables, but maybe you have changed that part, idk.
I think the TL;DR here is that you'll want to just put list = {import:furchancetxt} in your ai-furry-generator on a new line in the perchance lists editor, and then put [ANIMAL=lists.animal, COLOR=lists.color, ""] at the top of the the HTML editor of ai-furry-generator. Then you can use [ANIMAL] and [COLOR] in the scratchpad.
So if you have perchance.org/my-lists like this:
$output
animal
mouse
chicken
frog
color
red
green
blue
then in the other generator you have:
lists = {import:my-lists}
then you can write [lists.animal] and [lists.color] to access them. If you want them to be available as [ANIMAL] and [COLOR]¹, then you could put this at the top of your HTML panel:
[ANIMAL=lists.animal, COLOR=lists.color, ""]
You need to make sure that line is above any code that tries to use [ANIMAL] and [COLOR], since the square blocks in the HTML editor are executed in top-to-bottom (and left-to-right for square blocks on the same line) order.
Let me know if I still misunderstand.
¹ Since IIRC, the t2i-framework-plugin-v2 requires use of all-caps variable names? That was mainly to avoid collision with built-in browser global variables (again, IIRC)
Can you share a minimal example of what you're trying to achieve?
How do we custom a more complicated list gen like I can do in scratchpad and import it directly in prompt textarea
To try to answer this question directly, if you have a generator like this called perchance.org/my-animal-list:
$output
mouse
chicken
frog
then you should just be able to write:
ANIMAL = {import:my-animal-list}
in your generator that you want to 'use' that animal list in. And then just write [ANIMAL] wherever you want to use it.
You can get a lot more complex than that, but that's the general gist of it. Let me know if there's a specific part you're struggling with or if I misunderstood.
Yep, it's intentional - it's actually motivated by a privacy consideration. Without removing the username for automated/bot submissions, it could leak that a person with username "foo" has visited generator "bar" via automated comment submission when they visit the page. Ideally that sort of "automated unmasking" of users should not be possible, and this design decision preserves that.
Automated comment submission is of course possible, but the (~IP based) user tag is different for each generator, so they stay anonymous unless they specifically choose to comment with their username.
If you write:
HUE1 = {CHARCOAL GREY|WHITE|CRIMSON|EMERALD}
on a new line in the perchance code editor, then you should be able to use [HUE1] in your description box. If that doesn't work then there may be a bug somewhere, either in your code, or t2i framework, assuming you're using that. I just tested it and it seems to work fine for me though.
Assuming the scratchpad has parseVariables = true, then I think you can just put useVariables = true on any input that you want to be able to use variables? You can Ctrl+F for that in https://perchance.org/ai-text-to-image-generator to see example usage.
Yeah the second/third/etc. errors in the list can unfortunately be misleading - trick is to always solve the top one first since it's likely the root cause of all the others:
An error has occurred near line number 203: There's a problem with the syntax of this expression: '[if (r.species != "dragonborn") {1} else {0}]'. Here's the message that was returned when execution failed: Cannot read properties of undefined (reading 'species').
This is a poorly worded error message (directly from the browser's JS engine) which basically means "I tried to look at the 'species' property of r but r was undefined". It's because you define r after fh instead of before. So when it tries to calculate the odds, which depends on r being defined, it breaks.
So to fix it you can change this:
fh=face_hue.selectOne.evaluateItem, ..., r=ancestry.selectOne
to this:
r=ancestry.selectOne, fh=face_hue.selectOne.evaluateItem, ...
Have you been able to replicate the issue yourself, or notice any patterns in user reports you get? E.g. specific browsers or countries being affected, or the issue co-occuring with some other weird behavior?
Can you share a minimal example of what you've tried?
I think you might be running into the issue where you need to wrap your object in parentheses, like this? foo = [({abc:123})] See the meta:tags lines in https://perchance.org/t2i-styles#edit for an example.
You only need to do that if you're creating an object within square brackets without assigning it to a variable within those brackets. E.g. you can just write [foo={abc:123}] since the equals sign forces the JavaScript engine to interpret it as an object.
The reason for this weirdness is technical - related to how JavaScript engines evaluate stuff. Basically, {abc:123} on its own (without parentheses or variable assignment) is interpreted as a block scope with a label.
Thanks so much for the minimal reproduction! 🙏 Should be fixed now, but let me know if any issues remain.
Yeah that was just placeholder code IIRC - I didn't finish implementing it.