Page 13 of 16

Re: Here are EOS tutorials

Posted: Tue Apr 15, 2025 8:25 pm
by Shattered
I seem to recall a way to make a say action be from multiple random ones via storing them in the init script...anyone remember? :lol:

Re: Here are EOS tutorials

Posted: Tue Apr 22, 2025 11:47 am
by undeniable_denial
Shattered wrote: Tue Apr 15, 2025 8:25 pm I seem to recall a way to make a say action be from multiple random ones via storing them in the init script...anyone remember? :lol:
Perhaps you could be a little bit more specific, particularly about the "random" part? I'm assuming you have a list of texts. Do you want:
A) All of them in a random order
B) Not necessarily all of them and possibly repeating
C) Something else?

Re: Here are EOS tutorials

Posted: Tue Apr 22, 2025 7:04 pm
by Shattered
undeniable_denial wrote: Tue Apr 22, 2025 11:47 am
Shattered wrote: Tue Apr 15, 2025 8:25 pm I seem to recall a way to make a say action be from multiple random ones via storing them in the init script...anyone remember? :lol:
Perhaps you could be a little bit more specific, particularly about the "random" part? I'm assuming you have a list of texts. Do you want:
A) All of them in a random order
B) Not necessarily all of them and possibly repeating
C) Something else?
B more or less, you return to the same page and it says something that could be different, could be the same

Re: Here are EOS tutorials

Posted: Thu Apr 24, 2025 4:00 pm
by undeniable_denial
Shattered wrote: Tue Apr 22, 2025 7:04 pm B more or less, you return to the same page and it says something that could be different, could be the same
Something like this maybe:

Code: Select all

function myRandomText() {
    texts=[
        "Nice weather today."
        ,
        "Why are you looking at me like that?"        
    ];
    return texts[Math.floor(Math.random()*texts.length)];
}
Then put this inside an eval-tag in a say action:

Code: Select all

myRandomText()
Couple of notes:
- Make sure the texts are in quotes and seperated by a comma. (No comma after the last one)
- If you want a line break use the html-code "<br>". Don't put actual line breaks in the quotes.
- Math.random generates a number between 0 and 0.99999...
- When you multiply that by the number of texts (texts.length) and round that down ("floor"), then you get indices from 0 to length-1. So you can just have any number of texts, the code can handle it.

Re: Here are EOS tutorials

Posted: Sun Apr 27, 2025 7:57 pm
by UrbanJames
Is there any way to have dialog that plays during a timer?

Re: Here are EOS tutorials

Posted: Sun Apr 27, 2025 8:57 pm
by undeniable_denial
UrbanJames wrote: Sun Apr 27, 2025 7:57 pm Is there any way to have dialog that plays during a timer?
turn on the timer's "asynchronous" mode

Re: Here are EOS tutorials

Posted: Sun Apr 27, 2025 9:43 pm
by UrbanJames
undeniable_denial wrote: Sun Apr 27, 2025 8:57 pm
UrbanJames wrote: Sun Apr 27, 2025 7:57 pm Is there any way to have dialog that plays during a timer?
turn on the timer's "asynchronous" mode
Ok, many thanks!

So I tested it for a bit and got it to work by using: "Timer (Asynchronous)" that runs an empty eval after the time is up > "say" action with a pause timer that is longer then the "Timer" action > rest of page
Is this the easiest way to do it?

Re: Here are EOS tutorials

Posted: Tue Apr 29, 2025 7:01 pm
by PlayfulGuy
UrbanJames wrote: Sun Apr 27, 2025 9:43 pm
undeniable_denial wrote: Sun Apr 27, 2025 8:57 pm
UrbanJames wrote: Sun Apr 27, 2025 7:57 pm Is there any way to have dialog that plays during a timer?
turn on the timer's "asynchronous" mode
Ok, many thanks!

So I tested it for a bit and got it to work by using: "Timer (Asynchronous)" that runs an empty eval after the time is up > "say" action with a pause timer that is longer then the "Timer" action > rest of page
Is this the easiest way to do it?
You shouldn't need an empty eval.

The Async timer can run other say actions, or even just contain a goto command to go to another page. These will execute when its time expires.

Then following the async timer you could have a series of timed say actions, image changes followed by another non-async timer, or whatever. If the total time of those actions is less than the time on the async timer, those commands following the async timer will execute, then the command(s) "contained in" the async timer will execute when its timer expires.

PG

Re: Here are EOS tutorials

Posted: Wed May 07, 2025 3:01 am
by Shattered
undeniable_denial wrote: Thu Apr 24, 2025 4:00 pm
Shattered wrote: Tue Apr 22, 2025 7:04 pm B more or less, you return to the same page and it says something that could be different, could be the same
Something like this maybe:

Code: Select all

function myRandomText() {
    texts=[
        "Nice weather today."
        ,
        "Why are you looking at me like that?"        
    ];
    return texts[Math.floor(Math.random()*texts.length)];
}
Then put this inside an eval-tag in a say action:

Code: Select all

myRandomText()
Couple of notes:
- Make sure the texts are in quotes and seperated by a comma. (No comma after the last one)
- If you want a line break use the html-code "<br>". Don't put actual line breaks in the quotes.
- Math.random generates a number between 0 and 0.99999...
- When you multiply that by the number of texts (texts.length) and round that down ("floor"), then you get indices from 0 to length-1. So you can just have any number of texts, the code can handle it.
Perfect thanks!

Re: Here are EOS tutorials

Posted: Fri May 23, 2025 5:07 pm
by 47dahc
I'm trying to write my first tease and I ask what the players name is on the Start page using the prompt action "name". When I do a preview of the tease from the Start page, it works great and goes through with no issues. However, when I preview another page further in where it says the users "name", it hangs because the "name" was not set. I don't want to test from the beginning of the tease every time I add a page and use "name" in a Say command. I tried adding "name=Dahc" to the init script but it's not working. I can just not use "name" on the page while testing but then I need to go back and edit each Say command afterwards. How do you test individual pages where the players name is set at the beginning of a tease and is used without having to go back and redo all the Say commands within pages. I thought adding it to the init script would work then when I'm done and ready to publish, I could just remove that line.

Re: Here are EOS tutorials

Posted: Fri May 23, 2025 5:36 pm
by PlayfulGuy
47dahc wrote: Fri May 23, 2025 5:07 pm I'm trying to write my first tease and I ask what the players name is on the Start page using the prompt action "name". When I do a preview of the tease from the Start page, it works great and goes through with no issues. However, when I preview another page further in where it says the users "name", it hangs because the "name" was not set. I don't want to test from the beginning of the tease every time I add a page and use "name" in a Say command. I tried adding "name=Dahc" to the init script but it's not working. I can just not use "name" on the page while testing but then I need to go back and edit each Say command afterwards. How do you test individual pages where the players name is set at the beginning of a tease and is used without having to go back and redo all the Say commands within pages. I thought adding it to the init script would work then when I'm done and ready to publish, I could just remove that line.
I'm not sure I follow what you did 100%, but when you prompt for the users name, the input gets stored in a variable (you specify the name of the variable in the prompt command). In your subsequent Say actions you need to include an eval that references the variable. If you've not done that, unfortunately you will need to go back and edit those actions. That's just how variables work in EOS.

I made a demo tease for someone else. You can see it here: https://milovana.com/webteases/showteas ... fe8db66ea6

Hope that helps.

PG
Screenshot.jpg
Screenshot.jpg (134.03 KiB) Viewed 9014 times

Re: Here are EOS tutorials

Posted: Fri May 23, 2025 6:09 pm
by 47dahc
PlayfulGuy wrote: Fri May 23, 2025 5:36 pm
Spoiler: show
47dahc wrote: Fri May 23, 2025 5:07 pm I'm trying to write my first tease and I ask what the players name is on the Start page using the prompt action "name". When I do a preview of the tease from the Start page, it works great and goes through with no issues. However, when I preview another page further in where it says the users "name", it hangs because the "name" was not set. I don't want to test from the beginning of the tease every time I add a page and use "name" in a Say command. I tried adding "name=Dahc" to the init script but it's not working. I can just not use "name" on the page while testing but then I need to go back and edit each Say command afterwards. How do you test individual pages where the players name is set at the beginning of a tease and is used without having to go back and redo all the Say commands within pages. I thought adding it to the init script would work then when I'm done and ready to publish, I could just remove that line.
I'm not sure I follow what you did 100%, but when you prompt for the users name, the input gets stored in a variable (you specify the name of the variable in the prompt command). In your subsequent Say actions you need to include an eval that references the variable. If you've not done that, unfortunately you will need to go back and edit those actions. That's just how variables work in EOS.

I made a demo tease for someone else. You can see it here: https://milovana.com/webteases/showteas ... fe8db66ea6

Hope that helps.

PG

Screenshot.jpg
That's pretty much what I did, I think.

From my Start page:
Spoiler: show
Start Page.png
Start Page.png (23.89 KiB) Viewed 9009 times
If I do a preview (eye icon at the top of the page) from this page, it goes through the tease just fine and will flow through other pages as well.
Spoiler: show
Start Page_preview.png
Start Page_preview.png (420.73 KiB) Viewed 9009 times
If I'm editing another page within the tease and select the eye icon to preview and test it from that page, it hangs at the Say command where I use "name":
Spoiler: show
TahliaWarmup.png
TahliaWarmup.png (50.44 KiB) Viewed 9009 times
I can only assume it hangs because I'm testing the page without the variable being set because I'm basically skipping the Start page where it will be set in the final published tease.

So I guess my question is, how can I set a variable in the init script that will automatically set the name so I can test individual pages without needing to preview from the Start page and go through the whole tease to get to the page I want to test? I plan on having variable pages using the asterisk (page*) so starting from the beginning each time might not take me to the page I want to test.

Re: Here are EOS tutorials

Posted: Fri May 23, 2025 6:19 pm
by 47dahc
47dahc wrote: Fri May 23, 2025 6:09 pm So I guess my question is, how can I set a variable in the init script that will automatically set the name so I can test individual pages without needing to preview from the Start page and go through the whole tease to get to the page I want to test? I plan on having variable pages using the asterisk (page*) so starting from the beginning each time might not take me to the page I want to test.
I figured it out.

I added

Code: Select all

var name = "Dahc"
to the init script and it works now. Will just have to remove it before publishing.

Re: Here are EOS tutorials

Posted: Fri May 23, 2025 11:17 pm
by PlayfulGuy
47dahc wrote: Fri May 23, 2025 6:19 pm
47dahc wrote: Fri May 23, 2025 6:09 pm So I guess my question is, how can I set a variable in the init script that will automatically set the name so I can test individual pages without needing to preview from the Start page and go through the whole tease to get to the page I want to test? I plan on having variable pages using the asterisk (page*) so starting from the beginning each time might not take me to the page I want to test.
I figured it out.

I added

Code: Select all

var name = "Dahc"
to the init script and it works now. Will just have to remove it before publishing.

Excellent!

It shouldn't be necessary to remove it before publishing since the init script only runs once when the tease is loaded. When you go through the tease normally and prompt for a name, the entered name should override what was set in the init script. You can test that pretty easily by setting one name in the init script, then enter a different one at the prompt and see what happens. Or in your ini script just set it to an empty string (var name = "").

Love your profile pic by the way!

PG

Re: Here are EOS tutorials

Posted: Sun May 25, 2025 6:19 pm
by Roxas20
Is there a place where you can share demos of your tease to get people's opinions