#Flight sim value to reset to zero on Start
1 messages · Page 1 of 1 (latest)
Have you activated Auto Retrigger and Auto Run in Extras Settings?
yes
I saw it but it wasn't clear for me what it does
that will sync the sim to your panel state
Retrigger can also be bound to a button
However, normally a momentary button does not carry a state.
Normally on a momentary button, a toggle event is executed on Press
with nothing in On Release
I understand fo switches but for buttons I want to reset all the offset values to 0 on start or run how could I do it?
which simulator and aircraft is this for?
I coded my offsets so to go back to 0 once all the sequential actions are done but if the sequence is not finished and the plane respawns the value remains in memory
it is for MSFS2020 and I use them in all aircrafts for all sorts of functions
you said offsets, why fsuipc then?
sorry but I don't understand the question
offsets are used with fsuipc
although fsuipc works with msfs2020 it is not needed, with the only exception of the PMDG 737.
by offset I mean a custom variable that changes values with every push so that I can use preconditions
Simconnect events are easier to use and understand IMO
so it is not a Fsuipc offset?
no
I am not following.... Mobiflight only uses that type of offset with FSUIPC
so they are fsuipc user defined offsets
I followed Sebastian's tutorial to make sequential frunctions for the same button
that must have been a very old video, pre 2021
lol
Mobiflight gained Simconnect direct functionality since 2021
and Mobiflight internal variables since late 2021
so in your opinion how could I assign more effciently sequential functions to the same button?
- I would not use fsuipc for storing custom values, if that is what you are doing
use Mobiflight native variables for that
it is faster and more efficient
yes, Mobiflight has to communicate with Fsuipc to tell it to store a value at a particular offset and then communicate back to read the value every time its needed.
none of that is necessary using a Mobiflight variable
the value is stored inside Mobiflight and retrieved from its own memory
so i should use mobi variables and not FSUIPC offsets?
that is my first recommendation to you
ok and how can I initialize variables to 0 on every run?
or they are initialized automatically to 0?
to understand, these are values that have nothing to do with the aircraft state?
I would use simulation time variable as an indicator when a flight is initiated.
ok that sounds complicated 😅
so if sim time is less than say 5 seconds, execute a set of output configs that set MF variable values back to 0
I ll try like this but where can I find sim time value?
i found it It's called simulation time
I'll see what I can do with it. thank you again for your insightful info
OK, Mobiflight will reset all of the MF variables when you press stop and run
that's good to know
it will also un register all output subscriptions from Simconnect and re register them when you press run
and how can I do that?
do what?
un register all output subscriptions from Simconnect and re register them
that is done automatically with every stop and run
oh ok I got it now
but that has no effect on the sim
it is just the set of values that the sim is asked to send to Mobiflight
it's clear now. I will play then with MF variables so that FSUIPC will not store any data as it does now with offsets
it is a lot better to name a MF variable like Button Select, instead of 0x5300
no problem.
when using simulation time, it is important to keep in mind that the sim frame time is maybe 40 cycles per second.
so if you say check if simulation time is less than 5 seconds, that statement is actually true for 5 seconds, which causes your variables to be reset at least 50 times before it stops.
ok will remember this when I will use it
@fallen vale I'm coming back to you as I have difficulties coding this "if sim time is less than say 5 seconds, execute a set of output configs that set MF variable values back to 0"
could you please help me write a short code for one variable, I need an example...
I found the variable but how can I compare it and link it to other variables...?
I just need an example so I can write them myself
if($<5,1,0)
I write it in Display ?
ok this is to modify the Output value
and now how can I use this output value to modify other variables?
ok I found out how to do it, through the Display Page
do you know if it is possible to add multiple input actions to the same output?
you have to duplicate the whole output config changing the input action desired.
ok, it would have been great to have multiple instructions executed at the same time with only one output condition
thank you
your use case is rather rare, so MF is not geared to execute multiple things on a single config either on input or output. Multiple configs is the way.
if you care to learn how to use RPN for MSFS2020, then it is a different ball game.
I'll look into it