Automatic gearbox: help with scripting ?
			5 posts			 • Page 1 of 1		
	
Automatic gearbox: help with scripting ?
Hi all, I have built a long time a go a spring engine and I would like to build an automatic gearbox that selects a gear depending on rpm...I've already done the gearbox: 6 gears in the classical circles that collide if one not collides with water or not "hetero collides" (the type of gearbox I'm talking about is very similar to this which is not mine anyway: )
How can I do ? I've tried with some mechanical things and kilinich's probe but it's too complicated
What I would like to do is: when engine reaches 300 rad/s the gearbox chooses a higher gear and when it reaches 20 rpm it chooses a lower gear
			How can I do ? I've tried with some mechanical things and kilinich's probe but it's too complicated
What I would like to do is: when engine reaches 300 rad/s the gearbox chooses a higher gear and when it reaches 20 rpm it chooses a lower gear

- 
				

PhunWars - Posts: 78
 - Joined: Wed Dec 30, 2009 11:01 pm
 
Re: Automatic gearbox: help with scripting ?
- Code: Select all
 circle := readable(owner);
v := circle.vel;
directly copied from one of kilinichs scripts
go to script menu and then the bottom, you will there see wich attributes you can acces with readable
then you can do something with a if statement for your gearbox
Basically, there are only 10 types of people in the world. Those who know binary, and those who don't.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
		Light travels faster than sound. That's why some people appear bright until they open their mouths.
- 
				

monstertje3 - Posts: 343
 - Joined: Sat Sep 05, 2009 4:29 pm
 - Location: N-H, NL
 
Re: Automatic gearbox: help with scripting ?
Hmm where can I learn this something ?  And where should I put that code ?  If I got what you said should be something like "If x > 300 rpm" and it changes gear isn't it ?
			
- 
				

PhunWars - Posts: 78
 - Joined: Wed Dec 30, 2009 11:01 pm
 
Re: Automatic gearbox: help with scripting ?
you can put it in the onlaserhit of a box, and then put a laser against it so it constantly refreshes
then you use if statements
circle.vel>10 ? {your gearbox variables}:{what to do when vel is below 10}
ofcourse the gearbox variables would be scene.my, wich you put then on your gears/gearing system
			then you use if statements
circle.vel>10 ? {your gearbox variables}:{what to do when vel is below 10}
ofcourse the gearbox variables would be scene.my, wich you put then on your gears/gearing system
Basically, there are only 10 types of people in the world. Those who know binary, and those who don't.
Light travels faster than sound. That's why some people appear bright until they open their mouths.
		Light travels faster than sound. That's why some people appear bright until they open their mouths.
- 
				

monstertje3 - Posts: 343
 - Joined: Sat Sep 05, 2009 4:29 pm
 - Location: N-H, NL
 
Re: Automatic gearbox: help with scripting ?
Sorry for my ignorance, but what should I put in your gearbox variables ?  The collision set ?  And what in "What to do when rpm is below 10" ?
			
- 
				

PhunWars - Posts: 78
 - Joined: Wed Dec 30, 2009 11:01 pm
 
			5 posts			 • Page 1 of 1		
	Who is online
Users browsing this forum: No registered users and 3 guests

			


