#Flight sim value to reset to zero on Start

1 messages · Page 1 of 1 (latest)

warped ermine
#

I am using a lot of offsets in order to bind sequential functions to the same button and I'd like to know if there is a way to reset to 0 all the offsets when a plane spawns or the profile starts.

#

Flight sim value to reset to zero on Start

fallen vale
#

Have you activated Auto Retrigger and Auto Run in Extras Settings?

warped ermine
#

This one?

fallen vale
#

yes

warped ermine
#

I saw it but it wasn't clear for me what it does

fallen vale
#

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

warped ermine
#

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?

fallen vale
#

which simulator and aircraft is this for?

warped ermine
#

it is for MSFS2020 and I use them in all aircrafts for all sorts of functions

fallen vale
#

you said offsets, why fsuipc then?

warped ermine
#

sorry but I don't understand the question

fallen vale
#

offsets are used with fsuipc

#

although fsuipc works with msfs2020 it is not needed, with the only exception of the PMDG 737.

warped ermine
#

by offset I mean a custom variable that changes values with every push so that I can use preconditions

fallen vale
#

Simconnect events are easier to use and understand IMO

#

so it is not a Fsuipc offset?

warped ermine
#

I use offsets like no

#

it's a custom one like 0x5300

warped ermine
fallen vale
#

I am not following.... Mobiflight only uses that type of offset with FSUIPC

#

so they are fsuipc user defined offsets

warped ermine
#

I followed Sebastian's tutorial to make sequential frunctions for the same button

fallen vale
#

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

warped ermine
#

so in your opinion how could I assign more effciently sequential functions to the same button?

fallen vale
#
  1. 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

warped ermine
#

everything is done in Mobi

fallen vale
#

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

warped ermine
#

so i should use mobi variables and not FSUIPC offsets?

fallen vale
#

that is my first recommendation to you

warped ermine
#

ok and how can I initialize variables to 0 on every run?

#

or they are initialized automatically to 0?

fallen vale
#

to understand, these are values that have nothing to do with the aircraft state?

warped ermine
#

no

#

they just work as a memory so I can sequence actions with Preconditions

fallen vale
#

I would use simulation time variable as an indicator when a flight is initiated.

warped ermine
#

ok that sounds complicated 😅

fallen vale
#

so if sim time is less than say 5 seconds, execute a set of output configs that set MF variable values back to 0

warped ermine
#

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

fallen vale
#

OK, Mobiflight will reset all of the MF variables when you press stop and run

warped ermine
#

that's good to know

fallen vale
#

it will also un register all output subscriptions from Simconnect and re register them when you press run

warped ermine
#

and how can I do that?

fallen vale
#

do what?

warped ermine
#

un register all output subscriptions from Simconnect and re register them

fallen vale
#

that is done automatically with every stop and run

warped ermine
#

oh ok I got it now

fallen vale
#

but that has no effect on the sim

#

it is just the set of values that the sim is asked to send to Mobiflight

warped ermine
#

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

fallen vale
#

it is a lot better to name a MF variable like Button Select, instead of 0x5300

warped ermine
#

that's for sure 😅

#

thank you again for your time

fallen vale
#

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.

warped ermine
#

ok will remember this when I will use it

warped ermine
#

@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

fallen vale
#

if($<5,1,0)

warped ermine
#

I write it in Display ?

fallen vale
#

this is a Transform for the simulation time

#

modify tab

warped ermine
#

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?

fallen vale
warped ermine
#

ok, it would have been great to have multiple instructions executed at the same time with only one output condition

#

thank you

fallen vale
#

if you care to learn how to use RPN for MSFS2020, then it is a different ball game.

warped ermine
#

I'll look into it