So I’m trying to make a randomizer for the game PC Building Simulator. The problem is that not all parts are compatible with each other. I have this so far:...
If sel_case is a string (i.e. the name of the top-level list that you want), then root[sel_case] will give you the actual reference to the list. The special root variable refers to the “top-level” / “root” node in your Perchance “tree” of lists/sub-lists.
Heads up that __currentPerchanceErrorCount, and all other global variables that begin with __ are “private” (engine-internal) variables, meaning that I may change their name at any time, causing generators to break that were using them. As I mentioned to Bluepower, if you find a variable in the console, you should first check if it’s officially documented (likely on perchance.org/advanced-tutorial ) before using it, and if it’s not, then it should be assumed to be private.
One approach that might work here is to load your feedback button as the very first thing on the page - i.e. before any of the code that could have errors. That way there’s always a feedback button hovering in the corner of the page. Or you could have a “loading screen” that sits in front of all your content, and has a feedback button in the middle, and that loading screen is deleted/hidden once you’ve detected that the page has successfully loaded.
It basically allows you to specify to different colors - one for if the user’s device is in light mode, and the other if they’re in dark mode. Here’s an example gen showing how to use it:...
(For future reference, there are actually a lot of example generators built and so if you type “drop down selector to choose list perchance” into google, the above link is the first result :) Also, if you wouldn’t mind, please edit your post’s title to be a summary of your question - that way it’s more easily findable via Google, which helps others who happen to type their question in a similar way that you summarized it, and so reduces the need for people on this forum to answer lots of duplicate questions. Thanks!)
Not sure when this problem happened, but if you take a look at perchance.org/a-testing-gen which has an embedded Perchance page to perchance.org/b-testing-gen, the changes on the embedded generator /b-testing-gen, isn’t applied on the iframe on /a-testing-gen....
Thank you! Should be fixed now. Sorry about that - accidentally introduced that bug when fixing the null subdomain query params issue that you reported. I was adding “?” to end of the redirect URL even when there weren’t any query params, which messed with the Cloudflare cache clearing code.
Don’t know where we’d be without all your excellent bug reports 🙏
Currently in the Generators Page chat, everyone has a blue tag xcept F1EX. Was thinking what we can do and realized: hey, in comments, can we please have an option to choose our tag colors?
Hmm, yeah this has been asked for before, and the reason I haven’t done it yet is because it would make it easier for people to impersonate others. I.e. set their nickname to the same, and set their color to the same, and then rely on people not noticing that the letters are different. This might not trick many people, but it would make it more annoying since there’s a lower chance of at-a-glance check being correct.
Ideally I’d replace the letters with a dingbat font or something so there’s more visual distinction between the tags. Also now that usernames are a thing, this potentially makes the impersonation issue less relevant. I’m still a bit indecisive on this one though…
Fair point! I think I can fix this (using MutationObserver), but it’ll need to be opt-in (e.g. via an extra keyword like @includeProgrammaticInputs or something [but ideally shorter…]), since it’s a “breaking change”. But before I do: Another flaw is that you can’t choose to only remember specific inputs, right? My memory is a little fuzzy and I can’t see anything about that on the page or in the code. If so, I’ll try fixing both issues at once.
Ah good point. I think for this what I’d ideally need is a global ‘onUpdate’ function so plugins can ‘do something’ when the update function is called (as happens with the auto-reload checkbox thing). There are hacky ways to do this (effectively “wrapping” the update function), but it might be about time for a proper solution.
Thanks for this! I was just looking into it, and I noticed this comment at the bottom of the code in create-instance-plugin:
<span style="font-style:italic;color:#969896;">// Important counter-intuitive thing to take note of: https://www.reddit.com/r/perchance/comments/nh31xq/the_best_hack_for_methods_in_list_instances/gz0rebt
</span><span style="font-style:italic;color:#969896;">// the "deep" option of the createInstance plugin is kinda messed up. I should warn people that the [child] list should ONLY have properties - no sub-lists. That basically solves everything, but it's a bit annoying in many cases. Ideally I'd have only called selectOne on a list if it has no properties (i.e. with equals sign). If it has properties it should be treated just as part of the hierarchical blueprint, and those sub-items should get fixed, rather than having selectOne called on it.
</span><span style="font-style:italic;color:#969896;">// I basically need a new plugin. createInstance2 = {import:create-instance-2-plugin}
</span><span style="font-style:italic;color:#969896;">// That's the ideal solution here.
</span><span style="font-style:italic;color:#969896;">// https://perchance.org/hiad2okk9w
</span>
Which, IIUC, is exactly what you’re talking about here.
So I was reluctant to make that change back then due to potentially breaking peoples’ generators. With the number of generators that use this, it’s possible that people are “using” this ~bug. On the other hand, it is hard to see why someone would use “deep”, and not want the deep properties fixed. It does seem like the current behavior would be causing more pain to people trying to use it right now than the pain caused by breaking old generators that actually wanted random sub-sub-properties even though they used the “deep” mode.
I.e. seems like the generator would already have to be “buggy” for this change to cause any issues. Hmm. Yeah, on balance this does seem like it should be categorized as a bug, and fixed. The lower-level lists should be treated just like the upper-level lists - intuitively, that’s exactly what is meant by “deep”. Thoughts?
Hmm. Thinking about this more, I’m really reluctant to do this in case it breaks old generators - even though it’s hard to imagine someone relying on this ‘bug’ on purpose. So what I might do instead is expose a new window.generatorLastEditTime variable (like window.generatorName and window.generatorPublicId), and only enable the new behavior if the last save time of the generator is newer than today. So if people are still actively working on their generator now then they’ll get the new behavior, and if it does break something they’ll be able to notice and fix it. But for old generators, they get to keep the old behavior until the author comes back to it and makes an edit.
I think that strikes a good balance here. What do you think?
Hmm, I think I misunderstood some stuff with my earlier comments. With the caveat that this is frying my brain a little, I think there are cases that this change would break - e.g. perchance.org/bm1vp6py5a#edit Try swapping the plugin import to see the behavior change.
If it turns out it isn’t really possible to fix this issue, then it may be time for me to make a new plugin which fixes this issue and some others, and perhaps introduces some handy features that people tend to need. Let me know if you have any requests in that department - e.g. everything gets fixed by default, but if a property name begins with * (or something), like *foo, then character.foo would be a random property, instead of being fixed/resolved. And another thing I think is to call evaluateItem after selectOne if the selected item has no children. Not sure though - would definitely need feedback on this from people who use the plugin extensively.
Another alternative is to just add an extra “mode” to create-instance-plugin (like the existing “deep” one), which fixes all the issues and makes everything intuitive, but that might make it a bit more complicated and cumbersome, since the behavior would vary so much, which could be confusing to newbies.
Hello all. For the past few days, I’ve not been able to generate images. When I try, all that comes out of it is “starting” with a loading circle. Is this just me, or is anyone else getting this?
Thanks for reporting this issue! It’s working fine for me in Chrome, so it might be related to a Chrome extension that you have, or some other issue specific to your machine. If you click your profile pic in chrome in the top-right, and then click “Guest” it’ll open up a browser window without any Chrome extensions enabled. See if it works in that window.
Also, in normal browsing mode (i.e. not Guest), can you please press Ctrl+Shift+J while on that page, and see if there are any red messages in the console that appear after a few seconds? Please screenshot if possible.
So, after a bit of testing with the example from the super-fetch-plugin, I’ve tried different kinds of websites and it worked, including a URL from comments-plugin.perchance.org, which I got from inspecting a comments plugin iframe from the DevTools. But in this case, not from user-uploads.perchance.org, it kept having the...
Sorry about that - this has randomly happened to me a few weeks ago too. I think an erroneous response is getting cached in the browser sometimes. I’ve added a fix so this won’t happen with super-fetch-plugin. Previously perchance upload URLs were skipping the proxy because it’s actually not needed (perchance uploads allow normal fetch from perchance generators), but due to this cached error thing I’ve made it so it falls back to using the proxy if there are any issues with a normal fetch. I’ll hopefully get a chance to look into the root cause soon.
TL;DR: It should work fine now, regardless of the browser caching the rare error responses. Thanks for the bug report! Thought it might have just been something weird with my browser, so I didn’t fix it when I came across it.
No, it must be user-uploads.perchance.org URL. I don’t like seeing generators break, due to people using random file hosts that later shut down (or worse, using random links to e.g. pinterest images, fandom/wiki images, etc. which are often only temporary CDN urls), so my plugins in the future will require using perchance URL uploads in most cases.
(To be clear, since I realized just now that to non-devs the title might be misleading: This feature does not add AI bots to your comments plugin by default! The comments plugin and the AI plugins are completely distinct. But plugins can of course interact with one another, and this new feature of the comments plugin allows for...
Can someone please help me? My generators are perpetually stuck as starting when I try to use a text to image generator!! It’s been like this for weeks, and I don’t know what to do. someone please help!
Thanks for that! So the problem is that the anti-bot verification is failing. Next step is to work out why. Can you show screenshots of the console in Guest mode? i.e. click the profile pic in the top-right of a normal chrome window (next to the 3 vertical dots) and click “Guest”. This will open a browsing session with all Chrome extensions disabled. Then open the console and see if you get the same “Cloudflare Turnstile” errors. Screenshot the logs you see there.
Also, some questions:
Is there anything unusual about your internet connection? Or is it just a regular home ISP? Or business connection? etc.
If you visit ip-api.com and scroll down to the data on your ISP, does it say this at the bottom:
How do I reference a list by string?
So I’m trying to make a randomizer for the game PC Building Simulator. The problem is that not all parts are compatible with each other. I have this so far:...
[Request] Create a "Oops Something went wrong" page if a generator fails to load on Perchance (lemmy.world)
For me , whenever I load datasets into the Fusion Generator I have to be mindful on how many items I load into the generator upon start....
`color:light-dark(blue,lightblue)` is now available in all modern browsers - switch text/background/etc. colors automatically depending on whether the user's device is in light mode or dark mode
It basically allows you to specify to different colors - one for if the user’s device is in light mode, and the other if they’re in dark mode. Here’s an example gen showing how to use it:...
Seventh Sanctum Data Archives
I know there are a few people here who enjoy archiving - e.g. perchance.org/vionet20-abulafia-conversions...
[dev] If you've used `evaluateItem` on *strings* (rather than lists or list items), then please read this. This is likely only relevant if you're doing fancy JavaScript stuff in your generator.
First, some context:...
Need help with dynamic list selection
I want a system where a user selects from multiple lists via a dropdown menu, and the program outputs a random element from the chosen list.
[Bug (Fixed)] Embedded Perchance Pages on Perchance aren't updated
Not sure when this problem happened, but if you take a look at perchance.org/a-testing-gen which has an embedded Perchance page to perchance.org/b-testing-gen, the changes on the embedded generator /b-testing-gen, isn’t applied on the iframe on /a-testing-gen....
[incessant whining] comment tag color choosing
Currently in the Generators Page chat, everyone has a blue tag xcept F1EX. Was thinking what we can do and realized: hey, in comments, can we please have an option to choose our tag colors?
`[Casual]` Question.
Dear Perchance Dev,...
[Tip] A cute way to remember text inputs (without the `remember-plugin`)
This likely won’t be relevant to a lot of devs here, because the remember plugin does the job fine in most cases, but:...
[Bug/Suggestion] `create-instance-plugin` Doesn't Fix Deep Properties with Same Level Lists
Suppose we have the following list:...
Is image generation down? (lemmy.world)
Hello all. For the past few days, I’ve not been able to generate images. When I try, all that comes out of it is “starting” with a loading circle. Is this just me, or is anyone else getting this?
Super Fetch Plugin does not work with `user-uploads.perchance.org`
So, after a bit of testing with the example from the super-fetch-plugin, I’ve tried different kinds of websites and it worked, including a URL from comments-plugin.perchance.org, which I got from inspecting a comments plugin iframe from the DevTools. But in this case, not from user-uploads.perchance.org, it kept having the...
# News and discussion
Hello everyone. Today I have found /huge-emoji-list....
AI bots in your comments, and more: `c = commentsPlugin(options), c.submit("hello world!")` (perchance.org)
(To be clear, since I realized just now that to non-devs the title might be misleading: This feature does not add AI bots to your comments plugin by default! The comments plugin and the AI plugins are completely distinct. But plugins can of course interact with one another, and this new feature of the comments plugin allows for...
HELP-Generator stuck in a starting loop
Can someone please help me? My generators are perpetually stuck as starting when I try to use a text to image generator!! It’s been like this for weeks, and I don’t know what to do. someone please help!