mpaperno / MSFSTouchPortalPlugin

A plugin which provides a two-way interface between Touch Portal clients and Flight Simulators which use SimConnect, such as MSFS 2020 and FS-X.
GNU General Public License v3.0
65 stars 4 forks source link

Custom "Camera & Views" states not listed #47

Closed brianavid closed 1 year ago

brianavid commented 1 year ago

If I add some new custom states to control the camera, they correctly appear in the "Camera & Views" category of (e.g.) IF statements. But if I try to set them through "Set Simulator Variable", the drop-down list of variables is those for a DIFFERENT category - the category I had selected BEFORE I selected category "Camera & Views". BrianStates.ini.txt Screenshot 2023-01-22 220347 Screenshot 2023-01-24 084407

I can probably get my page working using Set Named Variable Value, but it looks like a bug that may have other implications.

brianavid commented 1 year ago

And a related symptom. If I try an event handler for "When the plug-in state" changes, then I can see all my Camera states, and can choose any of them apart from one - "Camera State". If I select that one (alone) then the field for the state name remains empty. For all others, it fills in the field with the selection from the drop-down:

Screenshot 2023-01-24 093550

This may be a TP bug, but it seems related to the reported symptoms above.

mpaperno commented 1 year ago

Hi Brian, thanks for reporting this.

Funny coincidence, I was literally just made aware of the first problem 2 days ago (you're not "Spider" on Discord, are you? :) ). Not sure what's up yet, but it does seem to only affect the Cameras & Views category. In the meantime, yes, just use the "Set Named Variable" action, it will essentially do the same thing (the "select from list" is meant as a convenience really... and is actually getting changed in the next version anyway). This shouldn't affect anything else as far as I can tell so far.

As for the 2nd issue, I cannot recreate it. I'm not entirely sure what you mean by "remains empty"... the dropdown selector for the state doesn't show any value in it at all? I've not seen anything like that before. And your CAMERA STATE request look a lot like mine (below).

I have seen TP not properly list all the states loaded at once from an INI file, but only when I use the "reload all custom state files" action (which first deletes all the states and then re-creates them). But I'm not sure what's going on here! Not even sure what to try to reproduce it... seems like it should just work like the other requests/states, or have some error and not show up in the list at all.

Well... is it possible somehow that Camera State state got deleted? And TP didn't update the list properly? I'm reaching...

Here's my CAMERA STATE request... pretty much the same, and the Unit type difference shouldn't matter (certainly not for TP itself).

[CameraState]
CategoryId = Camera
Name = "CAMERA STATE"
VariableType = A
SimVarName = "CAMERA STATE"
Unit = "Enum"
DefaultValue = "0"
CanSet = True

Best, -Max

brianavid commented 1 year ago

Thanks Max,

It was just a coincidence that you had already heard about the problem just before. No - I am not "Spider" and I tend to avoid Discord unless it is absolutely the only way to communicate! As to why the bug only affects the Cameras & Views category, one thing I spotted is that appears to be the only category totally empty in entry.tp - maybe just a coincidence though.

What I meant by the second (possibly unrelated) symptom is that when I pick "Camera State" from the drop-down list of five Cameras & Views state values, then no text is added to the associated text field in the event. Selecting any of the other four options will set the text field correctly. But this feels like a TP bug to me.

I had been thinking that the problem was possibly irrelevant as I cannot get MSFS to respond to changes to CAMERA STATE etc. The Simvars do not seem to be settable - despite the documentation. I can't get them to change when I test via WASimUI. My first fall-back strategy was to check the current values (which are correct) and then to use TP key press actions to change them as needed. But key presses suffer from frequent lack of focus for keyboard events. However, I have just discovered your TJoy plugin, and plan instead to bind to VJoy buttons, which should continue to work even when I click away from the MSFS window. I can bind the VJoy buttons in the MSFS Control Options.

But (just in case), have you any reason or experience to suggest that setting CAMERA STATE etc does work??

Cheers, Brian

On Wed, 25 Jan 2023 at 06:38, Max Paperno @.***> wrote:

Hi Brian, thanks for reporting this.

Funny coincidence, I was literally just made aware of the first problem 2 days ago (you're not "Spider" on Discord, are you? :) ). Not sure what's up yet, but it does seem to only affect the Cameras & Views category. In the meantime, yes, just use the "Set Named Variable" action, it will essentially do the same thing (the "select from list" is meant as a convenience really... and is actually getting changed in the next version anyway). This shouldn't affect anything else as far as I can tell so far.

As for the 2nd issue, I cannot recreate it. I'm not entirely sure what you mean by "remains empty"... the dropdown selector for the state doesn't show any value in it at all? I've not seen anything like that before. And your CAMERA STATE request look a lot like mine (below).

I have seen TP not properly list all the states loaded at once from an INI file, but only when I use the "reload all custom state files" action (which first deletes all the states and then re-creates them). But I'm not sure what's going on here! Not even sure what to try to reproduce it... seems like it should just work like the other requests/states, or have some error and not show up in the list at all.

Well... is it possible somehow that Camera State state got deleted? And TP didn't update the list properly? I'm reaching...

Here's my CAMERA STATE request... pretty much the same, and the Unit type difference shouldn't matter (certainly not for TP itself).

[CameraState]CategoryId = CameraName = "CAMERA STATE"VariableType = ASimVarName = "CAMERA STATE"Unit = "Enum"DefaultValue = "0"CanSet = True

Best, -Max

— Reply to this email directly, view it on GitHub https://github.com/mpaperno/MSFSTouchPortalPlugin/issues/47#issuecomment-1403161966, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLSMFQQI6ZJ5QWTAGXGK3WUDC7JANCNFSM6AAAAAAUEZ5LHM . You are receiving this because you authored the thread.Message ID: @.***>

mpaperno commented 1 year ago

Well, funny coincidence... I guess it's "cameras and views" month or something. :)

I found the issue in the code... happened in the last update with the other category changes. The only other place this affects is "Remove a Simulator Variable" action.

Still no clue on your other issue with this blank state... TP restarted and all that?

On a whim I tried using your exact naming, and seeing the "1=>" in the name of the preceding request made me wonder if that had something to do with anything. But, no, all the states stay selectable as usual.

Glad you found TJoy -- it's a great alternative for pushing buttons (and the only way to have "holdable" buttons like on a real joystick). Also some of the view axes can only be controlled by a joystick. And it may be simpler to set up, depending on how you prefer to keep your controller mappings. I wrote it with the flight sim in mind (and before I added "native" sliders to MSFS plugin).

However I'm not sure why you're having issues setting CAMERA STATE. It does indeed work here... as an example:

image

I looked quickly for some setting in the Sim which may prevent external camera control... but not seeing it. Do none of the view options (Enum values) work for you at all? Are you using VR (noticed the Camera Request state)? I could see that perhaps having something to do with it...

Ah the mysteries of MSFS... we'd probably get bored w/out them and have to resort back to simulated system failures. On the positive side, you may wake up tomorrow and it will all just work. :-D

If you get any further on that "missing" Camera State state, please let me know. Submitting TP bugs requires Discord use.. I think. Or maybe they have an online form too... not sure. Anyway, happy to help get to the bottom of it, if possible.

Thanks again, -Max

brianavid commented 1 year ago

Thanks Max,

The camera state values are now all working using "Set named value". I can set them. The critical change was to use the unit "Enum" in place of "number". I actually changed this in both the INI file and the action, though probably either one would have been sufficient.

The problem with the failure to update the variable name field text from the drop-down has gone away. It was probably just a transient TP glitch that cleared on a reboot.

TJoy has already solved one issue for me. I can now toggle viewing the ATC panel from TP. There is no SimConnect action for this that I can find, and sending a Scroll Lock key press was an issue if another app (e.g. Air Manager or Little Navmap) steals keyboard focus. This action now goes through a Vjoy button. I look forward to extending my use of Tjoy in future.

FYI, submitting issues to TP can be done through a form as well as Discord. I tried this asking for clarification for the "focus application" action parameter for the KeyPress issue. However, I never got an acknowledgement, so I guess no-one looks at them!!

Thanks again Cheers, Brian

On Wed, 25 Jan 2023 at 09:13, Max Paperno @.***> wrote:

Well, funny coincidence... I guess it's "cameras and views" month or something. :)

I found the issue in the code... happened in the last update with the other category changes. The only other place this affects is "Remove a Simulator Variable" action.

Still no clue on your other issue with this blank state... TP restarted and all that?

On a whim I tried using your exact naming, and seeing the "1=>" in the name of the preceding request made me wonder if that had something to do with anything. But, no, all the states stay selectable as usual.

Glad you found TJoy -- it's a great alternative for pushing buttons (and the only way to have "holdable" buttons like on a real joystick). Also some of the view axes can only be controlled by a joystick. And it may be simpler to set up, depending on how you prefer to keep your controller mappings. I wrote it with the flight sim in mind (and before I added "native" sliders to MSFS plugin).

However I'm not sure why you're having issues setting CAMERA STATE. It does indeed work here... as an example:

[image: image] https://user-images.githubusercontent.com/1366615/214521147-c42f4773-c33a-427f-8105-01a4f176844d.png

I looked quickly for some setting in the Sim which may prevent external camera control... but not seeing it. Do none of the view options (Enum values) work for you at all? Are you using VR (noticed the Camera Request state)? I could see that perhaps having something to do with it...

Ah the mysteries of MSFS... we'd probably get bored w/out them and have to resort back to simulated system failures. On the positive side, you may wake up tomorrow and it will all just work. :-D

If you get any further on that "missing" Camera State state, please let me know. Submitting TP bugs requires Discord use.. I think. Or maybe they have an online form too... not sure. Anyway, happy to help get to the bottom of it, if possible.

Thanks again, -Max

— Reply to this email directly, view it on GitHub https://github.com/mpaperno/MSFSTouchPortalPlugin/issues/47#issuecomment-1403300335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLSMCU2FB2B5VQE4YIBELWUDVEFANCNFSM6AAAAAAUEZ5LHM . You are receiving this because you authored the thread.Message ID: @.***>

mpaperno commented 1 year ago

Ha, yes, I forgot the "best" feature of using the joystick, that silly ATC window. There actually is a SimConnect Event ID for it.. ATC. But for some bizarre reason it has never worked in FS2020... even after lots of other stuff has gotten fixed and added. 🤷🏼‍♂️

Glad you got the rest sorted!

TP is basically a one-man operation, and the developer is stretched between many duties, so unfortunately some things are going to slip through the cracks. Not making excuses, just so you know the context (the Web site may make it seem like a bigger operation than it is).

If you were trying to "focus application" on MSFS, I think the current issue is that the MS "Store" apps (or XBox Store as the case may be) do not actually report themselves as typical Windows applications do (at least the traditional kind). I know this has come up recently and the developer is looking for a solution.

Cheers! -Max