Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PM callouts

Featured Replies

Hey all,

I'm looking for some help on how to set up pilot monitoring callouts. Example: I set the flaps to flaps 1, I want to use TTS to speak "speed checked, flaps one". 

So far I've tried putting this in a single script and calling that script in the Aircraft Automated Scripts, but that's repeating the same TTS while the variable returns 1. So then I added a custom variable that flags if the TTS has been triggered already and then the SPEAK command can be avoided. But to implement this for all flaps positions and every other parameter that I would like to watch, seems overly complicated.

Then I've looked at conversation files (as googling lead me to this post where it was suggested) but I still can't figure out the right way to call the TTS only once if the criteria is met and not repeat it. I tried putting the custom TTS flag in the beginning of the conversation.txt file and use (GOTO:end) to skip that part, but it didn't seem to work.

Ideally I wan't the script(s) to run automatically when I load into the sim (maybe with some delay), and avoid using a button trigger, but if that's the only way, I'm fine with that too.

 

Apologies if this is something obvious and I should have been able to find everything for this in the manual (I did check, promise!), but I'm out of ideas what I'm doing wrong. Any help would be appreciated!

  • Commercial Member
16 minutes ago, decisionheight said:

but I'm out of ideas what I'm doing wrong.

You aren't doing something wrong - you are dealing with a complex requirement, that will require a lot of coding. No two ways about it, you will have to create all the conditions that you seek and code them properly.

The main problem as I see it is the definition of "once". It is easy to create a script that does something only once. But then it is gone, and you won't get the same TTS output again when the condition is met the next time. Know what I mean?

16 minutes ago, decisionheight said:

So far I've tried putting this in a single script and calling that script in the Aircraft Automated Scripts, but that's repeating the same TTS while the variable returns 1. So then I added a custom variable that flags if the TTS has been triggered already and then the SPEAK command can be avoided. But to implement this for all flaps positions and every other parameter that I would like to watch, seems overly complicated.

It is what it is - this is the only way. You can try other methods of implementation, but you have to put a lot of thought into the question of what "once" really means for you. For example the flaps - I doubt that you really want this to happen only once in your entire flight. You want it to happen every time you put the lever in this position, you just don't want the sound output to repeat. So your conditional statement is not about the actual value of a variable, but about the fact that the value changed. Meaning, you need another local variable that contains the previous value, and when they differ, you trigger the TTS output. But that is something that you have to code, the app can't help you with this (how would it know what to do under what conditions?). I will check if there is a viable way to implement a shortcut for a "has variable changed" operator internally, but that can only be part of a future version of AAO.

Personally, I would create a scriptfile with all those conditional scripts and call that with the autoscript logic. Files are a lot easier to edit.

As you've observed, people made quite sophisticated CONVERSATION apps. But those are insanely complex too, and I don't know of anyone who was willing to share their solution (out of fear of having to support it)

Edited by Lorby_SI

LORBY-SI

  • Commercial Member

Example:

(A:BATTERY·CONNECTION·ON,·Bool)·s0·l0·(L:MyBatVal)·!=·if{·l0·1·==·if{·(SPEAK:·battery·on)·}·els{·(SPEAK:·battery·off)·}·l0·(>L:MyBatVal)·}

I'm using register 0 here to store and retrieve the value of the AVar, so I don't have to type it everywhere.

Edited by Lorby_SI

LORBY-SI

  • Commercial Member
(A:FLAPS·HANDLE·INDEX,·Number)·s0·l0·(L:MyFlapsPos)·!=·if{
l0·1·==·if{·(SPEAK:flaps·one)·}·
l0·2·==·if{·(SPEAK:flaps·five)·}·
// other conditions

// finally store the current value
l0·(>L:MyFlapsPos)·}

I haven't tested this - it is just the general principle for a flaps autoscript.

LORBY-SI

  • Commercial Member

btw. I would use SPEAKBLK instead of SPEAK, so the voice doesn't talk over itself if two conditions are met at the same time. And maybe an initialization script that sets up a Macro for the Voice, as shown in the AAO manual scriptfile examples

LORBY-SI

  • Author
3 hours ago, Lorby_SI said:

It is what it is - this is the only way. You can try other methods of implementation, but you have to put a lot of thought into the question of what "once" really means for you. For example the flaps - I doubt that you really want this to happen only once in your entire flight. You want it to happen every time you put the lever in this position, you just don't want the sound output to repeat. So your conditional statement is not about the actual value of a variable, but about the fact that the value changed.

Got it. I'm willing to do all the coding it takes, I was just wondering if there's a more practical method which I've overlooked. I tried having custom variables for state changes as well (and it worked to an extent too), but that's when it got really complex and had me question the whole approach haha.

 

Quote

I will check if there is a viable way to implement a shortcut for a "has variable changed" operator internally, but that can only be part of a future version of AAO.

That would be super useful I think, I hope it can be implemented one day.

Quote

Personally, I would create a scriptfile with all those conditional scripts and call that with the autoscript logic. Files are a lot easier to edit.

Thanks, that was my logic as well. Out of curiosity, is there any meaningful difference performance wise between calling script files and coding internally in the app? Say if I end up with 50 different conditional script .txt files and call those from a repeater script every second.

Quote

As you've observed, people made quite sophisticated CONVERSATION apps. But those are insanely complex too, and I don't know of anyone who was willing to share their solution (out of fear of having to support it)

It's a shame I couldn't find any examples to get the idea how exactly they work. Couple of questions regarding this:

  • Can I put the conditional checks within the conversation file, or should I leave that in the script and jump to the required line in the conversation.txt?
  • (GOTO:xxx) only works in convo files or should it work in regular scripts too? For some reason I couldn't properly implement them yet, but I will check further maybe I got the wrong conditions.
Quote

I haven't tested this - it is just the general principle for a flaps autoscript.

Very helpful, thanks so much! Will look into this a bit more.
 

Quote

And maybe an initialization script that sets up a Macro for the Voice, as shown in the AAO manual scriptfile examples

Yeah, that was my idea too, so I can have different voices for different airlines and stuff.

Thank you so much for the quick reply and help!

  • Commercial Member
14 minutes ago, decisionheight said:

Out of curiosity, is there any meaningful difference performance wise between calling script files and coding internally in the app?

Be careful with that - in a script file, every line is an RPN script in its own right (not like in the editor where everything is just a single line, no matter the formatting). You cannot code them the same way as the scripts in the editor. Which also means that each line/script will incur a delay until it is executed. 
If it is performance you seek, I would stick to the internal scripts. Looking at my flaps example, I don't think that they are too bad - you only have to call them every second or so, and that performance impact should be negligible.

LORBY-SI

  • Commercial Member
19 minutes ago, decisionheight said:
  • Can I put the conditional checks within the conversation file, or should I leave that in the script and jump to the required line in the conversation.txt?
  • (GOTO:xxx) only works in convo files or should it work in regular scripts too? For some reason I couldn't properly implement them yet, but I will check further maybe I got the wrong conditions.

The CONVERSATION is more suitable for a virtual flight companion. It is more like FS2Crew, where certain things cannot happen at certain times, so the sequence can be coded easily in the conversation file itself. All the conditions go in there too, it has it's own syntax. 

If you are looking for a virtual flight attendant or first officer, the conversation is the way to go. If you just want voice callouts, the autoscripts are better.

Edit:
About GOTO: you can use the special multiline script syntax in the editor, that will allow you to use GOTO as well. 

Edited by Lorby_SI

LORBY-SI

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.