[EOS] Selecting images with code(need consultation)

Post all technical issues and questions here. We'll gladly help you wherever we can.
Post Reply
13sever13
Curious Newbie
Curious Newbie
Posts: 4
Joined: Sun May 09, 2021 10:20 am
Gender: Male
Sexual Orientation: Open to new ideas!

[EOS] Selecting images with code(need consultation)

Post by 13sever13 »

So, I'm creating the tease and at some point, I had an idea of how to make progression more clear and meaningful for the user.
But for this to work I probably need several sets of pictures, and here is the problem:
How can I select the needed pictures? My original idea was to name the picture in each gallery with the same names and when I need the picture you just generate the path to it

Code: Select all

//where galleryName is based on the current progression level
var path = 'gallery:'+galleryName+'/'+pictureName;
But it seems like I can neither rename the pictures in galleries and not set the picture from the code.
Is there the only way to pull this off to create a cascade of IFs and select the picture that you want for every case you need by hand?
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: [EOS] Selecting images with code(need consultation)

Post by Thamrill »

13sever13 wrote: Mon Mar 20, 2023 10:24 am So, I'm creating the tease and at some point, I had an idea of how to make progression more clear and meaningful for the user.
But for this to work I probably need several sets of pictures, and here is the problem:
How can I select the needed pictures? My original idea was to name the picture in each gallery with the same names and when I need the picture you just generate the path to it

Code: Select all

//where galleryName is based on the current progression level
var path = 'gallery:'+galleryName+'/'+pictureName;
But it seems like I can neither rename the pictures in galleries and not set the picture from the code.
Is there the only way to pull this off to create a cascade of IFs and select the picture that you want for every case you need by hand?
Hi, unfortunately yes, pictures can only be set by the image action, so it cannot be set from code.
One thing you could do is download the script, add the actions by generating them by some other mean (e.g., creative use of excel) and then reupload the script in the editor. But it's a pain to do it like that and at the moment I don't have time to explain the possible workflow, sorry :unsure:
Image

Image

Image
13sever13
Curious Newbie
Curious Newbie
Posts: 4
Joined: Sun May 09, 2021 10:20 am
Gender: Male
Sexual Orientation: Open to new ideas!

Re: [EOS] Selecting images with code(need consultation)

Post by 13sever13 »

Hi, unfortunately yes, pictures can only be set by the image action, so it cannot be set from code.
One thing you could do is download the script, add the actions by generating them by some other mean (e.g., creative use of excel) and then reupload the script in the editor. But it's a pain to do it like that and at the moment I don't have time to explain the possible workflow, sorry :unsure:
But there is still a problem with the naming of pictures in the gallery. How do you write a script that inserts needed pictures when you don't really have a naming system(if you upload 2 pictures with the same name to different galleries their name will be different)?

To be honest, it feels awful(I Had a kind of cool idea and even workout some systems for tease but ended up with a problem accessing images from the code( Not sure what to do now, maybe I will make a regular app, but then the question rises how to publish it, don't really want to bother with this.

I'm not sure how it works yet, but isn't it possible to add image-action with pages.dispatchEvent()? But problem with the naming system in galleries will persist...
User avatar
indyc
Explorer At Heart
Explorer At Heart
Posts: 431
Joined: Sun Mar 28, 2021 10:03 pm
Contact:

Re: [EOS] Selecting images with code(need consultation)

Post by indyc »

I don't know the coding enough so I don't know if it is possible but wanted to mention another avenue for those who want to explore it: You can upload your pictures in the files and have them called whatever you want. It might be possible for evals to call up an image in this form but I'm not sure.

I am constantly trying to create EOS workarounds using the tools that I already know and can pull off quite a bit. If you want to send me a message with what exactly you are trying to accomplish I might be able to let you know how to execute that without any additional fancy code. Depending on how many pictures you need to do in this way, copy pasted if statements with comments might be the avenue. Having each page have it's own image would be another way to do it but that might not work with your dialog flow.
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: [EOS] Selecting images with code(need consultation)

Post by Thamrill »

13sever13 wrote: Mon Mar 20, 2023 12:17 pm
Hi, unfortunately yes, pictures can only be set by the image action, so it cannot be set from code.
One thing you could do is download the script, add the actions by generating them by some other mean (e.g., creative use of excel) and then reupload the script in the editor. But it's a pain to do it like that and at the moment I don't have time to explain the possible workflow, sorry :unsure:
But there is still a problem with the naming of pictures in the gallery. How do you write a script that inserts needed pictures when you don't really have a naming system(if you upload 2 pictures with the same name to different galleries their name will be different)?

To be honest, it feels awful(I Had a kind of cool idea and even workout some systems for tease but ended up with a problem accessing images from the code( Not sure what to do now, maybe I will make a regular app, but then the question rises how to publish it, don't really want to bother with this.

I'm not sure how it works yet, but isn't it possible to add image-action with pages.dispatchEvent()? But problem with the naming system in galleries will persist...
In the offline editor I'm working on the process would be: upload all pictures that you need, download the script, then match picture with gallery entry by means of the figure hash (in the script is reported the SHA-1 of the image file) to get the file identifier
Image

Image

Image
Thamrill
Explorer At Heart
Explorer At Heart
Posts: 265
Joined: Thu Jan 03, 2013 4:55 pm
Gender: Male
Sexual Orientation: Straight
I am a: Submissive

Re: [EOS] Selecting images with code(need consultation)

Post by Thamrill »

indyc wrote: Mon Mar 20, 2023 1:34 pm I don't know the coding enough so I don't know if it is possible but wanted to mention another avenue for those who want to explore it: You can upload your pictures in the files and have them called whatever you want. It might be possible for evals to call up an image in this form but I'm not sure.
I'm 99.999% sure that you cannot define image programmatically even from the files
Image

Image

Image
verynicekojak
Explorer
Explorer
Posts: 88
Joined: Fri Aug 19, 2022 10:05 pm

Re: [EOS] Selecting images with code(need consultation)

Post by verynicekojak »

I think that in general you can not load a resource (sound or image) with dynamical generated name.

You can make a page with 1000 IFs* and then activate only one of them. There is a small problem: all resources from a page are preloaded, so it will take 1000x time even if you only select one image/sound.

You can make 1000 Pages* with one image/sound. Then it would be probably efficient but list of pages would be really long. And I don't know if this list is preloaded somewhere.

*You can create IFs or Pages manually or by downloading your tease, editing the file, and reuploading.
Yo_Boy_123
Explorer
Explorer
Posts: 26
Joined: Sat Sep 04, 2021 7:15 am

Re: [EOS] Selecting images with code(need consultation)

Post by Yo_Boy_123 »

I can't explain how to replicate it (I barely know how to use it lol), but Fapnip has helped me with code to do something similar to this-essentially, you code a function in your init script that allows you to be on a page that is executing actions, then goes to a page whose only purpose is to house the images-this solves problems with pre-loading many files, as well as the tedious nature of manually making if statements.

After you have displayed the image you're looking for, the image page returns you to the page executing the code. This allows you to circumvent trying to call images through code, by allowing you to essentially substitute image file names for page names.

If I'm not mistaken, they use similar code to run their Fapjack tease There's a fantastic write up on that tease here here. I'm not sure if what's there is exactly what you're after, but I hope that it can at least provide some ideas or a basis to move forward.

I can't contribute much to the code itself, but I can try and help with brainstorming or troubleshooting.
spugbutter
Explorer
Explorer
Posts: 46
Joined: Tue Feb 15, 2022 11:11 pm

Re: [EOS] Selecting images with code(need consultation)

Post by spugbutter »

Yo_Boy_123 wrote: Wed Mar 22, 2023 7:09 am Fapnip has helped me with code to do something similar to this-essentially
I am trying to learn EOS by looking at other teases. fapnips are hard to understand but I think faptris has code like that.
I can see it by going here https://milovana.com/eos/editor/60808/options/init
it shows the init script and all code in it. There is much I can not understand. I think there is function for faptris game and function for images.

pages with images start here https://milovana.com/eos/editor/60808/e ... set-alaina

code loading image pages I think I found here https://milovana.com/eos/editor/60808/e ... t/action/1

in loading page fapnip added instruction to make image pages
/*
To quickly generate image pages from galleries, you can use AutoAnimate:
https://codepen.io/fapnip/full/abLOyPE

1. In AutoAnimate, paste in the tease URL with galleries you
want to create image pages for
2. Select the gallery you want pages for.
3. Select "Execute JavaScript" for the "after animation ends"
option
4. Enter "backPage()" in the text box that shows up below it.
5. Switch on "Show features you probably don't want"
6. Enable "Break animation by removing timers, animation
scripts, etc."
7. Optionally enable "Don't nest animation in an IF".
For multiple images per page, you may want to leave
this disabled.
8. If you'd like to have multiple images per page,
Enable the "Put each image in an IF [expression]===[index]
action" option as well.
9. If you have NOT enabled "Put each image in an
IF [expression]===[index] action" you MUST set the split
level to 1 for 1 image per page image sets
(*** Use the icon just to the left of the trash can
under the preview pane to set split level. ***)
10. Enter an applicable page prefix, like "zzz-img-modelName"
11. Select "Add Animation to Tease"
12. Click the blue button to download the JSON
13. In Eos, restore JSON to a new tease or backup your
original and restore JSON to existing tease.
14. Add var myImageSet = buildSetArray(...) lines to
your init script and use them
(see below for examples)


Yeah, it looks like a lot of steps. It's really not that hard.
*/
I do not understand how to use it. I see this page but not how it is used
https://milovana.com/eos/editor/60808/e ... -loadimage
spugbutter
Explorer
Explorer
Posts: 46
Joined: Tue Feb 15, 2022 11:11 pm

Re: [EOS] Selecting images with code(need consultation)

Post by spugbutter »

I thought fapnips queens gambit would be like faptris but it looks much different.
I think this chooses image based on calculation of captured pieces
https://milovana.com/eos/editor/49226/e ... e/action/0

then goto pages like these
https://milovana.com/eos/editor/49226/e ... il-image-0
https://milovana.com/eos/editor/49226/e ... il-image-1

I do not understand all of it but it looks much more simple from faptris.
Yo_Boy_123
Explorer
Explorer
Posts: 26
Joined: Sat Sep 04, 2021 7:15 am

Re: [EOS] Selecting images with code(need consultation)

Post by Yo_Boy_123 »

After a bit of tinkering, I've come up with a system that should allow you to do what you've been asking about, OP. The code isn't particularly robust or streamlined, but I hope that it can function at least as something to work off of.

Here is the Test Tease I made, which shows off a basic A/B image choice, and an choice made based off how many times the player does an action. You should be able to view the code, but if needed I can figure out a way to make it available.

Please feel free to ask any questions you may have, I tried to leave as much information in the code comments as I could, but I'm sure there's something I've left out. In general, I would advise you to be very mindful of the order in which you place your code. This setup is really porous, and it's up to you to make sure you've got your ducks in a row :-)
User avatar
indyc
Explorer At Heart
Explorer At Heart
Posts: 431
Joined: Sun Mar 28, 2021 10:03 pm
Contact:

Re: [EOS] Selecting images with code(need consultation)

Post by indyc »

Yo_Boy_123 wrote: Mon Mar 27, 2023 8:31 am After a bit of tinkering, I've come up with a system that should allow you to do what you've been asking about, OP. The code isn't particularly robust or streamlined, but I hope that it can function at least as something to work off of.

Here is the Test Tease I made, which shows off a basic A/B image choice, and an choice made based off how many times the player does an action. You should be able to view the code, but if needed I can figure out a way to make it available.

Please feel free to ask any questions you may have, I tried to leave as much information in the code comments as I could, but I'm sure there's something I've left out. In general, I would advise you to be very mindful of the order in which you place your code. This setup is really porous, and it's up to you to make sure you've got your ducks in a row :-)
Because you said you need to find a way to make it available this is the link to the json: https://milovana.com/webteases/geteossc ... 06ed166499

You can take anyone's tease link and change showtease with geteosscript to get anyone's json you can import.

Thanks for working on this! I have lots of uses for it once I figure it out.
Yo_Boy_123
Explorer
Explorer
Posts: 26
Joined: Sat Sep 04, 2021 7:15 am

Re: [EOS] Selecting images with code(need consultation)

Post by Yo_Boy_123 »

indyc wrote: Tue Mar 28, 2023 2:52 am
Because you said you need to find a way to make it available this is the link to the json: https://milovana.com/webteases/geteossc ... 06ed166499

You can take anyone's tease link and change showtease with geteosscript to get anyone's json you can import.
Thanks for the info! I'll keep that in mind in the future.
Thanks for working on this! I have lots of uses for it once I figure it out.
I'm glad I could contribute in some way to others' efforts-excited to see the results.
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests