Help with my first tease
-
Yo_Boy_123
- Explorer

- Posts: 27
- Joined: Sat Sep 04, 2021 7:15 am
Help with my first tease
Hello, I've been working on a tease for a few weeks now, and I've come to realize that I will need assistance in making some of the features I have in mind come to life. I don't want to spoil the beans yet in terms of subject, but I will try and have a functional playtest as soon as possible.
I've never worked with Javascript (and have very little experience with regards to coding in general), so I would appreciate help with learning about how to translate my ideas into a functional game.
I've got a handle on the Eos editor and can make simple, linear teases, but my lack of theoretical knowledge is really hurting my ability to build a more interactive experience. Below are a few specific hurdles to the production of an initial version as a proof of concept.
Since I intend to build on the initial version of the tease as well as produce similar games within other genres, the systems would ideally be as modular as possible.
-I would like my tease to have random but weighted encounters (ie different girls have higher or lower chances of appearing). Since I would also like it to have different difficulties (partially to allow for shorter play sessions), it would also need to accommodate different odds tables.
Here is an example of what I mean by having different odds tables:
Easy
Girl 1: 10%
Girl 2: 40%
Girl 3: 50%
Medium
Girl 1: 10%
Girl 2: 25%
Girl 3: 25%
Girl 4: 40%
Hard
Girl 1: 10%
Girl 2: 15%
Girl 3: 15%
Girl 4: 30%
Girl 5: 30%
-What needs to be input in the "eval" boxes on timers and Choice buttons? I have struggled to find a tutorial on how to use these. Specifically, what common keywords might be useful to know how to use?
Any help is much appreciated. Thank you.
I've never worked with Javascript (and have very little experience with regards to coding in general), so I would appreciate help with learning about how to translate my ideas into a functional game.
I've got a handle on the Eos editor and can make simple, linear teases, but my lack of theoretical knowledge is really hurting my ability to build a more interactive experience. Below are a few specific hurdles to the production of an initial version as a proof of concept.
Since I intend to build on the initial version of the tease as well as produce similar games within other genres, the systems would ideally be as modular as possible.
-I would like my tease to have random but weighted encounters (ie different girls have higher or lower chances of appearing). Since I would also like it to have different difficulties (partially to allow for shorter play sessions), it would also need to accommodate different odds tables.
Here is an example of what I mean by having different odds tables:
Easy
Girl 1: 10%
Girl 2: 40%
Girl 3: 50%
Medium
Girl 1: 10%
Girl 2: 25%
Girl 3: 25%
Girl 4: 40%
Hard
Girl 1: 10%
Girl 2: 15%
Girl 3: 15%
Girl 4: 30%
Girl 5: 30%
-What needs to be input in the "eval" boxes on timers and Choice buttons? I have struggled to find a tutorial on how to use these. Specifically, what common keywords might be useful to know how to use?
Any help is much appreciated. Thank you.
Re: Help with my first tease
For your odds tables I have a way but it is pretty messy. (I barely know what I am doing haha) Therefore I am going to wait a day or two to see what others suggest first because what they might provide would likely be a superior option to what I have.
For eval on choice buttons those are saying when that button will be visible to the player or not. For example if you set a variable of y=true and then later set at button eval to y, it will only show up when y is true and be invisible when y becomes false. If the only choice buttons with evals are false then nothing will display and your tease won't progress to the next line, make sure there is always going to be at least one visable button, otherwise you need to put that choice button into an if statement. Let me know if that doesn't make sense and I can show visible examples. Good luck, excited to see what you come up with!
Edit - I forgot to mention not using eval on choice buttons makes that button always visible.
For eval box on timers that is if you want to use a variable timer length. For example if you do something that makes x=2000 then have a timer use x then it will wait for 2000 milliseconds or 2 seconds. You could later change x to 4000 which would then make the timer wait for 4 seconds etc. Mostly people don't use eval on timers so don't think you have to. If you use the timer as normal make sure you don't put 2 or something(it won't cause an error but it also won't do anything). Instead put 2s which will make it wait for 2 seconds. If you ever use decimals don't use .5s for half a second, instead use 0.5s because that will stop it from having an error when you go to publish. (bringing these up because they were issues I ran into a year ago)Yo_Boy_123 wrote: Fri Apr 29, 2022 6:34 am -What needs to be input in the "eval" boxes on timers and Choice buttons? I have struggled to find a tutorial on how to use these. Specifically, what common keywords might be useful to know how to use?
For eval on choice buttons those are saying when that button will be visible to the player or not. For example if you set a variable of y=true and then later set at button eval to y, it will only show up when y is true and be invisible when y becomes false. If the only choice buttons with evals are false then nothing will display and your tease won't progress to the next line, make sure there is always going to be at least one visable button, otherwise you need to put that choice button into an if statement. Let me know if that doesn't make sense and I can show visible examples. Good luck, excited to see what you come up with!
Edit - I forgot to mention not using eval on choice buttons makes that button always visible.
Last edited by indyc on Fri Apr 29, 2022 11:31 pm, edited 1 time in total.
- Revuin
- Explorer

- Posts: 39
- Joined: Sun Oct 14, 2018 8:51 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: None of the above
Re: Help with my first tease
I'm always excited whenever someone makes a game-like tease so I'm very happy to help you out. For doing anything random, this formula is gonna be your best friend:
Math.floor(Math.random()*(max-min+1))+min
It returns a random whole number between the min and max number you put in. We want a random number between 0 and 100 so those will be our min and max
Math.floor(Math.random()*(100-0+1))+0
which equals:
Math.floor(Math.random()*101)
In your example for easy, it would look like this.
Math.floor(Math.random()*(max-min+1))+min
It returns a random whole number between the min and max number you put in. We want a random number between 0 and 100 so those will be our min and max
Math.floor(Math.random()*(100-0+1))+0
which equals:
Math.floor(Math.random()*101)
In your example for easy, it would look like this.
Code: Select all
girl1 = 10;
girl2 = 40;
//Put the above in your Init script. Build out this bottom part in your page
if (Math.floor(Math.random()*101) <= girl1)
Go to: Girl1
else if (Math.floor(Math.random()*101) <= girl2)
Go to: Girl2
else
Go to: Girl3
Last edited by Revuin on Fri Apr 29, 2022 6:00 pm, edited 2 times in total.
-
SilverSlut
- Explorer

- Posts: 66
- Joined: Sat Aug 24, 2019 11:54 pm
- Gender: Male
- Sexual Orientation: Bisexual/Bi-Curious
- I am a: Switch
Re: Help with my first tease
The only problem here is that this will give a 10% chance of girl1, a 30% chance of girl2, and a 60% chance of girl3, as the second if will return true when the random number is between 10 (girl1) and 40 (girl2), and then default to girl3 if the number is over 40.In your example for easy, it would look like this.
The missing step here is that you need to add the previous ones together, like this:
Code: Select all
girl1 = 10;
girl2 = 40;
//Put the above in your Init script. Build out this bottom part in your page
var rando = Math.floor(Math.random()*101)
if (rando <= girl1)
Go to: Girl1
else if (rando <= (girl1 + girl2))
Go to: Girl2
else
Go to: Girl3
EDIT: Ah, I see some things changed while I was writing this out. I recommend running the Math.random() function just once and storing it in a variable, then using if-elseif-elsif-etc chains. Doing it with elseif chains will ensure that you only ever get exactly the result you expect. I've had coding mishaps with Eos when I'm not very very strict with it.
- Revuin
- Explorer

- Posts: 39
- Joined: Sun Oct 14, 2018 8:51 pm
- Gender: Male
- Sexual Orientation: Straight
- I am a: None of the above
Re: Help with my first tease
I like SilverSlut's solution, it's more efficient.SilverSlut wrote: Fri Apr 29, 2022 5:58 pmThe only problem here is that this will give a 10% chance of girl1, a 30% chance of girl2, and a 60% chance of girl3, as the second if will return true when the random number is between 10 (girl1) and 40 (girl2), and then default to girl3 if the number is over 40.In your example for easy, it would look like this.
For mine, it technically works also because EOS rolls the random number each time for each IF statement so just pick whichever way you prefer
Re: Help with my first tease
A billion ways to do your odds table thing, but the way I would handle something like this is:
First, create pages that contain your encounters like:
encounter1-girl1
encounter1-girl2
encounter1-girl3
encounter1-girl4
encounter1-girl5
Then add the following to your init script:
Then, somewhere in your tease when you want to go to the encounter page, in an Eval action do something like:
Here's a super simple framework using it:
https://milovana.com/webteases/showteas ... 26947665fc
Edit: fixed typos, added link to simple example
First, create pages that contain your encounters like:
encounter1-girl1
encounter1-girl2
encounter1-girl3
encounter1-girl4
encounter1-girl5
Then add the following to your init script:
Code: Select all
// Define odds for 'encounter' pages
var encounters = {
1: {
easy: {
girl1: 10,
girl2: 40,
girl3: 50,
},
medium: {
girl1: 10,
girl2: 25,
girl3: 25,
girl4: 40,
},
hard: {
girl1: 10,
girl2: 15,
girl3: 15,
girl4: 30,
girl5: 30,
},
},
// define more encounters here
}
// Function for getting encounter pages
function getRandomEncounterPage(enc, lvl) {
var el = encounters[enc][lvl] // get girls object for encounter/difficulty
var ks = Object.keys(el) // get girl1, girl2, etc., array
// Get max possible random value
var mx = ks.reduce(function(r, k){return r+=el[k]}, 0)
// Get random value
var rd = Math.floor(Math.random()*mx)+1
// Find girl that matches random
var g, n = 0
for (var i = 0, l = ks.length; i < l; i++) {
var k = ks[i]
if ((n+=el[k]) >= rd) {
g = k
break
}
}
// Return a page name using that girl, like 'encounter1-girl1'
return 'encounter' + enc + '-' + g
}Code: Select all
pages.goto(getRandomEncounterPage(1,'hard'))https://milovana.com/webteases/showteas ... 26947665fc
Edit: fixed typos, added link to simple example
Last edited by fapnip on Mon May 09, 2022 3:27 pm, edited 4 times in total.
-
Yo_Boy_123
- Explorer

- Posts: 27
- Joined: Sat Sep 04, 2021 7:15 am
Re: Help with my first tease
Thanks everyone for the responses, I think I'm going to go with Fapnip's idea, it seems a little more robust and flexible.
There are some special encounters that I want to incorporate into the game, and this seems like the ideal way to do it. In time, I want to have 20+ different fights, and not needing to use else-if chains is probably advantageous.
There are some special encounters that I want to incorporate into the game, and this seems like the ideal way to do it. In time, I want to have 20+ different fights, and not needing to use else-if chains is probably advantageous.
-
Yo_Boy_123
- Explorer

- Posts: 27
- Joined: Sat Sep 04, 2021 7:15 am
Re: Help with my first tease
Thanks Fapnip, I've plugged this into a dummy tease to test it, and it seems fairly easy to do. A few questions/hiccups:
- 1- I should've been more concise with the information I gave in my original post. I used "girl1", "girl 2", etc as placeholders. Would there be a way to convert the function you gave me to use real names instead of placeholders? If not, then that's no problem, I can work around that.
2- The function returns as "undefined" about 60% of the time. I have it rigged up exactly as described and am using the "easy" permutation. It goes to a page called "encounter1-undefined". When it works properly, it does go to the correct pages, and the pages it displays do seem to be appearing in the right ratios.
Re: Help with my first tease
1. girl1, girl2, etc., in page names and odds object are arbitrary. They can be anything (letters and/or numbers only).Yo_Boy_123 wrote: Sun May 08, 2022 8:47 am
Thanks Fapnip, I've plugged this into a dummy tease to test it, and it seems fairly easy to do. A few questions/hiccups:
- 1- I should've been more concise with the information I gave in my original post. I used "girl1", "girl 2", etc as placeholders. Would there be a way to convert the function you gave me to use real names instead of placeholders? If not, then that's no problem, I can work around that.
2- The function returns as "undefined" about 60% of the time. I have it rigged up exactly as described and am using the "easy" permutation. It goes to a page called "encounter1-undefined". When it works properly, it does go to the correct pages, and the pages it displays do seem to be appearing in the right ratios.
2. Fixed a typo in the example function, and added a use example above.
-
Yo_Boy_123
- Explorer

- Posts: 27
- Joined: Sat Sep 04, 2021 7:15 am
Re: Help with my first tease
Things are moving along, I intend to release an alpha soon. In the meantime, I've got a few more questions.
Thanks again.
- Could someone give me a 3 minute primer on how to use HTML in Eos? I know you can use it in a Say action, but there doesn't seem to be a good tutorial on the forums, and I'm not sure how to translate a generic tutorial/stackoverfow type article into something useful. Is there any special formatting I need to be aware of, for example?
- Is it possible to use console.log to output text in Eos? There are a couple cases where it would be much easier to just include the text in an eval rather than make a separate say action (it's also sometimes easier to sequence). If so, what would I need to do to manipulate that text (keep it onscreen for a set amount of time, etc)
- I'm still not quite sure how to get the eval boxes on buttons to work right. I get that I need a variable declared, but I can't get it to work.
Here, I want this option to only be accessible if the game is in a debug mode (ie it is in alpha or I need to fix something). I have a button set as part of a wider menu, and I only want it to be visible if Var Debug is true. I'll just post a snippet that I know is wrong. This is the code from the eval box on the button in question.Code: Select all
var Debug == true
Thanks again.

