As the title says, how do remove covers and chocks by code?
I can’t see simvar settings to do it.
A:COVER ON:0 = chocks
A:COVER ON:1 = engine covers
A:COVER ON:2 = pitot covers
Great, ty!
Do you have reference for that, as I can’t find them anywhere in the docs?
https://docs.flightsimulator.com/msfs2024/html/3_Models_And_Textures/Modeling/Aircraft/Airframe/Covers_Chocks_Pins.htm
https://docs.flightsimulator.com/msfs2024/html/6_Programming_APIs/SimVars/Simulation_Variables.htm
Do you have an example of the correct syntax to turn them on/off?
I tried the obvious one but it doesn’t work:
SimVar.SetSimVarValue(“A:COVER ON:0”, “bool”, 0);
SimVar.SetSimVarValue(“A:COVER ON:1”, “bool”, 0);
SimVar.SetSimVarValue(“A:COVER ON:2”, “bool”, 0);
Getting them returns 1 if you start C&D, but they don’t appear to be settable?
[Log] Before setting covers
[Log] Chocks: 1
[Log] Engine Cover: 1
[Log] Pitot Cover: 1
[Log] After setting covers
[Log] Chocks: 1
[Log] Engine Cover: 1
[Log] Pitot Cover: 1
[Log] Test Cover: 0
Looks like COVER_SET
exists and takes a bool and a flag index.
#IS_COVER_ON# ! #COVER_FLAG# (>K:2:COVER_SET)
That’s XML?
How to do that in js?
var chocks = SimVar.GetSimVarValue(“A:COVER ON:0”, “bool”);
appears to work and returns 1 for a cold n’ dark start.
But SimVar.SetSimVarValue(“A:COVER ON:0”, “bool”, 0);
doesn’t change it, as if you read it again it’s still 1.
There’s no docs on it I can see, but it doesn’t seem settable, only gettable.
It’s an K:2 event from RPN that I dug out of the SDK modelbehaviors. You can’t use SetSimVarValue like other K:Events, because it can’t set both values, but you can use the solution here to send it from JS: Using Event ID with index in JS
Ok, thanks, will try that.
Update: No joy there either.
I don’t understand why there is also no control option setting to set a quick key remove Chocks, Covers, Pins. I saw one for covers, tried it, but it didn’t do anything.
Starting in a parking spot or custom as Shut Down has all the CCP ON, which is fine but if you do Space C to fast enter the cockpit it doesn’t automatically remove them.
There should at least be a setting to do that, or some kind of warning they are still in.
CTRL E quickstart should also remove CCP’s by default, but it doesn’t, they’re all still in. Ditto for Shift CTRL E it should place the CCP back in automatically.
CTRL-E not removing automatically all the Covers is a pain for a lot of casual simmers as the engine will definitely not start with them on
I really like to idea of Shift CTRL E to do it
Hi, may I ask where you found these? They’re not documented, and I’m on a mission to find new ones.
There’s a list going on here:
https://devsupport.flightsimulator.com/t/msfs-2024-sdk-new-simvars/10244
Thanks,
-Max
With the Behavior tool, digging a bit. And yes, they can’t be written back, the only way is with a new style event
(>K:2:COVER_SET)
Which unfortunately, doesn’t work with execute_calculator_code, I guess from WASM/Simconnect it might require the TransmitEvent_EX1, but haven’t found the time to try it.
Has anyone managed to get it working from js/ts?
Can you post a working example if so?
I’ve tried various combinatons including Coherent.call(‘TRIGGER_KEY_EVENT’ with no luck.
I honestly can’t believe they implemented CCP’s with no ability to get/set them automatically, but then again there’s nothing in the docs so who knows?
FWIW I can’t get COVER_SET
event to work at all… neither from WASM execute_calclator_code()
or trigger_key_event_EX1()
, nor with SimConnect.TransmitClientEvent_EX1()
. Tried lots of variations (and other calc code/transmit with 2 values works).
Maybe that’s why it’s not documented yet… haha.
Yes, never recommended to use undocumented things anyway!
You have not lived.
Speaking of documented, an L:Var is defined along with the toggle interactions, toggling this L:Var (VAR_NAME
). Maybe that can be used.
https://docs.flightsimulator.com/msfs2024/html/5_Content_Configuration/Careers/Preflight.htm
No, I’ve done it plenty of times, but you shouldn’t complain when it gets nuked and therefore nukes your app. You buy the risky ticket, take the ride and don’t complain when it goes off the rails😉 Documented changes are a big enough pita, but at least - generally - they are communicated in advance. in theory. perhaps. maybe.
It works for me.
EDIT: ONLY when walking around outside. NOT from the cockpit!! It does nothing in the cockpit camera.
- Load the C172
- Open Covers & Chocks debug menu
- Open Coherent console, go to VLogic or another
Enter:
RegisterViewListener("JS_LISTENER_KEYEVENT")
Then hit enter.
Now enter one of these and hit enter:
// engine on
Coherent.call("TRIGGER_KEY_EVENT", "COVER_SET", true, 1, 1, 0)
// engine off
Coherent.call("TRIGGER_KEY_EVENT", "COVER_SET", true, 1, 0, 0);
On Chocks & Covers, you can see engine toggling, and I confirm it visually looking at the engine.
Maybe, if my 2022 proposal could get more traction…
Well I still can’t get any love using the COVER_SET
key event remotely (triggering on wrong object maybe?), but there are Input Events that work via SimConnect_SetInputEvent()
. They all start with UNKNOWN_
,
UNKNOWN_CHOCKS
UNKNOWN_COVER_ENGINE
UNKNOWN_COVER_PITOT
UNKNOWN_COVER_STATIC_PORT
Setting them with a value of 1
will toggle that part off or on.
That’s on a Cessna 172. Other models may have more covers/events, I presume.
There are some other UNKNOWN_*
events that suggest they have to do with the walkaround as well.
EDIT: Although that also only works when on walkaround, not from inside the cockpit. Which I guess is good since it would likely suck to put on one of those covers while airborne.
And yea, the fact that CTRL-E doesn’t remove the covers is silly. It does everything else needed to start the engine, why not that?