Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

I would like to program the Flyingiron Spitfire Airframe Side door to open with my Hardware. This is controlled through an LVAR L:AIRFRAME_DOOR.

1= Open; 0.1 = Closed /Unlocked; 0 = Closed / Locked.

I can set the values 1 and 0 just fine, by adding the LVAR to my Macro list and assigning the buttons. But i'm unable to set a parameter value of 0.1.

The advanced user guide says: Values are limited to the normal parameter range, –32768 to 32767

How can i set this LVAR to a value of 0.1? Or is this simply not possible?

 

Kind Regards,

Andre

 

Posted
14 hours ago, Andre92 said:

How can i set this LVAR to a value of 0.1? Or is this simply not possible?

I don't think this is possible using macros as the parameter will be treated as an int. However, there are two things you can try:

1. you can add that lvar to a free user offset, using the lvars-to-offsets functionality, using a type of 'F' (for 4-byte floating point numbers). Then you can assign to the Offset Float32 Set/1000 control, specifying the user offset you are using with a parameter of 100.

2. You can use a lua script, passing in a parameter of value*10 and then dividing the parameter by 10 in the lua script before setting the lvar value, using the ipc.writeLvar function (or have the value hard-coded, if you prefer).

John

Posted

Hello John,

Thank you for your help.

I'm not sure my programming skills are up to it, but i'll try my best.. 🙂

Using the lvars-to-offsets functionality, i would add this to the fsuipc.ini

[LvarOffsets.Spit]

0=L:AIRFRAME_DOOR=F66FF

For Offset 66FF with Type F? In the documentation i could only find SB, UB, SW, UW, SD, UD as size. But no reference to type F? Sorry for the noob question.

And then use the Offset Float32 Set/1000 with Parameter 100 through the FSUIPC Button Assignments UI.

 

Kind Regards,

André

Posted
2 minutes ago, Andre92 said:

Using the lvars-to-offsets functionality, i would add this to the fsuipc.ini

[LvarOffsets.Spit]

0=L:AIRFRAME_DOOR=F66FF

For Offset 66FF with Type F?

You cannot use 66FF, as the offset is 4 bytes so would go from 66FF to 6702 (4 bytes), and so would overwrite the data in offset 0x6700.
Try with 66FC - data would go to 66FC - 66FF (4 bytes).

4 minutes ago, Andre92 said:

In the documentation i could only find SB, UB, SW, UW, SD, UD as size. But no reference to type F? Sorry for the noob question.

Then I suspect that you are using an old version of FSUIPC7. The 'F' designator was added in the most recent release, v7.2.7, released on the evening of the 23rd (two days ago). Please download and update.

6 minutes ago, Andre92 said:

And then use the Offset Float32 Set/1000 with Parameter 100 through the FSUIPC Button Assignments UI.

Yes, and you also need to specify the offset you are using (66FC?).

John

Posted

Ok, had some time to play around:

I added

[LvarOffsets.Spit]
1=L:AIRFRAME_DOOR=F0x66FC

to the fsuipc.ini and assigned the Offset Float32 Set/1000 to a button with Offset x66FC and Parameter 100.

- The Offset is changed to 0.1 when i press the button but the door is not unlocked.

- Also tried Parameter 1000, so the Offset is changed to 1, but also no response.

Than i had the Offset value displayed (in the FS Window) to see if it's working at all.

- When i unlock the door by clicking on the mousespot for it, the Offset value is also changed to 0.1 (so it seems to be correctly connected to the AIRFRAME_DOOR LVAR)

- When i assign a button directly to the LVAR L:AIRFRAME_DOOR=Set, with Parameter 0 or 1, the Offset is changed accordingly, but the door is also not responding.

- When i assign L:AIRFRAME_DOOR=Toggle, the door is opened and closed (and the Offset changed to 0 and 1) when i press the button.

- When i set the LVAR AIRFRAME_DOOR through the FSUIPC UI /addons/WASM/Set Lvar, it works (also with 0.1) and the Offset is also responding accordingly.

 

-Changing the AIRFRAME_DOOR LVAR by Mouse click, Set LVAR (FSUIPC UI) or the L:AIRFRAME_DOOR=Toggle function, works.

-Changing it through the Offset or the AIRFRAME_DOOR=Set (neither 0, 1 or 0.1) function does not work.

-Changing the Offset, does not change the AIRFRAME_DOOR value, changing the AIRFRAME_DOOR does change the Offset.

 

Am i doing something wrong here? Otherwise i'll try the 2. Option you suggested. (Will have to dig into the LUA Programming a bit 🙂 ).

 

Thank you for your assistance.

Kind Regards,

Andre

 

Posted

Just tried the L:AIRFRAME_DOOR=Set function again. It does work, but partial.

No matter what parameter is set, the AIRFRAME_DOOR value is always set to 0 when i assign this function to a button.

 

Posted

Hi Andre,

Hmm, sounds very strange - I don't understand, for example, how the Toggle action can work but the Set not, as this should result in exactly the same code being executed in the WASM.

14 hours ago, Andre92 said:

No matter what parameter is set, the AIRFRAME_DOOR value is always set to 0 when i assign this function to a button.

This seems to contradict what you said earlier:

14 hours ago, Andre92 said:

to the fsuipc.ini and assigned the Offset Float32 Set/1000 to a button with Offset x66FC and Parameter 100.

- The Offset is changed to 0.1 when i press the button but the door is not unlocked.

I'll take a look to see what is happening. I don't have the a/c you are using, but I should be able to trace what is happening with any lvar, so I'll do that first. I may need you to activate Debug logging in both the WASM and WAPI and show me your logs (and FSUIPC7.ini) if I don't find anything this way, but lets see what I find first...

While I'm doing this, maybe try adding the lvar as a 8byte (double) number, by using:
 

14 hours ago, Andre92 said:

[LvarOffsets.Spit]
1=L:AIRFRAME_DOOR=0x66F8

and the Offset Float64 Set/1000 control.

I'll try and look at this this afternoon, but may take a while...

John

Posted

Thanks John,

I did try the Offset Float 64 Set/1000 just now, but except for the Offset values changing, no change in behaviour.

The Set function normally behaves fine. I use it f.e. to change the Radiator function between Open/Auto with Parameter 0 and 1.

 

But no rush on this. It's really not that important to get this working. I can toggle the door and the unlock is just an extra.

I will try to write a LUA file, just for the learning experience. 🙂

 

Thanks for your help and

Kind Regards,

Andre

Posted

Hi Andre.

I've bought the Spitfire now and will take a look at this later this afternoon or evening (a bit busy at the moment on non-MSFS stuff....).

I went to the Reginald Mitchell C.P. School in Butt Lane (Kidsgrove), where R.J. Mitchell was born, the designer of the Spitfire. I was born in  Clough Hall (Kidsgrove), about a mile away. I've been thinking of getting a Spitfire for a while, although I don't usually fly combat aircraft...

I'll ley you know what I find.

Cheers,

John

Posted

Oh wow, very nice! If you have a VR set. Try it with that, it really comes to life in VR. And be careful with the Boost on Take-off. I usually start with only 0 Boost till the tail comes up and then slowly increase to 6-8.

I'm fiddling around and building simulators as a hobby and have now started to build a Spitfire Pit with the Authentikits DIY controls https://authentikit.org/

Andre

Posted (edited)

I don't fly VR, but those Authenkits do look interesting though, thanks for the link.

Anyway, I've found the problem - I hadn't update the lvar write code to recognise the new 'F' flag, and there were some dodgy type conversions when setting using doubles/8-bytes. This has been corrected in the attached version. With this, you can control as previously advised, by adding L:AIRFRAME_DOOR to an offset (either as a float or double) and then using the Offset Float32 Set/1000 (or Offset Float64 Set/1000control.

John

 

FSUIPC7.exe

Edited by John Dowson
attachment updated to latest beta version
Posted

Also not that using lvars directly, you can open the door with the canopy still closed, which you can't actually do in the UI. If you wanted to replicate this behavior, you would have to use a lua script to check the lvar AIRFRAME_CanopySlider (and maybe AIRFRAME_CanopySliderTarget ) to see if the canopy is open before trying to set the lvar to open (or unlock) the door.

Posted

Hi John,

With the updated Exe it works.
I used the compound button programming to condition the opening of Canopy and Frame door.

 

Thank you!  I hope you have a lot of fun flying the Spitfire.

Cheers,
Andre

Posted
1 hour ago, Andre92 said:

With the updated Exe it works.

Ok, but I've just released 7.2,8 with a few memory fixes, so you should update to that - includes an update to the WASM as well.

1 hour ago, Andre92 said:

I used the compound button programming to condition the opening of Canopy and Frame door.

Yes, good idea - I will do the same!

1 hour ago, Andre92 said:

I hope you have a lot of fun flying the Spitfire.

Yes, looks an interesting beast, although I'm not sure when I'm going to find time to understand and fly this a/c proficiently - I get very little time for recreational flying these days...

Cheers,

John

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.