Motor speed increase?

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

Motor speed increase?

Postby mattyboy » Sun Nov 01, 2009 7:03 pm

I'm now trying to make a motor that when you tap up the motor speed will increase by 20 and when you tap down it will decrease by 20. i have already got the system and i just need the code. ive tried alot of times and i failed everytime :problem: can anyone tell me what/how to do it?
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby Bronie12345 » Sun Nov 01, 2009 10:40 pm

you have algodoo or phun, because ill make an example for you
When you make a comment at a scene, at least be brave enough to subscribe to that scene...
Don't go into a topic unprepared... Read the whole topic, including all the comments, before posting.

92% of teenagers have resorted to rap music. If you are part of the 8% who listens to real music, put this in your signature.
90% of teenagers today would die if Myspace/Facebook were completely destroyed. If you are one of the 10% who would be laughing their heads off, add this to your signature.
User avatar
Bronie12345
 
Posts: 451
Joined: Mon Aug 31, 2009 8:52 pm
Location: The Netherlands

Re: Motor speed increase?

Postby Dadasas » Sun Nov 01, 2009 11:19 pm

Make a box that swings and hits some thing when you press up and the code for the box would be
Code: Select all
scene.my.[BLANK] = scene.my.[BLANK] + 20
The [BLANK]'s have to be the same. Then in the motor's motor speed thing type
Code: Select all
{scene.my.[BLANK]}
. That blank also has to be the same as the others. I hope that helped! :D
User avatar
Dadasas
 
Posts: 46
Joined: Tue Sep 01, 2009 2:03 am

Re: Motor speed increase?

Postby mattyboy » Wed Nov 04, 2009 4:49 am

Thnx! i was just trying to make a 007 vehicle w/ a gearbox. (NO STEALING!!!) and i am now trying to figure out how to (when a button is pressed) the whole car would become partially invisible and when you press a button again, it goes back to normal. does anyone know how to do that?
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby standardtoaster » Wed Nov 04, 2009 5:08 am

Use the same method as before but instead of using an integer you will use a list. [H, S, L, A]
Code: Select all
scene.my.color = [0, 0, 0, 1]

That will make the visible.
Code: Select all
scene.my.color = [0, 0, 0, 0.125]

That will make it partially invisible.
Code: Select all
{scene.my.color}

Put that in the color of the car.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Motor speed increase?

Postby mattyboy » Wed Nov 04, 2009 6:03 am

ok i dont know how to do that when there is like 17 diffrent colors on the car. .......how do u do it?
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby mattyboy » Thu Nov 05, 2009 12:29 am

does anybody know where i can find the code to do that? i kinda need it quick because i cant move on w/out it and i stil got a long way to go :problem:
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby standardtoaster » Thu Nov 05, 2009 1:07 am

In the color of an object put a { at the beginning of the color and a } at the end of the color. In the last value put scene.my.color(3). It should look something like this:
Code: Select all
{[1, 1, 1, scene.my.color(3)]}

it doesn't neccesarily need to be that exact color value but you get the gist of it. ;)
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Motor speed increase?

Postby mattyboy » Thu Nov 05, 2009 1:16 am

it still isnt working??? can you give me a
1.
2.
3.
list of steps of what to do kinda thing? btw the car alot of parts w/ diffrent colors...
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby mattyboy » Thu Nov 05, 2009 2:27 am

ok...... im REALLY P.O'd at this thing..............PLZ HELP!!!
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby standardtoaster » Thu Nov 05, 2009 2:34 am

What didn't you understand about what I said?
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Motor speed increase?

Postby mattyboy » Thu Nov 05, 2009 2:35 am

so... im gonna have to do that for 206+ objects that are each colored diffrently?
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby standardtoaster » Thu Nov 05, 2009 2:46 am

Or... Use a texture in front of all the objects and make the mechanisms behind it transparent. Make the texture color like I said above.
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Motor speed increase?

Postby mattyboy » Thu Nov 05, 2009 2:48 am

??? NVM I seriously dont get it...
User avatar
mattyboy
 
Posts: 24
Joined: Mon Aug 31, 2009 11:24 pm

Re: Motor speed increase?

Postby Bronie12345 » Thu Nov 05, 2009 12:00 pm

1. open the console with `
2. type in: scene.my.mspeed=0
3. close the console with `
4. make an object
5. attache a hinge to that object
6. make the hinge a motor
7. type in the motorspeed var of the hine in the scripting menu: {scene.my.mspeed}
8. make something to controll the scene.my.mspeed variable
9. controll it
10. you're done
When you make a comment at a scene, at least be brave enough to subscribe to that scene...
Don't go into a topic unprepared... Read the whole topic, including all the comments, before posting.

92% of teenagers have resorted to rap music. If you are part of the 8% who listens to real music, put this in your signature.
90% of teenagers today would die if Myspace/Facebook were completely destroyed. If you are one of the 10% who would be laughing their heads off, add this to your signature.
User avatar
Bronie12345
 
Posts: 451
Joined: Mon Aug 31, 2009 8:52 pm
Location: The Netherlands


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests