Axis and Ohs: Help and questions

So this is a good news, but news situation i think. :slight_smile:

But many, many thanks for pointing me in this direction. I will go into that a little deeper.

BR

Other way to find out the variables and scripts are using the Model Behaviour Debug tool. It will show same info as in XML’s but it’s little bit more readable. It also has Logger feature which shows what happens when you press switch/rotate knob etc.

Enable Developer mode in sim and goto Windows → Model Behaviours
Make sure you have correct XML file selected (TBM930_INTERIOR.XML) in this case (it’s usually *_INTERIOR or _COCKPIT)

In the component search box try to write what you want to find, “starter” in this case, then you see on the right there is 1 result, choose that (HITBOX_ENGINESTART_SWITCH_STARTER)

Scroll all the way down and open Mouserect. There you can see the code for the starter switch. Logger is also under Mouserect and opening that will give you info when you switch the starter.

Here’s part of the code you get, you can see those 1 (>L:XMLVAR_Starter) and 0 (>L:XMLVAR_Starter) variables in there.

2 Likes

Seems like i had some kind of bug, after restarting Axis and Ohs the script was working just fine :slight_smile:

Can you maybe give me a hint on the execution of the Wipers knob?
I figured out that

0·(>L:ASCRJ_LSP_WIPER,·Number) is off
1·(>L:ASCRJ_LSP_WIPER,·Number) is Int
2·(>L:ASCRJ_LSP_WIPER,·Number) is Slow
3 (>L:ASCRJ_LSP_WIPER,·Number) is fast

how can i put them into one script for a turning Knob left and right ?

how can i put them into one script for a turning Knob left and right ?

Right turn
wrong code

Left turn
wrong code

1 Like

sadly it doesnt work as expected,
just jumps one right to slow and not further. And when i use the left turn it jumps all the way to the off position :frowning:

Ah, OK, it is one of those (that you can only send a value to, but that doesn’t hold the state as value). So my initial script was correct after all.

(L:MyWiperVar) 3 < if{ (L:MyWiperVar) 1 + (>L:ASCRJ_LSP_WIPER,·Number) (L:MyWiperVar) 1 + (>L:MyWiperVar)}

(L:MyWiperVar)·0·>·if{·(L:MyWiperVar)·1·-·(>L:ASCRJ_LSP_WIPER,·Number)·(L:MyWiperVar)·1·-·(>L:MyWiperVar)}

But with this you can no longer operate the switch with the mouse, it will get out of sync.

okay got it, weird is that the x-touch mini knob is behaving really weird
 it sporadical works but not every time turn, i can turn quick or slow doesn’t mater. All other knobs working as expected in the CRJ except for the knobs for lightning wich are also somtimes stuck and not moving. I guess its to much scripts? or just the plane itself, because with the CJ4 i didn’t have that many problems.

Edit: yes the new/old script is working as expected, okay so no mouse interaction for my Wipers :smiley: Thanks !!

And here is option number three “If things don’t work as expected, let the sim deal with them”.

SIMPROC:(L:ASCRJ_LSP_WIPER, Number) 0 > if{ (L:ASCRJ_LSP_WIPER, Number) – (>L:ASCRJ_LSP_WIPER) }

SIMPROC:(L:ASCRJ_LSP_WIPER, Number) 3 < if{ (L:ASCRJ_LSP_WIPER, Number) ++ (>L:ASCRJ_LSP_WIPER) }

This is pretty much the exact code from the animation definition file, but AAO can’t use it directly (becasue one of the LVars doesn’t have the ,unit parameter). The “SIMPROC:” prefix sends the script to the sim for processing instead. With these the mouse interaction works too.

1 Like

Good Morning, i can not find the file “Engine_Subtemplates.xml”. Not in the whole TBM930 Folder. Where di you find it?

BTW: The variables worked fine. THX

OK, got it. Thats pretty cool. I did another example. Found my APTrim (It is the overhead switch in the TBM930) in the debugger. I found the variable and i see the change while switching the AP with the mouse. And i get an reaction if i do this “2·(>L:XMLVAR_APTrim,·Number)” or another number in a script. But the button moved back immediately. I have checked that no switch assigned in the sim. Strange.

Where di you find it?

Notepad++ → Search → Find in files
Find what: “Asobo_ENGINE_Switch_Starter_Template”
Filters: “*.xml;*.js;*.html”
Directory: the MSFS Packages folder
Checked “In all subfolders”
“Find all”

MSFS relies heavily on centralized templates and reusable code. When analyzing this you have to thread your way through several layers of templates and track the variable values that are being set (to replace the #
# tags in the central script code). Ultimately you will have assembled the code for mouse operation (there are at least two different variants of that in play, a modern one and the old (M:Event) type).

Try this, should work. If you bind it to push button it will go from OFF → AP OFF → ON → OFF and so on.

SIMPROC:(L:XMLVAR_APTrim)·2·==·if{·1·if{·1·(>L:XMLVAR_APTrim)·(A:AUTOPILOT·DISENGAGED,·Bool)·!·if{·(>K:AUTOPILOT_DISENGAGE_TOGGLE)·}·(A:RUDDER·TRIM·DISABLED,·Bool)·if{·0·(>K:RUDDER_TRIM_DISABLED_SET)·}·(A:AILERON·TRIM·DISABLED,·Bool)·if{·0·(>AILERON_TRIM_DISABLED_SET)·}·}·}·els{·(L:XMLVAR_APTrim)·1·==·if{·1·if{·0·(>L:XMLVAR_APTrim)·(A:AUTOPILOT·DISENGAGED,·Bool)·if{·(>K:AUTOPILOT_DISENGAGE_TOGGLE)·}·}·}·els{·(L:XMLVAR_APTrim)·0·==·if{·2·(>L:XMLVAR_APTrim)·(A:AUTOPILOT·DISENGAGED,·Bool)·!·if{·(>K:AUTOPILOT_DISENGAGE_TOGGLE)·}·}·}

Hi an thx for the script. It toggle between “AP OFF” <-> “ON”. It do not go to “OFF”. If you have an Idea why it is like this, let me know. But i can live with that. TXH again.

Ah ok, i only searched in the Aircraft Folder.

Yeah you are right. If you manipulate the switch with mouse first it will work like I said. I don’t know why it’s not working correctly, need to investigate more.

IMPORTANT NOTICE: The AAO WASM module is not compatible with the new simulator update!

Please remove “lorbysi-content-hooks” from your community folder or the sim will not start.

At the moment I can’t offer a solution. Asobo assured me that the changes in the WASM modules that have been announced earlier (5 weeks ago) would not affect my module. Yet here we are.

We will start looking into this as soon as possible. For now, accessing LVars or HVars through AAO is no longer possible. The rest of the app is working nornally.

Thanx for the quick announcement.
My computer is downloading the latest update as I type this :slight_smile:

Should have read this 30 min ago and I would have less wrinkles in my face.

This seems to affect all standalone WASM modules. So if you have SPADNext, Mobiflight, FSUIPC etc., you may have to remove their modules too.

Yeah, my CJ4 is grounded until further notice


Thanks Asobo!