[Solved] Inverted laser control

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

[Solved] Inverted laser control

Postby NilsMolinder » Sat Apr 07, 2012 10:38 pm

I'm working on a little project, and I have a problem. I need to make a turret for a tank turn in the opposite direction of the tank whent he tank turns (to create a gyro stabilization like thing), but I want it to stop when I push the keys to turn the turret. The file below is what I'm currently working on.

Rating: rated 5
Filesize: 19.07 kB
Comments: 0
Ratings: 1
download


The problem I have in doing so, is that I would need two lasers to have inverted controls. That is, they would be active as long as I'm not holding a certain key down (in this case the keys to turn the turret). Halpz?
Last edited by NilsMolinder on Sun Apr 08, 2012 12:06 am, edited 1 time in total.
NilsMolinder
 
Posts: 36
Joined: Fri Jun 17, 2011 11:48 pm

Re: Inverted laser control

Postby Nxdt » Sat Apr 07, 2012 10:43 pm

Make the hinge from the turret to the tank have no controls, nothing, just a hinge. Then put a +inf inertia mult circle, over the turret/tank hinge and create a hinge that attaches the circle to the turret, not the tank. This way the turret can be moved independent of the tank and the tanks movements won't affect the turret.
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Inverted laser control

Postby NilsMolinder » Sat Apr 07, 2012 10:51 pm

Ah yes, Brilliant!
Thank you very much for the help! I shall try this at once!
Is there any way to make the circle attach to the tank for turning the turret though?

EDIT: also, as expected, it worked.
Last edited by NilsMolinder on Sat Apr 07, 2012 11:00 pm, edited 1 time in total.
NilsMolinder
 
Posts: 36
Joined: Fri Jun 17, 2011 11:48 pm

Re: Inverted laser control

Postby Nxdt » Sat Apr 07, 2012 10:58 pm

You can do it via differentials and gears, but it will get complex quickly, and you need to simulate actual tracks. (I've done this with lego before.) Look up south pointing chariot, it always points south no matter how you turn it. Perfect for stabilizing a turret, you then just need to use another diff to control the turret.

http://en.wikipedia.org/wiki/South-pointing_chariot
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Inverted laser control

Postby NilsMolinder » Sat Apr 07, 2012 11:04 pm

Ah, I guess I'll just be happy like this then. So there's no way of making laser controls inverted? That is, active until I psuh buttan, then reactivate once I release the key?
NilsMolinder
 
Posts: 36
Joined: Fri Jun 17, 2011 11:48 pm

Re: Inverted laser control

Postby Nxdt » Sat Apr 07, 2012 11:12 pm

You can do it easily as well. Just rig a laser to be always on, then have a mechanical "Slot" that allows the laser to pass through when straight, but as soon as a key is pressed it rotates and blocks the beam. Use springs to re-center it.
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Inverted laser control

Postby NilsMolinder » Sat Apr 07, 2012 11:24 pm

Ah, I thought about that, but I was hoping to not have to do it that way, since it's a bit slower and less reliable than lasers. For some reason hinges have been acting funny since I updated Algodoo, jumping around and such.
NilsMolinder
 
Posts: 36
Joined: Fri Jun 17, 2011 11:48 pm

Re: Inverted laser control

Postby Nxdt » Sat Apr 07, 2012 11:34 pm

You can set legacy mode to "0" in the scripting menu, this makes them use the old algorithm.
User avatar
Nxdt
 
Posts: 1019
Joined: Mon Aug 31, 2009 6:32 pm
Location: Scotland!

Re: Inverted laser control

Postby NilsMolinder » Sun Apr 08, 2012 12:06 am

Ah, OK. Well, thanks for all the help, I guess I'll just have to play around with springs and hinges for my lasers.
NilsMolinder
 
Posts: 36
Joined: Fri Jun 17, 2011 11:48 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 1 guest