PDA

View Full Version : Tiny dead zone on full throttle (PT)



astir
5th May 2005, 08:58 AM
Hi,

Can someone be so kind and give me Script or info how I can make deadzone to the end of axis?

I would like have tiny deadzone on full throttle like 95% physical move means axis 100% movement.

Not too hard I quess, but Im not good on this :)

Thanks
-Astir

Bob Church
5th May 2005, 01:01 PM
Hello Astir,

>> Can someone be so kind and give me Script or info how I can make deadzone to the end of axis?

I would like have tiny deadzone on full throttle like 95% physical move means axis 100% movement. <<

You&#39;d need to write a little script to stretch 95% to 100%. First you&#39;d add the CMS Controls to the map. The actual controls go 0 to 255, so what you want is for 95% of that to create the full 255 change. It&#39;s going to depend on which end you want the deadzone on. If it&#39;s a throttle, then the 255 value is min throttle, 0 is max throttle. I&#39;m guessing you&#39;d want the deadzone at minimum, so the script would need to look something like this (I&#39;ll take 240 as the "95%" value and JS1.A3 as the axis you want to scale):

script

if( [ js1.a3 > 240 ] ) then
cms.a1 = 255;
else
cms.a1 = (255 * js1.a3) / 240;
endIf

endScript

You&#39;d need to unassign whatever CM Device axis was originally assigned to the throttle, in this case probably js1.a3 and CM Device 1, Z Axis, and then assign the CMS Controls Axis 1 to that CM Device axis instead.

If you needed the deadzone at the "0" end, it would get a little more complicated. The calculation would basically be the same but you&#39;d need to subtract it from the full scale value to get it to line up the way you want.

Is that what you were looking for?

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

astir
9th May 2005, 06:55 PM
Thanks for your reply, but now when I had time to check it, it seems that I would need this trick to "0"-end. At least in my configuration Full throttle is equal to zero.

I try now to start modifying this, but I quess U will be the first ready... :)

Ill will let U know if I manage it out.

-Astir

astir
9th May 2005, 07:01 PM
hmm.. could it be so easy like this: ???


if( [ js2.a3 < 15 ] ) then
cms.a1 = 0;
else
cms.a1 = ((255 * js2.a3)-15) / 240;
endIf

At least that works like it wanted :)

Is there some not needed parts?

Thanks
-Astir

astir
9th May 2005, 07:09 PM
Forget previous post.. now Im pretty sure I did it, yahoo


if( [ js2.a3 < 15 ] ) then
cms.a1 = 0;
else
cms.a1 = (270 * js2.a3) / 255 -15;
endIf

Right?

-Astir

Bob Church
12th May 2005, 03:23 AM
Hi Astir,

>> Right? <<

Just about, but it would be just a little bit off. The second calculation would really be more like:

cms.a1 = (255 * (js2.a3 - 15)) / 240;

What you did would end up close to the right result, though, and whether it would be enough off that you&#39;d actually notice I don&#39;t know. If it feels okay to you, that&#39;s all that really matters.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

astir
12th May 2005, 04:17 PM
Originally posted by Bob Church@May 12 2005, 04:23 AM
Hi Astir,

>> Right? <<

Just about, but it would be just a little bit off. The second calculation would really be more like:

cms.a1 = (255 * (js2.a3 - 15)) / 240;

What you did would end up close to the right result, though, and whether it would be enough off that you&#39;d actually notice I don&#39;t know. If it feels okay to you, that&#39;s all that really matters.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com
<div align="right">12517
[/quote]

Roger that :)

Thank you

Regards
-Astir