Release EDDI Scripts and EDDI enabled VA Commands Thread

It occurred to me that you may want an example of the timer thing, so here's the basic idea...
Code:
{_ Check the timer here. Example is 2 seconds _}
{if SecondsSince(state.script_timer) > 2:

    {_ Add the script, or code, here that you want to run ONLY the first time after the timer has expired _}

    {_ Set/reset the timer here if you want the script to run after X seconds after the last time it spoke  _}
    {SetState('script_timer', SecondsSince(0))}
}

{_ Or set/reset the timer here if you want the script to run X seconds after the last time the script ran, regardless if it spoke or not _}
{_ This is my preferred place _}
{SetState('script_timer', SecondsSince(0))}
 
I believe that each script is run as fast as it can, and the next script will run immediately, even if the previous one is still speaking. As far as I can tell, the speech is added to the queue to be spoken, so multiple scripts can all run, before the first one has finished speaking.

I'm not sure about the rest. As I understand it, EDDI runs each script in it's entirety, building what needs to be said, then sends the output to the speech queue in Windows. I don't think EDDI has much control over it after that (other than to stop all the speech, see below), so I'm not sure if there would be a way to tell what is being spoken at any moment.


The only way I've got around this is to create a timer in a script. If the script runs again, and the timer is still less than a certain amount (say, 1 or 2 seconds) then it will skip the rest of the script. So basically, put the whole thing in an IF statement that checks the timer. I used to use this method for the 'Settlement approached' script when there were multiple Journal entries when approaching a planetary base. I added a timer to prevent anything after the first one from running.


If you use Voice Attack, there is a command in the default EDDI profile called "Shut up". It contains the following command:
Execute external plugin, 'EDDI 3.7.3' using context 'shutup' which will stop all speech (I think it empties the speech queue, but I'm not sure about that).
Thanks a lot!

Related questions:
there's a way to access the "speak queue" from a script (maybe as an array of strings)? (the idea is to seek for a string and avoid to add an identical one)
there's a way to know if the voice is currently speaking?
there's a timer that tells us how much time is passed from the last spoken word?
😬
 
Thanks a lot!

Related questions:
there's a way to access the "speak queue" from a script (maybe as an array of strings)? (the idea is to seek for a string and avoid to add an identical one)
there's a way to know if the voice is currently speaking?
there's a timer that tells us how much time is passed from the last spoken word?
😬
Ugh, I had written a nice long reply, then my browser crashed and I lost it all. :'(

Basically, I think the answer is "no". I don't really know the inner workings of EDDI, but from what I can gather, EDDI creates the speech then sends it to Windows to speak, so (as far as I know) there is no way to interact with that. So no accessing the queue, no way to know if it's speaking, and no way to tell how much time has passed. But I'm sure @T'kael or @VerticalBlank can either confirm or correct me on that. I know VoiceAttack can tell if something is currently being spoken, but I don't think EDDI can.

(the idea is to seek for a string and avoid to add an identical one)
You could possibly create an array and save it as a string into a State variable, and then check that each time. However, if you want to do that with every script, then it would get very big, very quickly, and slow EDDI down. If you only want to use it on a couple of scripts, with small output, then that could be one way of achieving it.
 
I'm afraid that the speech queue is strictly fire-and-forget. EDDI first renders the sound into RAM using the TTS voice, then post-processes it to add sound effects such as echo (for large ships) and compression (for over-the-radio) before sending it out the audio channel. This isn't really something that we can open up.

We do however have a speech priority system, with priority 1 speech being spoken before priority 2, 2 before 3, etc.

Additionally, priority 1 speech will interrupt lower priority speech and priority 5 speech is interruptible by any higher priority speech.

If you can describe in more detail what you are looking to achieve then maybe we can advise further.
 
Last edited:
If you can describe in more detail what you are looking to achieve then maybe we can advise further.
I'll try...

You're in Open game, and want to dock on a small outpost, in a very crowded system. You do your "docking request" and it get refused. EDDI says "Docking denied, because there's no pad available" (something like that).
As the game does'nt manage a queue for docking, you just have to bash that docking request repeatedly until you get the permission.
The audibile result is that you may be already departing while EDDI is still saying "Docking denied, because there's no pad available" for the 60th time.

Sure, now i know that there's a priority system (it skipped my eyes until yesterday, and today i know how it works) but since the default EDDI personality does'nt use it, i did'nt notice it.
While 5 levels of priority are better than nothing, it does not solve the problem in his interity: you may always fall in the case that some "chained" scripts (like docking denied, docking granted, etc) are on the same priority. (but i see how it will be so much more hard to implement: i'm not complaining).

Now, the docking one is an example: there's a good number of scripts that if not managed (or muted) will clutter the queue for minutes (Ship FSD and settlement approaching are the one i fought with :D )
So, in general, i was thinking at a way for a script to know
  • if it should not repeat itself (by searching for his output in the queue)
  • if it should at least "stay shut" if EDDI is still speaking (sort of very very low priority)
  • how to grant some silence before making EDDI talking again (which is different from "Pause()" )

In short, some basic way to test (not to change) what happened in the past :)
 
Different argument: AUDIO.

EDDI first renders the sound into RAM using the TTS voice, then post-processes it to add sound effects such as echo (for large ships) and compression (for over-the-radio) before sending it out the audio channel. This isn't really something that we can open up.
OH! This is really interesting!!!! (I'm a hobbyst, musician, so...)
  • I thought to ask about adding a bit of reverb to the voice to make it a bit less dry and give some ambient
  • I've recently discovered the "Transmit" function and i like it a lot.
    BUT
    It never happened to me to hear these effects! Should i have noticed echo in stations? large ships?
  • I would like so much a bit of distortion/bitcrushing instead of the "garbling" effect for damaged ship voices :)
Some questions about Play() function:
  1. Does it support only WAVs? I thought to use some "cellphone" notification sounds (you know, short blips, chirps, etc) for some events but they are all OGG or MP3 or M4V and not only they did'nt produce any sound but aborted the rest of the script.
  2. There's a defined "EDDI folder" variable (like the personalities one, or the eddi installation folder) , or have each sound be declared "full path"?
  3. There's a way to control the volume of Play()? or a general volume for sounds (some voices are louder that others, and even with a good balanced set of sounds they may result in being too loud compared to the voice)
  4. Can Play() be "non blocking"? I mean: let the sound play in parallel with the text? (i see how this is related to how much "audio channels" there's in EDDI).
 
I'll try...

You're in Open game, and want to dock on a small outpost, in a very crowded system. You do your "docking request" and it get refused. EDDI says "Docking denied, because there's no pad available" (something like that).
As the game does'nt manage a queue for docking, you just have to bash that docking request repeatedly until you get the permission.
The audibile result is that you may be already departing while EDDI is still saying "Docking denied, because there's no pad available" for the 60th time.

Sure, now i know that there's a priority system (it skipped my eyes until yesterday, and today i know how it works) but since the default EDDI personality does'nt use it, i did'nt notice it.
While 5 levels of priority are better than nothing, it does not solve the problem in his interity: you may always fall in the case that some "chained" scripts (like docking denied, docking granted, etc) are on the same priority. (but i see how it will be so much more hard to implement: i'm not complaining).

Now, the docking one is an example: there's a good number of scripts that if not managed (or muted) will clutter the queue for minutes (Ship FSD and settlement approaching are the one i fought with :D )
So, in general, i was thinking at a way for a script to know
  • if it should not repeat itself (by searching for his output in the queue)
  • if it should at least "stay shut" if EDDI is still speaking (sort of very very low priority)
  • how to grant some silence before making EDDI talking again (which is different from "Pause()" )

In short, some basic way to test (not to change) what happened in the past :)
1. EDDI sets a state variable called eddi_context_last_speech (e.g. state.eddi_context_last_speech or {TXT:EDDI state eddi_context_last_speech}). This is actually used in the default VoiceAttack personality to allow EDDI to repeat the last spoken phrase. It might help in contexts like this one too. :)

2. EDDI's speech service actually already removes stale versions of some repeated events from the queue. What this does is filter the queued speech so that if you already have speech queued for the event, only the most recent instance of the event is kept in the queue and prior events of the same type are discarded. Example: EDDI receives an event for Hull damaged with hull at 70% integrity then a second Hull damaged event with hull at 60% integrity. The former (70%) event is removed from the speech queue in favor of the latter (60%) because only the more recent of the two events is still relevant. Note that this only filters queued speech, not active speech. I've added Docking denied and Docking requested to do this on the next release.

3. I can't comment too much on the Ship fsd and Settlement approached events, since neither script includes speech by default.

4. "how to grant some silence before making EDDI talking again (which is different from "Pause()" )" Please elaborate a little more on what you'd like here?

Note: Open mode with a crowded outpost is a nasty combination. I'd strongly suggest swapping game modes as a faster way to find an empty docking pad. ;-)
 
Different argument: AUDIO.


OH! This is really interesting!!!! (I'm a hobbyst, musician, so...)
  • I thought to ask about adding a bit of reverb to the voice to make it a bit less dry and give some ambient
  • I've recently discovered the "Transmit" function and i like it a lot.
    BUT
    It never happened to me to hear these effects! Should i have noticed echo in stations? large ships?
  • I would like so much a bit of distortion/bitcrushing instead of the "garbling" effect for damaged ship voices :)
Some questions about Play() function:
  1. Does it support only WAVs? I thought to use some "cellphone" notification sounds (you know, short blips, chirps, etc) for some events but they are all OGG or MP3 or M4V and not only they did'nt produce any sound but aborted the rest of the script.
  2. There's a defined "EDDI folder" variable (like the personalities one, or the eddi installation folder) , or have each sound be declared "full path"?
  3. There's a way to control the volume of Play()? or a general volume for sounds (some voices are louder that others, and even with a good balanced set of sounds they may result in being too loud compared to the voice)
  4. Can Play() be "non blocking"? I mean: let the sound play in parallel with the text? (i see how this is related to how much "audio channels" there's in EDDI).
Click Test voice in the Text-to-Speech tab with an Adder and an Anaconda. If you listen carefully, you should be able to hear the difference from the echo effect.

"I would like so much a bit of distortion/bitcrushing instead of the "garbling" effect for damaged ship voices". If you have some specific settings in mind then please open a ticket on Github with details (echo, reverb, wet/dry mix, etc.). We can experiment. :)

The Play() function is currently implemented as a wrapper for an SSML <audio> tag and consequently follows the rules of that standard.
  • .WAV or similar uncompressed audio formats are required.
  • Unless the .WAV file is located in EDDI's install folder, full paths are currently required. We could look into supporting paths relative to EDDI's configuration folder in the future if there is sufficient interest.
  • The audio should currently be blocking just like speech.
 
Thanks for your answers!

You know? the more i go deep in EDDI, the more i see what a wonderful piece of software it is.
 
Click Test voice in the Text-to-Speech tab with an Adder and an Anaconda. If you listen carefully, you should be able to hear the difference from the echo effect.
Oh!.... got it. Well, if you pardon me for being a bit nitpicking :) , a reverb could be better than an echo, then increasing the "size" and the "wet" knobs with the ship size.
"I would like so much a bit of distortion/bitcrushing instead of the "garbling" effect for damaged ship voices". If you have some specific settings in mind then please open a ticket on Github with details (echo, reverb, wet/dry mix, etc.). We can experiment. :)
uh... what kind of "settings" should i provide? i don't get it?
  • Unless the .WAV file is located in EDDI's install folder, full paths are currently required. We could look into supporting paths relative to EDDI's configuration folder in the future if there is sufficient interest.
Well, EDDI already knows about the personality folder, also, so perhaps a variabile that point there (to use something like {Play( cat(EDDI.Personalities ,"/sounds/alarm.wav") ) } could not be so expensive to implement.... ?
 
Translation question:
When EDDI (so, the ship) says something like " This is your first visit to this system." or "You have visited this system five times.", is it talking to you like with a friend, or there's some form of "respect" for the rank, so there's an "unspoken" Sir somewhere? (hard to explain, pant!).

'cause we use a different pronoun when we have to show respect towards someone that is in a "higher" position than you.
 
Why this script does'nt works?
Code:
{Play("C:/Users/Parduz/AppData/Roaming/EDDI/personalities/-Sounds-/me-too-603.wav" ) }
"Setting Sounds Folder"
{SetState('SoundFolder',"C:/Users/Parduz/AppData/Roaming/EDDI/personalities/-Sounds-/")}
"Sounds Folder set to " {state.SoundFolder}
{Play(cat(state.SoundFolder,"me-too-603.wav") ) }
"End of script"
state.SoundFolder seems still empty....

EDIT
Ignore this. Found that the variable needs to be lowercase and begin with "eddi_"
 
Last edited:
Are compartment.module.name translated?
If yes, where to look to know what values to check in the scripts?

(and, if yes, is this really a good idea? :unsure: )
 
Oh!.... got it. Well, if you pardon me for being a bit nitpicking :) , a reverb could be better than an echo, then increasing the "size" and the "wet" knobs with the ship size.

uh... what kind of "settings" should i provide? i don't get it?

Well, EDDI already knows about the personality folder, also, so perhaps a variabile that point there (to use something like {Play( cat(EDDI.Personalities ,"/sounds/alarm.wav") ) } could not be so expensive to implement.... ?
Well, our current code for applying speech effects is here and the documentation for the effects library we're using is here, with most of the applied effects being documented here.
Translation question:
When EDDI (so, the ship) says something like " This is your first visit to this system." or "You have visited this system five times.", is it talking to you like with a friend, or there's some form of "respect" for the rank, so there's an "unspoken" Sir somewhere? (hard to explain, pant!).

'cause we use a different pronoun when we have to show respect towards someone that is in a "higher" position than you.
I think for a translation of the default personality we'd want the more formal and respectful "you".
Are compartment.module.name translated?
If yes, where to look to know what values to check in the scripts?

(and, if yes, is this really a good idea? :unsure: )
Yes, though compartment.module.invariantName will contain the untranslated value and you are welcome to use that. :)
 
Why this script does'nt works?
Code:
{Play("C:/Users/Parduz/AppData/Roaming/EDDI/personalities/-Sounds-/me-too-603.wav" ) }
"Setting Sounds Folder"
{SetState('SoundFolder',"C:/Users/Parduz/AppData/Roaming/EDDI/personalities/-Sounds-/")}
"Sounds Folder set to " {state.SoundFolder}
{Play(cat(state.SoundFolder,"me-too-603.wav") ) }
"End of script"
state.SoundFolder seems still empty....

EDIT
Ignore this. Found that the variable needs to be lowercase and begin with "eddi_"
Lowercase, yes. Prefixed with 'eddi_', not necessarily. https://github.com/EDCD/EDDI/wiki/Help#setstate
 
Thanks a lot.

Well, our current code for applying speech effects is here and the documentation for the effects library we're using is here, with most of the applied effects being documented here.
Woah, great!
Now i have to find a way to listen to that effects... :p


Yes, though compartment.module.invariantName will contain the untranslated value and you are welcome to use that. :)
Ok, is this valid also for other "strings" properties? Like conflict.state or the "economic state"?
Asking again 'cause i feel dumb, but i tried to search in github for these properties to see if i can find the "invariant" one, but i have not even found the .... find button. 😔
and by looking in the EDDI/DataDefinitions/ folder i did'nt found them either.
 
Ok, is this valid also for other "strings" properties? Like conflict.state or the "economic state"?
Asking again 'cause i feel dumb, but i tried to search in github for these properties to see if i can find the "invariant" one, but i have not even found the .... find button. 😔
and by looking in the EDDI/DataDefinitions/ folder i did'nt found them either.
conflict.state returns a string rather than a localized object, so unfortunately not in that case. There is a backing object (conflict.factionState.name or conflict.factionState.invariantName) that you may be able to use but admittedly these backing objects are often either poorly documented or undocumented.

invariantName comes from the ResourceBasedLocalizedEDName class. Many localized classes inherit from this class and include both name and invariantName properties.
 
Written a VA script to "autodock" when exiting SC, but want to put a check in it to ensure that a docking computer is fitted somewhere. Anyone know how to do this (cos I bloody well don't).

Cheers.
 
Written a VA script to "autodock" when exiting SC, but want to put a check in it to ensure that a docking computer is fitted somewhere. Anyone know how to do this (cos I bloody well don't).

Cheers.
I'm not sure about using VA for it, but I have the following that works in an EDDI script:
Code:
{for compartment in ship.compartments:
    {if find(compartment.module.name, "Docking") > -1:
        {set dockComp to true}
        {if compartment.module.enabled:
            {set dockCompOn to true}
        }
    }
}
I then check and use the dockComp and dockCompOn variables to do what I need. I'm fairly sure you can do something very similar to this in VA, at least the logic should be much the same. I'll look into it, but I'm sure someone will come along with a proper answer before I can, and if not, maybe you can figure it out from this before me. :)
 
Top Bottom