[HELP] Multi galleries ON\OFF option

All about the past, current and future webteases and the art of webteasing in general.
---
Post Reply
Epton
Explorer At Heart
Explorer At Heart
Posts: 112
Joined: Sun Mar 05, 2017 9:56 am

[HELP] Multi galleries ON\OFF option

Post by Epton »

I have 6 galleries, and I wish to create an option to toggle on/off certain galleries.
I was wondering if there is a way to do it. I think I saw a tease a few years ago that managed to do it, but unfortunately I don't remember which it was nor could I find it...

The only thing that comes to mind is to have lots of galleries combinations, upload the relevant pictures to the comb and then use EVAL and IF to filter through them. (A,B,C,D,E,F, A+B, A+C, A+B+C, A+B+D etc...) but I think it would be simply waste of storage for quite of a simple tease :whistle:...

Is there a way to make it work and more efficient? :unsure:
Nice-Log
Explorer
Explorer
Posts: 37
Joined: Thu Dec 01, 2022 8:37 pm

Re: [HELP] Multi galleries ON\OFF option

Post by Nice-Log »

I'm not entirely sure what you mean, if you're using the random picture from a gallery in the picture command, then I'm pretty sure the only way is to create a bunch of galleries, one for each potential combination. Maybe you could use eval and if functions to pick randomly from a few picture commands which gallery to choose from. Then you could program in conditions to exclude certain galleries. Will try to make up an example of this later to show.
Roblsforbobls
Explorer At Heart
Explorer At Heart
Posts: 264
Joined: Tue May 21, 2019 2:27 am
Gender: Male
Sexual Orientation: Asexual
I am a: Switch

Re: [HELP] Multi galleries ON\OFF option

Post by Roblsforbobls »

Epton wrote: Sun Apr 16, 2023 9:13 pm I have 6 galleries, and I wish to create an option to toggle on/off certain galleries.
I was wondering if there is a way to do it. I think I saw a tease a few years ago that managed to do it, but unfortunately I don't remember which it was nor could I find it...

The only thing that comes to mind is to have lots of galleries combinations, upload the relevant pictures to the comb and then use EVAL and IF to filter through them. (A,B,C,D,E,F, A+B, A+C, A+B+C, A+B+D etc...) but I think it would be simply waste of storage for quite of a simple tease :whistle:...

Is there a way to make it work and more efficient? :unsure:
Ok, take this with a grain of salt because I barely know the principles of basic coding and definitely don't know exactly how to do this myself... but here's the approach I would try:

So your goal is to pick a random image from a random gallery, but the problem is you want the player to be able to remove one or more galleries from the pool.

In the Initial script, let's make an array called "Galleries" with the names of all the galleries.

Code: Select all

var Galleries = [
  'GalleryA',
  'GalleryB',
  'GalleryC',
  'GalleryD',
  'GalleryE',
  'GalleryF'
  ]
If the player deselects a gallery in the game, you can use "pop" in an eval to remove that gallery from the array; if it is selected again, you can add it back into the array via eval action. I haven't actually used pop or other array editing techniques in Eos so I'm hoping they will work lol

Ok, it's time to pick a gallery... Use this eval to pick a random string from the array:

Code: Select all

var RandomGallery = Galleries[Math.floor(Math.random()*Galleries.length)]
and this will assign the string 'GalleryX' (where X is the gallery randomly selected) to the variable RandomGallery. Now you just need six If actions, one for "if RandomGallery is 'GalleryA', then pick random image from GalleryA", etc.


Hopefully this method works! I haven't personally done all of these steps in Eos so I'm not sure they actually work. Again I am not an expert in Eos and a complete coding newb so beyond this general roadmap I'm not sure I'll be much help. Please let me know if it works for you, because I may want to do a similar thing in the future myself! Good luck
Post Reply

Who is online

Users browsing this forum: ethanhunt098765 and 21 guests