What I meant, was : the solution is we have to read them as numeral not boolean and it works
Can’t seem to subscribe to a certain LVAR
-
- Posts: 5336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Can’t seem to subscribe to a certain LVAR
I know that. It’s why i said use Enum or number. What I meant was It would be nice if AM did that for us. We just use type Bool and if it’s MSFS AM would translate that to/from 0 or 1. It matters not a lot to me but I can see how it trips people up as was the case here.SimPassion wrote: ↑Wed Mar 22, 2023 10:30 amWhat I meant, was : the solution is we have to read them as numeral not boolean and it works
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
-
- Posts: 5336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Can’t seem to subscribe to a certain LVAR
+1Sling wrote: ↑Wed Mar 22, 2023 12:31 pmI know that. It’s why i said use Enum or number. What I meant was It would be nice if AM did that for us. We just use type Bool and if it’s MSFS AM would translate that to/from 0 or 1. It matters not a lot to me but I can see how it trips people up as was the case here.SimPassion wrote: ↑Wed Mar 22, 2023 10:30 amWhat I meant, was : the solution is we have to read them as numeral not boolean and it works
Agree, I think AM is able to know or predict variable types better than ourselves, so this feature would become handy
Re: Can’t seem to subscribe to a certain LVAR
How should AM know that it is a boolean? You can subscribe as a boolean, but what if it returns 10 for example?
-
- Posts: 5336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Can’t seem to subscribe to a certain LVAR
That would be very confusing, since in Lua you subscribed to a boolean. And then you'll still be getting a double?
-
- Posts: 5336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Can’t seem to subscribe to a certain LVAR
Would requires a new "unknown" or "uncertain" variable type, or something like this.
This is not for me, just a suggestion to help and avoid simmers wondering on not having values on subscribe ...
- Crunchmeister
- Posts: 222
- Joined: Tue Aug 10, 2021 2:06 pm
Re: Can’t seem to subscribe to a certain LVAR
I've found Number or Enum will typically work for "boolean" lvars. Never encountered one that required a double as of yet though. I'd prefer if I could use a bool as a bool, but in the end, as long as it works, I'm good. It's not a huge workaround.
- Ryzen 5950x, 64GB 3600MHz RAM, RTX3070Ti
Simstrumentation Instrument dev
Free Air Manager instruments for MSFS available at http://www.simstrumentation.com
Simstrumentation Instrument dev
Free Air Manager instruments for MSFS available at http://www.simstrumentation.com
Re: Can’t seem to subscribe to a certain LVAR
You tell it in the subscribe or the write. If it’s got the possibility to return 10 then it isn’t a Boolean and clearly another type should be used. It’s the same as subscribing to an Avar really. If it’s not a Bool then using Bool will not work. You still have to use the correct type as always.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Can’t seem to subscribe to a certain LVAR
that wasn't what was asked.....Sling wrote: ↑Wed Mar 22, 2023 9:24 pmYou tell it in the subscribe or the write. If it’s got the possibility to return 10 then it isn’t a Boolean and clearly another type should be used. It’s the same as subscribing to an Avar really. If it’s not a Bool then using Bool will not work. You still have to use the correct type as always.
Joe. CISSP, MSc.