Eos programming question

All about the past, current and future webteases and the art of webteasing in general.
---
Post Reply
sirveillance
Explorer
Explorer
Posts: 17
Joined: Mon Oct 31, 2011 1:25 pm

Eos programming question

Post by sirveillance »

Hi, i am working on a tease. There are always two connected images - one censored, one uncensored. My Idea was this:
I have a image folder with images-a and one with images-b and the files are named the same.

when loading images-a/image1.jpg i want to save the filename and load later the same filename from images-b

but it seems there is no way to access or read the filenames? is there a workaround?
fapnip
Explorer At Heart
Explorer At Heart
Posts: 430
Joined: Mon Apr 06, 2020 1:54 pm

Re: Eos programming question

Post by fapnip »

Unfortunately, as far as I know, you can't dynamically reference image paths. But you can dynamically reference pages.

Best thing I've found is to have a bunch of simple pages that are dedicated to rendering the image. Then define global functions/variables in your global init script to manage them like:

In your Global Init Script

Code: Select all

var imageMode = 'nude'
var loadedImagePagePath = null
var imageCaller = null

// sets image mode
setNudeNonNude(nude) {
    imageMode = nude ? 'nude' : 'nonnude'
}

// Loads image page (image page will need to call: returnToImageCaller())
loadImage(image) {
    var imagePagePath = 'images-' + imageMode  + '-' + image
    if (loadedImagePagePath !== imagePagePath) {
       // we need to load this image
        imageCaller = pages.getCurrentPageId()
        loadedImagePagePath = imagePagePath
        pages.goto(imagePagePath)
    }
}

// Clears loaded image.  Should be called if you've loaded an image not using loadImage(...).
clearLoadedImage() {
    loadedImagePagePath = null  
}

// Returns to loaded image caller
returnToImageCaller() {
    pages.goto(imageCaller )
}
In each of your 'images-[nude/nonnude]-[name/number]' pages.
1. Add your image action
2. Add an Eval:

Code: Select all

returnToImageCaller()
At the start of any non 'images-[nude/nonnude]-[name/number]' page that you want to load a dynamic image:
Add an Eval:

Code: Select all

loadImage(imageName) // where image name is the [name/number] portion of your image page path.
In any non 'images-[nude/nonnude]-[name/number]' page where you load a non-dynamic image
After your image action, add an Eval:

Code: Select all

clearLoadedImage()
Never directly go to any of your 'images-[nude/nonnude]-[name/number]' pages. Always should be handled by loadImage(...), and always before you do anything else of consequence on your page, because if the image isn't already loaded, you'll be directed away from then back to the page you're calling loadImage(...) from.

Hope that makes sense.
undeniable_denial
Explorer
Explorer
Posts: 96
Joined: Sat Aug 24, 2019 11:42 am
Gender: Male
Location: Germany

Re: Eos programming question

Post by undeniable_denial »

What I like to do, is nest each image in an if-action, with a condition such as

Code: Select all

showImg=="003-a.jpg"
Then you can kind of script images, by setting showImg before all the ifs.

The downside is that it can be tedious to insert all these actions. If you know your way around a code editor you can edit the json-backup-file directly, though.
sirveillance
Explorer
Explorer
Posts: 17
Joined: Mon Oct 31, 2011 1:25 pm

Re: Eos programming question

Post by sirveillance »

I will try that - thank you both!
Post Reply

Who is online

Users browsing this forum: Hampelmann69 and 80 guests