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 ...
Is there a way to make it work and more efficient?
[HELP] Multi galleries ON\OFF option
Re: [HELP] Multi galleries ON\OFF option
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.
-
- 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
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: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 ...
Is there a way to make it work and more efficient?
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'
]
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)]
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
Who is online
Users browsing this forum: ethanhunt098765 and 21 guests