does any javascript pros know if it's possible to create choice actions with a script
basically i have a large set and want to choose a subset and make them options in a choice module, but there are a looot of combinations
EOS creating choice actions with script
-
kerkersklave
- Explorer At Heart

- Posts: 709
- Joined: Sun Jul 06, 2014 2:11 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Slave
Re: EOS creating choice actions with script
Could be give an example of what you want?
Choice actions can only have a fixed set of choices with fixed labels, you can just hide choices via a javascript condition. So you could make a big choice action listing all possible choices and enable just the subset you need. If there are two many options to do that you can give them generic names like A,B,C, use a say option to list the active choices. If there are too many active options to show them all you can use a text input and ask the reader to type in his choice.
Choice actions can only have a fixed set of choices with fixed labels, you can just hide choices via a javascript condition. So you could make a big choice action listing all possible choices and enable just the subset you need. If there are two many options to do that you can give them generic names like A,B,C, use a say option to list the active choices. If there are too many active options to show them all you can use a text input and ask the reader to type in his choice.
- Moonwhore
- Curious Newbie

- Posts: 2
- Joined: Sat Mar 26, 2022 12:24 am
- Gender: Male
- Sexual Orientation: Straight
Re: EOS creating choice actions with script
well say the user is given a choice between 3 tasks, out of 25 total possible different tasks.
would be 2300 different combinations, way too obnoxious to manually create the modules for it
but maybe it's not possibe to do with a script idk.
would be 2300 different combinations, way too obnoxious to manually create the modules for it
but maybe it's not possibe to do with a script idk.
-
Thamrill
- Explorer At Heart

- Posts: 301
- Joined: Thu Jan 03, 2013 4:55 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: Submissive
Re: EOS creating choice actions with script
Unfortunately it's not directly possible. One alternative to achieve something similar is to have the choice action to have only options identifiers (e.g., "A", "B", "C") and have a "Say" action that can be procedurally written to associate a task to one of the options
-
kerkersklave
- Explorer At Heart

- Posts: 709
- Joined: Sun Jul 06, 2014 2:11 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Slave
Re: EOS creating choice actions with script
Do you mean something like that: https://milovana.com/webteases/showteas ... d7eb3516cb
I made the example for 5 tasks, but it should be easy enough to scale up to 25.
Get source-code: https://milovana.com/webteases/geteossc ... d7eb3516cb
I made the example for 5 tasks, but it should be easy enough to scale up to 25.
Get source-code: https://milovana.com/webteases/geteossc ... d7eb3516cb
- PlayfulGuy
- Experimentor

- Posts: 1070
- Joined: Sat Jul 07, 2012 10:08 pm
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): No domme
- Sub/Slave(s): No sub
- Location: British Columbia, Canada
Re: EOS creating choice actions with script
Nice solution!kerkersklave wrote: Mon Sep 30, 2024 12:55 pm Do you mean something like that: https://milovana.com/webteases/showteas ... d7eb3516cb
I made the example for 5 tasks, but it should be easy enough to scale up to 25.
Get source-code: https://milovana.com/webteases/geteossc ... d7eb3516cb
You could even add a function to the init module like recordTask(name, page) to build two lists, one that holds the task name and the other the name of the page that implements that task. Then you just step through the list of page names going to the next one in sequence to perform the tasks.
Good stuff!
I'd rather be stroking!
New tease downloader for GuideMe with EOS support.
Downloads of teases I've converted to GuideMe
New tease downloader for GuideMe with EOS support.
Downloads of teases I've converted to GuideMe
-
kerkersklave
- Explorer At Heart

- Posts: 709
- Joined: Sun Jul 06, 2014 2:11 pm
- Gender: Male
- Sexual Orientation: Open to new ideas!
- I am a: Slave
Re: EOS creating choice actions with script
Not sure what you want exactly. After the choice-step you've got a list currentChoices of the names of tasks. Do you want to use the goto-Action with a dynamic page name to go through the tasks? So you need a mapping from task names to page names, as you do not want to use the same name for both? In Javascript you can define a mapping like this:PlayfulGuy wrote: Tue Oct 01, 2024 2:55 pm You could even add a function to the init module like recordTask(name, page) to build two lists, one that holds the task name and the other the name of the page that implements that task. Then you just step through the list of page names going to the next one in sequence to perform the tasks.
Code: Select all
var taskToPage = {"task 1": "pageSomething", "task 2": "pageWhatever"}
Code: Select all
taskToPage["task 1"]
- PlayfulGuy
- Experimentor

- Posts: 1070
- Joined: Sat Jul 07, 2012 10:08 pm
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
- Dom/me(s): No domme
- Sub/Slave(s): No sub
- Location: British Columbia, Canada
Re: EOS creating choice actions with script
I wasn't really asking anything there, I was complimenting you on your solution and observing that it opened further possibilities... The way I worded my reply was just awkward when I said "you could even add" with a generic "you", not meaning you specifically. Sorry about that. I try to be more clear in my replies but blew it there.kerkersklave wrote: Wed Oct 02, 2024 4:55 pmNot sure what you want exactly. After the choice-step you've got a list currentChoices of the names of tasks. Do you want to use the goto-Action with a dynamic page name to go through the tasks? So you need a mapping from task names to page names, as you do not want to use the same name for both? In Javascript you can define a mapping like this:PlayfulGuy wrote: Tue Oct 01, 2024 2:55 pm You could even add a function to the init module like recordTask(name, page) to build two lists, one that holds the task name and the other the name of the page that implements that task. Then you just step through the list of page names going to the next one in sequence to perform the tasks.and then look it up like this:Code: Select all
var taskToPage = {"task 1": "pageSomething", "task 2": "pageWhatever"}Code: Select all
taskToPage["task 1"]
PG
I'd rather be stroking!
New tease downloader for GuideMe with EOS support.
Downloads of teases I've converted to GuideMe
New tease downloader for GuideMe with EOS support.
Downloads of teases I've converted to GuideMe
