2
submitted 2 days ago* (last edited 2 days ago) by [email protected] to c/[email protected]

Hi everyone,

I'm having a very persistent issue with my Perchance generator, and I've tried many troubleshooting steps, but I can't seem to get past it. I'm hoping someone here can take a look.

My Goal: I'm building an art style concept generator. It's a two-generator setup:

my-styles-list: This generator acts purely as a library, holding all my art style lists (General, Dragon Ball, Demon Hunters). my-art-generator: This generator @imports the lists from my-styles-list, uses a selectedCategory dropdown to let the user choose a style category, and then generates a concept based on that choice. The Problem: When I open my Main Art Style Generator, I see:

"My Awesome Art Style Generator" (so the [title] is working). But immediately underneath, it says: "undefined" Below that, it says: "syntax error" Crucially, the "Choose Art Style Category" dropdown menu is NOT appearing on the page. Only the "randomize" button is visible. My Main Art Style Generator's Code:

Perchance Code (Top-Left Editor):

Code snippet

// This is your MAIN Art Style Generator. // It imports lists from your Art Style Library and generates general art style concepts.

// IMPORTANT: Make sure 'my-styles-list' is the EXACT URL slug of your // Art Style Library generator (e.g., 'my-styles-list'). @import:my-styles-list

//


Generator Title


// This list provides the text for the [title] in the HTML template. title = My Awesome Art Style Generator

output Your Art Style Concept: [chooseSelectedStyle]

//


User Input for Style Category


// This creates the dropdown menu on the right-hand side. selectedCategory label = Choose Art Style Category type = select options General Dragon Ball Demon Hunters

//


Conditional Style Generation


// This section uses the user's selection to generate the appropriate style description. chooseSelectedStyle [selectedCategory == "General"] { A [[generalArtStyle]] style, featuring [[generalElements]] and a [[generalColorPalette]] palette, with a [[generalMood]] and [[generalDetails]]. } [selectedCategory == "Dragon Ball"] { A [[dbArtStyle]] style, featuring [[dbElements]] and a [[dbColorPalette]] palette, with a [[dbMood]] and [[dbDetails]]. } [selectedCategory == "Demon Hunters"] { A [[dhArtStyle]] style, featuring [[dhElements]] and a [[dhColorPalette]] palette, with a [[dhMood]] and [[dhDetails]]. } HTML/CSS Code (Bottom-Right Editor):

HTML

What I've Tried So Far (Extensive Troubleshooting):

Library Generator (my-styles-list) is confirmed clean: When I open https://perchance.org/my-styles-list in a private/incognito window, the right-hand side is completely blank, as it should be for a data library. There are no errors on that page itself. Cleared/Reset both generators: For both generators, I've completely deleted all code from both the left (Perchance) and right (HTML/CSS) editors. Used Plain Text Editor intermediary: I copied all the correct code (both Perchance and HTML as shown above) into Notepad/TextEdit first to strip any hidden characters, then pasted it into the blank Perchance editors. Tested in Private/Incognito Mode: All testing has been done in a fresh private window to avoid caching issues. Despite all these steps, the "undefined" and "syntax error" persist, and the dropdown is missing.

My Main Art Style Generator Link: https://perchance.org/my-art-generator

Any insights or help would be greatly appreciated! Thank you

top 5 comments
sorted by: hot top new old
[-] [email protected] 2 points 2 days ago

this is a basic working version of what you were trying to make, I think: https://perchance.org/mve3bqmwls

[-] [email protected] 1 points 2 days ago* (last edited 2 days ago)
selectedCategory
  $output=[this.selectAll.map(a => `<option>${a}</option>`).join('')]
  General
  Dragon Ball
  Demon Hunters

Put this in your lists. then in the html window: <select onchange='selectedStyle=this.value'>[selectedCategory]</select>

this will create a dropdown with General, Dragon Ball and Demon Hunters, and the value will be stored in selectedStyle

[-] [email protected] 1 points 2 days ago

Thank you, that completely resolved my issue! I'm relatively to this so I'm still trying to find my feet, Thanks again :)

[-] [email protected] 1 points 2 days ago* (last edited 2 days ago)

you're using t2i-frame plugin syntax but I don't see you importing it anywhere?

selectedCategory
  label = Choose Art Style Category
  type = select
  options
    General
    Dragon Ball
    Demon Hunters

this only works within the custom plugin {import:t2i-framework-plugin-v2} . Alternatively, the correct way would be to create a list, then in the html part create a select element with that list.

[-] [email protected] 1 points 2 days ago

"my-styles-list", top level lists should only contain letters and underscores (_)

this post was submitted on 16 Jun 2025
2 points (100.0% liked)

Perchance - Create a Random Text Generator

841 readers
12 users here now

⚄︎ Perchance

This is a Lemmy Community for perchance.org, a platform for sharing and creating random text generators.

Feel free to ask for help, share your generators, and start friendly discussions at your leisure :)

This community is mainly for discussions between those who are building generators. For discussions about using generators, especially the popular AI ones, the community-led Casual Perchance forum is likely a more appropriate venue.

See this post for the Complete Guide to Posting Here on the Community!

Rules

1. Please follow the Lemmy.World instance rules.

2. Be kind and friendly.

  • Please be kind to others on this community (and also in general), and remember that for many people Perchance is their first experience with coding. We have members for whom English is not their first language, so please be take that into account too :)

3. Be thankful to those who try to help you.

  • If you ask a question and someone has made a effort to help you out, please remember to be thankful! Even if they don't manage to help you solve your problem - remember that they're spending time out of their day to try to help a stranger :)

4. Only post about stuff related to perchance.

  • Please only post about perchance related stuff like generators on it, bugs, and the site.

5. Refrain from requesting Prompts for the AI Tools.

  • We would like to ask to refrain from posting here needing help specifically with prompting/achieving certain results with the AI plugins (text-to-image-plugin and ai-text-plugin) e.g. "What is the good prompt for X?", "How to achieve X with Y generator?"
  • See Perchance AI FAQ for FAQ about the AI tools.
  • You can ask for help with prompting at the 'sister' community Casual Perchance, which is for more casual discussions.
  • We will still be helping/answering questions about the plugins as long as it is related to building generators with them.

6. Search through the Community Before Posting.

  • Please Search through the Community Posts here (and on Reddit) before posting to see if what you will post has similar post/already been posted.

founded 2 years ago
MODERATORS