create a slider

About advanced scenes, and the Thyme scripting language used in Algodoo.

create a slider

Postby spook1 » Mon Oct 05, 2009 7:38 pm

For my students (14 year olds) I would like to make a simulation whre friction of of an object can be changed by moving a slider.
I created a box with a slit in it. In this slit I placed a little block, which can be moved along the slit.

Now can I get the x-position of the block and relate it to the friction of another object?
Would it also be possible to lock out the other menu's so the students can oly play the simulation without having access to the menu's?

thanks in andvance

martijn
spook1
 
Posts: 20
Joined: Thu Sep 10, 2009 12:06 am

Re: create a slider

Postby standardtoaster » Mon Oct 05, 2009 8:00 pm

AFAIK you can't create your own slider. But here is something that I just made that you can use.

Rating: rated 5
Filesize: 1.9 kB
Comments: 0
Ratings: 1
download
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: create a slider

Postby Sniperkasa » Mon Oct 05, 2009 8:10 pm

Toaster it no work! Even if I add the box's friction to {scene.my.friction}.. whats wrong 0.0
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: create a slider

Postby Conundrumer » Mon Oct 05, 2009 8:17 pm

I remember I suggested a while ago that there should be an isolated slider menu, that would be useful for both educators and hardcore players.
User avatar
Conundrumer
 
Posts: 344
Joined: Mon Aug 31, 2009 5:55 pm
Location: NYC

Re: create a slider

Postby standardtoaster » Mon Oct 05, 2009 8:17 pm

Sniperkasa wrote:Toaster it no work! Even if I add the box's friction to {scene.my.friction}.. whats wrong 0.0

Hmm...

When you first open the scene click on the eye of the spring menu. After the spring is selected go to the script menu and make sure that the constant value is set to:
Code: Select all
{
    Scene.my.friction = dampingFactor;     1 }
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: create a slider

Postby Sniperkasa » Mon Oct 05, 2009 8:27 pm

that was first thing i checked, and YES it was like that :/
Everything looked fine.. just nothing happened
If you have a question, have a dollar and call somebody that cares.
No really just PM me if you have a problem :)
User avatar
Sniperkasa
 
Posts: 493
Joined: Tue Sep 01, 2009 5:34 pm
Location: The bottom of a lake.

Re: create a slider

Postby standardtoaster » Mon Oct 05, 2009 8:52 pm

Did you make sure that the fuchsia box's friction was set to:
Code: Select all
{scene.my.friction}


It really should work.

EDIT: I found out how to fix it! Click the eye on the spring menu, go to the script of it, go down to the constant, click inside the text box and hit return. After you do that make sure that the box's friction is set to {scene.my.friction} It's another one of those scripting bugs. :/
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: create a slider

Postby Versieon » Tue Oct 06, 2009 1:56 am

You can create a slider, heres one I threw together, don't know how simaler to standard toaster's it is, but oh well..

Rating: rated 5.6
Filesize: 9.89 kB
Comments: 2
Ratings: 2
download
User avatar
Versieon
 
Posts: 375
Joined: Tue Sep 01, 2009 4:45 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest