perchance

joined 1 year ago
MODERATOR OF
[–] perchance 3 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

The issue is this line in your lists editor:

s = [mob.selectOne]

This means that every time you use s it'll select a new random item from mob. The reason for that is because you've made s equal to [mob.selectOne] instead of mob.selectOne. The square brackets around it effectively make it "dynamically fetched" each time you access s.

(Aside: Also note that the lists editor isn't "executed" each time you click your generate button. It's not a list of instructions which get executed line-by-line. The square blocks in the HTML editor on the other hand do get executed line-by-line each time you click the generate button. Think of the code in your list editor as a "static" structure which can be used by the square blocks in your HTML editor.)

So you need to add [s = mob.selectOne, ""] in a place where it'll get "executed" with every generate button click, so a new s is generated with each click, but it stays the same when executing all of the other square blocks that come after it.

So you could add this line before [output] in your HTML editor:

[s = mob.selectOne, ""]

Each time your "Generate" button is clicked, the update() function is called, and that causes all the square blocks in the HTML code to be executed from top to bottom. So it ensures that we've randomly selected a mob item and put it in the s variable before the output list is executed (which uses the s variable).

Here's a fixed example: https://perchance.org/ylx7fmwpql#edit

(This issue has unfortunately been the source of a lot of problems for newbies learning Perchance, so you're not alone in being confused by this!)

[–] perchance 2 points 3 weeks ago* (last edited 3 weeks ago) (2 children)

It seems like there might be an ISP in the Philippines that is blocking Perchance. I'm not sure why. If you are in the Philippines, then you could try getting a free VPN chrome extension, or install https://one.one.one.one/ (which is a reputable free VPN by Cloudflare) and let me know if that fixes it for you.

[–] perchance 3 points 3 weeks ago

I'd need more info, since I can't reproduce it. If you can send a share/save link (or save file via google drive or whatever), then I would probably be able to fix it instantly. Or you can give me exact steps to reproduce it. E.g. "start a new rpg, go continue until summary happens, ..." Please make sure you test the reproduction instructions to confirm that you can reproduce the issue (i.e. don't just guess that it'll happen again, please actually start from scratch and test it). Again though, easiest way is if you have an existing game that you can share, and just generate a share link using the button at the bottom. You can DM me or share it in this thread.

[–] perchance 2 points 3 weeks ago

Thanks! That should be fixed now

[–] perchance 3 points 3 weeks ago (4 children)

Hi, sorry about this, seems like quite a few users are having the same problem, but I'm not sure what the cause is yet. The more info you can give here, the faster I'll be able to solve it. Some questions that should allow me to narrow down the cause:

  • Can you please screenshot what's shown when the page won't load, and share it here?
  • Do you remember the last time it worked (approximate day+time), and the first time you noticed that it wasn't working (again, approx day+time)?
  • Can you test on multiple browsers, and ideally multiple devices (e.g. phone + laptop), and ideally multiple internet connections (e.g. phone data + wifi)? This will help narrow down whether it's a browser issue, device issue, or network connection issue.
  • If it works in one browser, but not the other, please also test in "incognito" / "private browsing" mode, or "guest mode" of the non-working browser.
  • Are you using normal wifi at home? Or is there anything unusual about the internet you're using (e.g. school network, or special "firewall", etc.)
  • Can you try visiting these two links and letting me know if they work? This will let me know if there's a specific "part" of the server that's causing the error.
[–] perchance 3 points 3 weeks ago* (last edited 3 weeks ago) (2 children)

The Perchance site itself doesn't block people¹, so it's likely some sort of network issue. It could be something to do with the network you're using, or with Cloudflare, or with a network-level firewall, or some combination. Questions:

  1. What error message does it show? Can you screenshot it?
  2. Are you using an unusual/uncommon web browser? The fact that you've tested ipad and pc makes me think no.
  3. Do you have another network/connection that you can test with? E.g. hotspot on phone? To see if your computer/ipad loads it fine on a different connection.
  4. This shouldn't be relevant anyway, but out of curiosity, if you visit https://ip-api.com/ and scroll down to the mobile and proxy and hosting values, do they say true or false?
  5. Is the network a school/workplace/university/etc.? Some schools have block-lists for game/entertainment related websites, and it's possible perchance has been blocked by that.

¹ Note: You can get blocked from e.g. participating in comments sections (and VPNs are blocked from commenting by default due to spam and block-evasion), but you can never be blocked from simply viewing/using a generator.

[–] perchance 3 points 1 month ago* (last edited 1 month ago)

I'd been putting this off for quite a while because I thought it'd require a database restructuring, but I realized just now that there's an easy way to do it, so it's done. Thanks for nudging me again on this! (IIRC you [and several others] asked for this feature quite a while ago)

Currently it just allows you to change the channel and submit again. It's a bit annoying imo - ideally you'd be able to have a list of pinned channels names and just tap the channel name to send it there. But less annoying than before, for sure. Please bug me to improve this at your leisure.

Also, side note: I really need to finally get around to upgrading the image models themselves. This is very high on my priority list, and it should result in a pretty substantial improvement in image quality and prompt comprehension. I'm always a bit too optimistic, but I'm hoping to finally get this done within the next few weeks - fingers crossed.

[–] perchance 1 points 1 month ago* (last edited 1 month ago) (1 children)

Thanks! Should be fixed now. I think it would have occurred in cases where the image gen iframe was removed just after the image finished generating.

[–] perchance 2 points 1 month ago* (last edited 1 month ago) (1 children)

Unfortunately a 13B model probably isn't going to cut it. Perchance uses a popular open source 70B Llama-based model (you'll come across it's name almost immediately if you look at top model lists, but any of the top models will work fine - and you should use the recommended parameters in the HuggingFace repo). If you can't run a 70B models, then I'd recommend these two places to find a 30B/20B/13B model to suit your specific use case, depending on your GPU size:

This community is not well-suited to helping you get it set up, but the above two communities have lots of info.

[–] perchance 3 points 1 month ago* (last edited 1 month ago) (1 children)

Yep you summarized it well, thanks! The only thing I'd mention, is about this dot point:

Later on (as long as the local storage is not cleared) you can navigate again to that newly created page (while still not logged in into an account) then enter the edit password after clicking save to return back/apply your changes to the generator.

The "as long as the local storage is not cleared" part can be removed - as long as you have the password, you can edit it. So e.g. you can share the edit password with a friend and they will be able to edit the generator too. But note, if you're editing at the same time as your friend, you'll overwrite one another's work. Once I get the upgrade to CodeMirror 6 done, I'd like to add real-time collaborative editing (like a google doc, via a simple link you can share with your collaborators) so this won't be an issue.

Also @[email protected] the signup issues should hopefully be fixed for real this time, but do let me know if you hear of any more reports about this.

[–] perchance 2 points 1 month ago

Thanks for the heads up! I'm trying to get syntax highlighting for Perchance code working with CodeMirror 6, and if I do then I'll need to completely replace the search stuff. So I'll hold out on fixing this for now - but please ping again if I've not done this in a few weeks.

 

For example, if you've made a world building religion generator, and you title it "The Arch Bible" or something like that (i.e. something that's more of a "brand" than a "description"), then people won't be able to use a web search engine to find it unless they already know its name. In other words, people don't search for "The Arch Bible" when they want to find a religion generator - they of course search something like "fantasy religion generator" or whatever - so make sure you put keywords like that in your $meta.title/$meta.description if you want to make it easy for others to find it.

Search engines heavily weight the page title in their search, so it definitely pays to have a $meta.title which appropriately summarizes what your generator does in a few words. It's fine to have something like "Fantasy Religion Generator - The Arch Bible" as your title - i.e. a description, plus a "brand". Just don't leave out the key descriptive terms.

I'm writing this post because I don't think people realize how the "popular" generators on Perchance actually tend to get popular - it's one of two things:

  1. (rare & temporary) The generator happened to go viral on social media somehow.
  2. (common & long-term) The generator's title and/or description was descriptive, and so random people around the world each day hit their page via a Google search, which can add up to thousands of visitors in just a few months if it's a popular "topic" that people search for.

Popular generators almost always get popular via #2, and #2 often eventually leads to #1 - i.e. people find it via a search engine, and then share it with their friends on social media, and then at some point (for whatever reason) it goes viral. I think people tend to incorrectly assume that #1 is the main factor in a generator's popularity (it can be, but it's rare).

TL;DR: Use appropriate descriptive terms in your title and description if you'd like your generator to become well known. Think about the sorts of keywords that people would type into a search engine to find your generator.

8
submitted 8 months ago* (last edited 8 months ago) by perchance to c/perchance
 

Unfortunately for now it's just phrase banning (with regex pattern-matching supported) and user ID banning - i.e. no ability to "login" and delete stuff, like you can do with the comments plugin. Hopefully this will suffice until I get around to making it easier (I want to make moderation easier on comments plugin at some point too - e.g. 1-click bans alongside existing 1-click delete).

There may be bugs! Please let me know if you find one in the comments below. I haven't thoroughly tested it, so I'm relying on y'all :)

Edit: Also, a reminder that when I'm short on time (like lately) I'm most likely to fix things that people complain about often. Thanks to Allo and others for posting and complaining about this. Feel free to complain repeatedly and tag me often. It helps me prioritize.

 

Note that the 'auto' checkbox doesn't actually clear variables - it just fully re-executes all the square/curly blocks in the HTML. So if you're doing stuff where your code needs variables to be "cleared"/fresh before the first generation, then you'll have noticed that you actually need to click the 'reload' button (or refresh the whole browser tab) to get your generator back to a completely "fresh" state. But, as the annoying message would inform you, clicking the reload button required saving your generator first. That's not required any more. I should have fixed this about 6 years ago. Took about 15 mins 😐

2
[dev] Upload Plugin (perchance.org)
submitted 1 year ago by perchance to c/perchance
 

New plugin: https://perchance.org/upload-plugin

This plugin is like https://perchance.org/upload except in 'programmatic' form. So you can allow users to e.g. upload their generated text with a button click, and get the resulting URL to share with their friend.

It does not require the user to be logged in, but as a result, the daily allowances (based on IP address) and max file sizes are significantly smaller than with perchance.org/upload - see plugin page for details.

As an example of what you can do with it: I just used it to add a feature to https://perchance.org/ai-chat where you can easily share the AI character that you've made via a link.

 

Just a little demo/example for now - feel free to fork and play around with the instructions and stuff, of course! https://perchance.org/ai-generated-hierarchical-world

 

Currently notifications aren't supported on mobile, and also you won't get notifications if you don't have a perchance comments section open somewhere on your computer. It doesn't matter which comments section you have open (i.e. it can be on any generator/page, regardless of which particular comments boxes that you've subscribed to), but it needs to be visible somewhere.

Also, some browsers will "hibernate" a tab that is backgrounded/inactive which will pause the notification script, so it's best to pull the browser tab out into its own browser window so that the tab is deemed "active"/visible by your browser - that way it won't "hibernate" the tab.

So, with the above caveats, you now have a crude way to get notified if someone comments on your generators! Or when people are active at your favorite hang out spot, etc. The caveats are annoying, but it's the first step! Please give feedback if there are any issues - I may not be able to fix them, or at least may not be able to fix them right away, but it'll be helpful to hear about the most annoying issues so I can plan future improvements here.

5
submitted 1 year ago* (last edited 1 year ago) by perchance to c/perchance
 

Example generators made with this plugin:

See the plugin page for more. There will probably be issues/bugs! Thank you in advance to the pioneers who test this and report bugs/issues in these first few days/weeks 🫡

(It was actually possible to discover this plugin a few days ago, but no one made it through all the clues lol ^^ some people did at least figure out the first step)

 

Wondering if someone can get in contact with Raggedflight to ask if they'd like to donate the link-plugin to the admin account so I can put it into the official plugin list? Credit to Raggedflight would be added at the top of the page just like in https://perchance.org/image-plugin of course. No worries if they'd rather not!

2
URL Params Plugin (perchance.org)
submitted 1 year ago by perchance to c/perchance
 

Simple example usage: https://perchance.org/url-params-plugin-example?blah=abc123

It's really simple:

url = {import:url-params-plugin}

output
  [url.blah] // this will output 'abc124' if URL has '?blah=abc123' on the end

This plugin allows you to, for example, have several "different" generators within the same generator page, where each sub-generator has its own URL. Or to just adapt the output of your generators based on the URL. E.g. you might have an English and a French version of your generator with URLs like this:

In that case, within your code you can use [url.lang] to determine which language the user is viewing, and adjust your list selection/odds/etc. based on that.

You can also use it to e.g. link directly to a particular seed for the seeder plugin, and stuff like that.

(Note for experienced Perchance users: The old document.referrer hack is no longer required since Perchance now copies all parameters over to the iframe when initializing it)

5
submitted 1 year ago* (last edited 1 year ago) by perchance to c/perchance
 

For images and other files that you need for your generators/plugins/etc. - rather than using base64 strings, or external file hosting services like catbox.moe

https://perchance.org/upload

 

Previously all generators shared the null.perchance.org subdomain, but now thanks to Cloudflare moving wildcard DNS from the enterprise plan to the free plan (announcement post) I've given each generator its own subdomain. I really should have done this a year ago when they announced it - just got around to it today.

I've added some code to transfer localStorage data across to the new subdomains, but unfortunately this code has to run the first time you visit any generator, and causes a refresh to happen a second or two after page load. This'll be a bit annoying, but I can remove this code after a few months - it's just to make sure that any important data is transferred across. If someone hasn't visited a particular generator in a few months, then the localStorage data (e.g. from the remember-plugin) probably isn't very important (and if it is, it's still recoverable - they'd just have to make a post here on the lemmy community to get help on how to do it).

If, for some reason, you need to easily & programmatically access the new subdomain, you can use the global generatorPublicId variable (akin to generatorName which already existed). The full URL of the embedded iframe is https://${generatorPublicId}.perchance.org/${generatorName}. The null versions of generator embed URLs are auto-redirected to the new generatorPublicId versions, so you can still embed your generator in other websites using the normal embed code:

<iframe src="https://null.perchance.org/my-generator-name" style="width:100%; height:600px; border:none;"></iframe>

That iframe will redirect to:

https://50e67e76966106ad99d72edb729943b7.perchance.org/my-generator-name

Please let me know if you run into any troubles with this, or have any feedback/suggestions .𖥔 ݁ ˖

view more: ‹ prev next ›