PDA

View Full Version : how to freeze an axis?



gutted52
25th March 2008, 12:16 PM
this may seem strange... but here's some basic pseudo-code of what i need to do.

if(js3.a1 > 50)
{
cms.b33 = true;
freeze js3.a2;
}


in a nutshell:
when js3.a1 goes past 50, the keystroke in cms.b33 should be held and js3.a2should be stuck in it's current position (regardless of any further user movement).

when js3.a1 comes back under 50, cms.b33 should be released and js3.a2 should go 'live' again.

again, i know it sounds sorta strange.. but this is what i need =/

Bob Church
26th March 2008, 11:20 AM
Hi gutted52,

>> this may seem strange... but here's some basic pseudo-code of what i need to do....<<

You just need to pass js3.a2 through the script and out on a CMS variable:



script

// Generate cms.b33 then it can be used as a switch, it'll be
// TRUE whenever the axis should freeze.....
//
cms.b33 = [ js3.a1 < 51 ];

// Now use it to gate the axis itself out to a CMS variable. When
// it's > 50, this block won't executed and cms.a1 will just hold the
// value it got.
//
if( cms.b33 ) then
cms.a1 = js3.a2;
endIf
endScript


If you've already used cms.a1 you'll need to pick another cms axis but otherwise all you should need to do is to assign cms.a1 (or whatever you use) to wherever js3.a2 goes now and then remove the assignment from js3.a2 itself.

I think I've got it right but I didn't really run it. Let me know if it doesn't work out and we can sort things out for you.

Best regards,

- Bob

The StickWorks
http://www.stickworks.com

gutted52
27th March 2008, 07:01 AM
thanks. i didn't expect a reply so soon. i was actually coming back here to say that i solved it on my own LOL.

this is how i did it:


if([js3.a1 > 50]) then
cms.b33 = true;
else
{
cms.b33 = false;
cms.a2 = js3.a2;
}
endif

cms.a1 is already being used for something else.


so i guess i should explain why i needed this.

in OpenFalcon (Falcon4 mod) i use my trackIR to look around. nothing special. but i have the FOV zoom axis in-game mapped to my right foot. this allows me to easily look closer at switches so i can click on them in the 3D pit. the game supports a zoom with the TRACKIR, but its tiring always having to lean forward and put my face on the monitor LOL.

say i want to get a good look at the radar MFD. i look at it with trackIR.. then use the right foot to zoom in on it and then push in the left foot to both pause the zoom AND my trackir. at this point i can release the right foot, and start using the mouse to click the buttons.

Bob Church
27th March 2008, 12:39 PM
Hi Gutted52,

I see. Yeah, I don't like having to lean down into the monitor in FS with the TIR. Gives me a sore neck after awhile. If I'd thought about it a little more carefully I'd have realized I shouldn't have inverted cms.b33 on you. I started out like this actually:


script
cms.b33 = [ js3.a1 > 50 ];
if( NOT cms.b33 ) then
cms.a2 = js3.a2;
endIf
endScript

and then got to thinking I could avoid the NOT operation if I just turned the comparison over. Too many years of assembly programming I guess. :) Your post sounded like you mostly just needed a hint about the axis anyway. The logic was all there.

Anyway, glad to hear you got it all working!

Best regards,

- Bob

The StickWorks
http://www.stickworks.com