Cockpitbuilders.com

Main => Builders Discussions => Topic started by: rs3tier on April 17, 2014, 09:07:29 PM

Title: SIOC to FSUIPC Button (resolved)
Post by: rs3tier on April 17, 2014, 09:07:29 PM
Hi Guys

I am hoping someone can give me a little help getting SIOC to fire a Joystick button in FSUIPC.

I currently have a button configured in FSUIPC - and when I press it it shows up as Joy# 0 and Btn# 3 (so button 3 on Joystick 0).

I have the following SIOC script which I am trying to get to emulate pressing this button but it does not work.  I am not sure but my feeling is I am using the wrong offset ($3340) as most things I have read suggest this offset refers to Joy# 64

Can anyone tell me what offset I should use for Joy# 0 - or otherwise see what might be wrong with this script??

Thanks,
Rob


// *****************************************************************************
// * FileName : XPNDR.txt
// * Date : 18/04/2014



Var 4001, name I_R_STB, Link IOCARD_SW, Device 5, Input 0
{
  IF &I_R_STB = 1
  {
    &command = 955   
  }
}

Var 4002, name I_R_ALT, Link IOCARD_SW, Device 5, Input 1
{
  IF &I_R_ALT = 1
  {
    &SaitekYoke = CHANGEBIT 3, v4002 // toggle bit 3 of joystick 0
  }
}

Var 5000, name command, Link FSUIPC_OUT, Offset $9400, Length 2
Var 5001, name SaitekYoke, Link FSUIPC_OUT, Offset $3340, Length 4
Title: Re: SIOC to FSUIPC Button
Post by: dc8flightdeck on May 20, 2014, 02:47:32 PM
I did this by first creating a custom offset in FSUIPC assigned to the corresponding button, then wrote SIOC script to respond to the custom offset.

In the B-52 sim this is how I used to SIOC Sounds for actions like the bomb bay door transition sounds.
Title: Re: SIOC to FSUIPC Button
Post by: rs3tier on May 20, 2014, 06:26:02 PM
Sorry, I should have updated this post.
I found the solution eventually - which really just involved unmasking my own stupidity.

I assumed I actually had to use a real joystick button to act as a "place holder" of sorts.  Once i realised the virtual joystick just meant that I could treat one of the SIOC inputs as they joystick button, then everything started working beautifully - it got detected as Joystick #64, button 0

Thanks