May 1, 20224 yr Hi there Probably quite a basic question (sorry) but im trying to write my first script on aao but not having much luck. I'm attempting to make a SD profile for the 78X and am working on the HDG hold button. In the simulator, it sends 2 events: AP_HDG_HOLD_ON and a AP_HEADING_SLOT_INDEX_SET. I have set this so far: 0·(>K:AP_HDG_HOLD_ON) 2·(>K:AP_HEADING_SLOT_INDEX_SET) When i press the 'test' button, everything seems to send correctly; but in the events log it only sends the HDG hold event. Am i doing something wrong here? Sorry if its a simple error, i don't have an awful amount of programming knowledge other than some PHP.
May 1, 20224 yr Commercial Member This is a strange one. The SDK documentation states that the K: event is called "AP_HEADING_SLOT_INDEX_SET", and the sim is sending it too. But when looking through the simulator assets, I can't find any call to that event. Instead I am seeing "(>K:HEADING_SLOT_INDEX_SET)", without the AP_ And that seems to work (when querying (A:AUTOPILOT·HEADING·SLOT·INDEX,·Number) the value changes as it should. But beware - if you are hoping to turn on heading hold this way, that won't work. These events are the result of pressing the HDG button, they are not what causes the button to "click" This should do it: 0·(>K:AP_HDG_HOLD_ON)·(>H:AS01B_FMC_1_AP_HEADING_HOLD,·Number) (I am assuming that those are the same HVars as with the 747, but with AS01B in the name instead of B747_8) State variable is (L:AP_HEADING_HOLD_ACTIVE, Number) Edited May 1, 20224 yr by Lorby_SI LORBY-SI
May 2, 20224 yr Author Hey. Thank's very much for this detailed explanation. So as I understand it, a HVar is a hidden variable? In which case this probably throws a few spanners in the works for me as i'm not really sure how to go about getting these extra variables for the 78X (I don't believe they're documented in the SDK?) Your suggested correction worked by the way - thank you! I just have a few more buttons to figure out now.
May 2, 20224 yr Commercial Member 3 hours ago, jezhughes said: i'm not really sure how to go about getting these extra variables for the 78X (I don't believe they're documented in the SDK?) Those are not documented anywhere. They are just invented by the author of the aircraft, so their names and properties are different for almost every plane in MSFS. Just like LVars and BVars. In this case the 787 seems to use the standard Asobo autopilot instrument, so searching through the model behavior templates (of the entire sim) using Notepad++ I was able to find the spot where this one is defined. AAO does pertty much the same thing when you let it scan for HVars - but most names are assembled at runtime, so the results are only of limited use (you only get the building blocks of the variable names) LORBY-SI
May 3, 20224 yr Author I see, thank you for the explanation! I did make an attempt at getting the FLC/VS working too and scanned Hvars in AAO, but didn't see anything relating to it. So, yeah i will try and have a look though the sim templates and see what i can dig up.
Archived
This topic is now archived and is closed to further replies.