PDA

View Full Version : Assigning an axis value


Skid
29-02-2004, 06:12 AM
Hello

I'm trying to override my Fighterstick throttle wheel axis value temporarily while the mini-stick on the Pro Throttle's y-axis exceeds a certain value.

I have tried several constructs (IF, SEQUENCE, CASE) in a script but I can't seem to get anything to compile.

Here's some pseudocode of what I was trying to do:
----------------
A1 = JS1.A3 // store the FS throttle wheel's axis value

// if the ministick is pushed downwards
IF ( JS2.A2 > 160 ) THEN
// set the throttle wheel axis to full value
JS1.A3 = 255;
ELSE
// set the wheel axis back to what it was
JS1.A3 = A1;
ENDIF
------------------

As I mentioned, I tried using a SEQUENCE and a SELECT/CASE in place of the IF statement. I keep getting various vague assignment errors such as 'Expecting a ) but found >' and so on...

What would be the best approach to accomplish this?

Skid

Bob Church
29-02-2004, 01:10 PM
There are really two problems in what you've got there. First, you can't assign to JSx, you can't have a JSx.Ax or JSx.Bx to the left of the equal sign. Those values come from the hardware itself. The second problem is the lack of square braces on the comparison. It should be:

IF( [ JS2.A2 > 160 ] ) THEN.....

Anyway, what you're doing is basically what you have to do, but you need to pass the value through a CMS axis to avoid the assignment to hardware. Something like this:

if( [ js2.a2 > 160 ] ) then
cms.a1 = 255;
else
cms.a1 = js1.a3;
endIf

If the JS2.A2 value is low, CMS.A1 will track JS1.A3. If JS2.A2 is > 160, CMS.A1 will go to max. Then you need to go up into the GUI and assign CMS.A1 to go wherever JS1.A3 is going now, and assign JS1.A3 to go nowhere (set Device and Control to NONE).

Hope this helps!

- Bob

The StickWorks
http://www.stickworks.com

Skid
29-02-2004, 09:59 PM
Thank you, Bob! :D

I just tested it out and it works great!

My biggest mistake was assuming that the scripting could send out values that would mask or override the actual values issued by the hardware and would "trick" the game into reading my new script generated values. :wacko:

I see how using the CMS devices solves the problem. Cool, I learned something today.
:)

Skid