Browse Search Popular Register Upload Rules User list Login:
Search:
Scripted Shiftstick

Image:
screenshot of the scene

Author: tellmeupme

Group: Default

Filesize: 32.5 kB

Date added: 2017-06-07

Rating: 5

Downloads: 332

Views: 183

Comments: 2

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

This Shiftstick Is Using Scripts To Imitate A Real One. Press Keys Ranging From 1-5 And R To Select Gear (Has No Other Function) And The Lever Will Go To The Correct Position. Be Careful With The Controls, It Breaks Easily If You Shift Too Fast.
Please log in to rate this scene
edit
Similar scenes
Title: Advanced pack 1
Rating: 5
Filesize: 0.55 MB
Downloads: 474
Comments: 0
Ratings: 1
Date added: 2020/04/06 19:30:01
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Title: Laser scripted Scar H + M203
Rating: 5
Filesize: 0.51 MB
Downloads: 1671
Comments: 1
Ratings: 1
Date added: 2011/07/15 23:24:00
Made with: Algodoo v1.8.5
Rating: rated 5
download
Title: scripted cannon
Rating: 5
Filesize: 38.22 kB
Downloads: 596
Comments: 3
Ratings: 1
Date added: 2009/08/12 16:47:40
Made with: Phun
Rating: rated 5
download
Title: Decent scripted car with assult course
Rating: 5
Filesize: 0.62 MB
Downloads: 686
Comments: 0
Ratings: 1
Date added: 2010/06/08 21:22:33
Made with: Phun
Rating: rated 5
download
Title: Scripted Tank
Rating: 5
Filesize: 3.42 MB
Downloads: 641
Comments: 0
Ratings: 1
Date added: 2015/07/31 22:35:25
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: kran - crane now scripted
Rating: 4.8889
Filesize: 0.96 MB
Downloads: 698
Comments: 2
Ratings: 3
Date added: 2011/09/12 11:54:05
Made with: Algodoo v1.9.9b
Rating: rated 4.9
download
Oh shoot that's a bunch of scripting

I've made one on a buggy I made, it only uses some script on one box. You can script with if clauses on the springs themselves, like this:

First of all make a scene.my.g variable, which will be the one used on the gearbox and we'll also use it on the indicator

Then make a system that adds 1 when A is pressed, and subtracts 1 when Z is pressed. Also make it be between, say, -1 and 5. You can use:

scene.my.g > 5? {scene.my.g = 5}:{};
scene.my.g < -1? {scene.my.g = -1}:{}

The system to add 1 and subtract 1 can be made with a couple of variables and a few lines of code. Just keep in mind that you can use keys.isDown("a") in postStep. (or "z" or "shift" or whatever you want). It'll return true when the key is pressed

So now you go to one of the springs, and under length, you write something like this:

length = {scene.my.g == -1? {0.1}:{scene.my.g == 0? {0.15}:{scene.my.g == 1? {0.18}:{scene.my.g == 2? {0.12}:{scene.my.g == 3? {0.11}:{scene.my.g == 4? {0.19}:{scene.my.g == 5? {0.31}:{}}}}}}}}

You basically write
scene.my.g == -1? {0.1}:{}
then you copy it and paste it on the {}, like

scene.my.g == -1? {0.1}:{scene.my.g == -1? {0.1}:{}}
then you change the values. You calibrate each value and you're done


And for the gearbox you have a number for each gear, you just make the radius of one of the gears be something like 0.05 + scene.my.gear/100 and the other one say 0.3 - scene.my.gear / 100.
Thanks for the advice