Release EDDI 3.3 - Bring your cockpit to life

There's an internal variable that tells what's the current script index?
So, for debugging/translating purposes, i can add a line like This is the script number {this.scriptIndex} in it and hear it?
Or a script name variable?
 
There's an internal variable that tells what's the current script index?
So, for debugging/translating purposes, i can add a line like This is the script number {this.scriptIndex} in it and hear it?
Or a script name variable?
Does it have to be "listen" ? You could trace the call of the script in the EDDI.log e.g. with {Log("EDDI Event: Docked")}.
 
There's an internal variable that tells what's the current script index?
So, for debugging/translating purposes, i can add a line like This is the script number {this.scriptIndex} in it and hear it?
Or a script name variable?

Does it have to be "listen" ? You could trace the call of the script in the EDDI.log e.g. with {Log("EDDI Event: Docked")}.
Hmm, if you are going to add these lines manually to each script anyway, why not just simply add a number yourself? Or just say This is the 'Docked' event script.? Would that not be more descriptive to identify what scripts are being executed? 🤷‍♂️

EDIT: You could also then use something like Notepad++ to view the speechresponder.out file to watch for those lines being spoken. I use this a lot to see what is being spoken so I can check how the speech looks with punctuation and phrasing when I make changes to scripts. There is a button called 'Monitoring' which will show any changes to the file immediately, without needing to reload it.
 
Last edited:
Hmm, if you are going to add these lines manually to each script anyway, why not just simply add a number yourself? Or just say This is the 'Docked' event script.? Would that not be more descriptive to identify what scripts are being executed? 🤷‍♂️

EDIT: You could also then use something like Notepad++ to view the speechresponder.out file to watch for those lines being spoken. I use this a lot to see what is being spoken so I can check how the speech looks with punctuation and phrasing when I make changes to scripts. There is a button called 'Monitoring' which will show any changes to the file immediately, without needing to reload it.
Answering to both: yup, i already add these lines to hear the script name i still have to translate so i can locate them. Having the same line working for all the scripts could just be easier (i use a macro to tamper the json file before translating it )

Yes, i use Sublime Text and it gives the same features you're getting from Notepad++
 
Hi. I have just discovered EDDI and Im trying to find out how to make a script or command myself regarding events and to have custom music files played for different variables. I might use the wrong words but some music for entering allied systems and others for hostile and again a different to entering home system etc. Ive been reading on the github pages and elsewhere and cant get my head around it all the way. here is 1 example :

Running Commands on EDDI Events​


Whenever EDDI sees a particular event occur it will attempt to run a script. The name of the script depends on the event, but follows the form:


((EDDI <event>))


with the <event> being in lower-case. For example, if you wanted VoiceAttack to run a script every time you docked you would create a script called ((EDDI docked)) (note the lower-case d at the beginning of docked).


There are a large number of events available. Full details of the variables available for each event are available in the individual event pages. Note that event variables are only valid when the event occurs, and cannot be relied upon to be present or a specific value at any other time. If you want to use information in an event after the event itself then you should copy the value to another variable.

The first thing i dont understand is where I should create a script called ((EDDI docked)). Where and how do I do that? I was looking inside the speech responder tab in the eddi.exe and there I could view scripts. I didnt think it should be there but i dont know. I was thinking on trying this example just to test and understand and create a script when I dock to play a soundfile just as a test. I tried to find a good video tutorial but ill keep looking for one. Most of them are a few years old now. Thanks for answers.
You seem to be looking at the documentation for VoiceAttack integration. Are you using VoiceAttack? (EDIT: looking at your later responses the answer seems to be yes)

I can see how the word "script" might lead to some confusion (and I'll fix that). This isn't describing creating an ((EDDI docked)) script in EDDI's Speech Responder but instead a command in VoiceAttack called ((EDDI docked)).

VoiceAttack-EDDI-Event.jpg


EDDI then, when running as a plugin for VoiceAttack, would trigger the VoiceAttack command ((EDDI docked)) at the appropriate moment and after writing the appropriate variables to VoiceAttack.

Note that you only need to do this for events that you wish to respond to with some action in VoiceAttack. It is not necessary to do this for every single EDDI event.

EDIT: You can play music either through VoiceAttack or (as was already discussed above) by using the {Play()} function from the scripts inside EDDI's Speech Responder.

o7
 
Last edited:
Answering to both: yup, i already add these lines to hear the script name i still have to translate so i can locate them. Having the same line working for all the scripts could just be easier (i use a macro to tamper the json file before translating it )

Yes, i use Sublime Text and it gives the same features you're getting from Notepad++
There is an (undocumented) {event.type} variable which should give the script name.
 
You seem to be looking at the documentation for VoiceAttack integration. Are you using VoiceAttack? (EDIT: looking at your later responses the answer seems to be yes)

I can see how the word "script" might lead to some confusion (and I'll fix that). This isn't describing creating an ((EDDI docked)) script in EDDI's Speech Responder but instead a command in VoiceAttack called ((EDDI docked)).

View attachment 276387

EDDI then, when running as a plugin for VoiceAttack, would trigger the VoiceAttack command ((EDDI docked)) at the appropriate moment and after writing the appropriate variables to VoiceAttack.

Note that you only need to do this for events that you wish to respond to with some action in VoiceAttack. It is not necessary to do this for every single EDDI event.

EDIT: You can play music either through VoiceAttack or (as was already discussed above) by using the {Play()} function from the scripts inside EDDI's Speech Responder.

o7
Thank you so much for this. I did manage to put in a playsound like darkcyde explained to me inside the script and Im beginning to understand where that could be useful but it was this you showed me now that I was confused about. I thought ((EDDI docked)) was about creating a new script and I didnt understand this was for creating an action in VA to the triggers in eddi. Ive already tested it and it works. Its not the docked trigger I really want to react to but used it as example to understand it.
I find a trigger in speech responder "entering normal space" and wonder if I can make a reaction in VA for entering normal, hostile and home system and even home station but cant see any obvious way of doing that. I find no triggers for "entering hostile space" or "home system". Im imagening I would have to be able to make an "if" variable and put it somewhere useful to enter home system or home station. The eddi thread is long and it has older discontinued threads too but if I look through them maybe I will find it there.

I also find a trigger with an empty script called "music" and in the description it says "triggered when the game music mood changes." The script in there is empty and would I have to create a new script there to do anything with that trigger?
Anyway thanks for answers and I feel i understand a tiny bit more now but very far from being able to do really awsome things with it. If I cant learn it then of course eddi is very awsome as it is. Im using a free trial of the ai speech voice amy and it almost sounds like its a game voice.
 
Last edited:
Thank you so much for this. I did manage to put in a playsound like darkcyde explained to me inside the script and Im beginning to understand where that could be useful but it was this you showed me now that I was confused about. I thought ((EDDI docked)) was about creating a new script and I didnt understand this was for creating an action in VA to the triggers in eddi. Ive already tested it and it works. Its not the docked trigger I really want to react to but used it as example to understand it.
I find a trigger in speech responder "entering normal space" and wonder if I can make a reaction in VA for entering normal, hostile and home system and even home station but cant see any obvious way of doing that. I find no triggers for "entering hostile space" or "home system". Im imagening I would have to be able to make an "if" variable and put it somewhere useful to enter home system or home station. The eddi thread is long and it has older discontinued threads too but if I look through them maybe I will find it there.

I also find a trigger with an empty script called "music" and in the description it says "triggered when the game music mood changes." The script in there is empty and would I have to create a new script there to do anything with that trigger?
Anyway thanks for answers and I feel i understand a tiny bit more now but very far from being able to do really awsome things with it. If I cant learn it then of course eddi is very awsome as it is. Im using a free trial of the ai speech voice amy and it almost sounds like its a game voice.
I'm a little unclear on which way you want to do things. Do you want to do it all in VA, or in EDDI, as you do mention both.

To make a command in VA that EDDI will trigger, you can create a new command and call it the same as the event in EDDI. So for example, EDDI has the 'Entered normal space' event, so in VA you would create a new command called ((EDDI entered normal space)). In this new command you can then add the code to play the files you want. May I suggest the Jumped event would be a better place for this though? This is triggered when you complete a jump between star systems, so would probably be a more appropriate place for your music code.

So in VA, you could write something like this:
1637526188572.png

{TXT:System name} is the system you would have just jumped to.
{TXT:Home name} is the name of the system you have set as your home in the EDDI 'Commander details' tab.
{TXT:System allegiance} is the superpower that the system is aligned to.

However, if you want to do it in EDDI, you would add something similar to the end of the 'Jumped' script. Something like this:
Code:
{if system.systemname = homesystem.systemname:
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|elif system.allegiance = "Alliance":
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|elif system.allegiance = "Empire":
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|elif system.allegiance = "Federation":
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|else:
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
}
The information on all the variables is available from the 'Variables' button when editing a script.

I also find a trigger with an empty script called "music" and in the description it says "triggered when the game music mood changes." The script in there is empty and would I have to create a new script there to do anything with that trigger?
Yes, you would need to create your own script in that event, as there is nothing in the default EDDI personality for it. For most events, if you click the 'Variables' button when editing the script, and then scroll all the way to the bottom, you will see a list of the variables that are specific to that event. So in the 'Music' event, you will see:
Information about this event is available under the event object. Note that these variables are only valid for this particular script; other scripts triggered by different events will have different variables available to them.
  • musictrack - Possible track names are: NoTrack, MainMenu, CQCMenu, SystemMap, GalaxyMap, GalacticPowers, CQC, DestinationFromHyperspace, DestinationFromSupercruise, Supercruise, Combat_Unknown, Unknown_Encounter, CapitalShip, CombatLargeDogFight, Combat_Dogfight, Combat_SRV, Unknown_Settlement, DockingComputer, Starport, Unknown_Exploration, Exploration. Note: Other music track names may be used in future.
So you could add something like this:
Code:
{if event.musictrack = "DestinationFromHyperspace":
     <add your code here>
}
This will do whatever you add, when the music changes to the track played after you complete a jump (exit from hyperspace).

I think that should answer your questions, mostly anyway. ;) If you need any more help, just ask. 😁

DC

EDIT:
Im using a free trial of the ai speech voice amy and it almost sounds like its a game voice.
I'm using IVONA 2 Amy as well, for that exact same reason! ;)
 
I'm a little unclear on which way you want to do things. Do you want to do it all in VA, or in EDDI, as you do mention both.

To make a command in VA that EDDI will trigger, you can create a new command and call it the same as the event in EDDI. So for example, EDDI has the 'Entered normal space' event, so in VA you would create a new command called ((EDDI entered normal space)). In this new command you can then add the code to play the files you want. May I suggest the Jumped event would be a better place for this though? This is triggered when you complete a jump between star systems, so would probably be a more appropriate place for your music code.

So in VA, you could write something like this:
View attachment 276417
{TXT:System name} is the system you would have just jumped to.
{TXT:Home name} is the name of the system you have set as your home in the EDDI 'Commander details' tab.
{TXT:System allegiance} is the superpower that the system is aligned to.

However, if you want to do it in EDDI, you would add something similar to the end of the 'Jumped' script. Something like this:
Code:
{if system.systemname = homesystem.systemname:
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|elif system.allegiance = "Alliance":
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|elif system.allegiance = "Empire":
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|elif system.allegiance = "Federation":
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
|else:
    {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)}
}
The information on all the variables is available from the 'Variables' button when editing a script.


Yes, you would need to create your own script in that event, as there is nothing in the default EDDI personality for it. For most events, if you click the 'Variables' button when editing the script, and then scroll all the way to the bottom, you will see a list of the variables that are specific to that event. So in the 'Music' event, you will see:

So you could add something like this:
Code:
{if event.musictrack = "DestinationFromHyperspace":
     <add your code here>
}
This will do whatever you add, when the music changes to the track played after you complete a jump (exit from hyperspace).

I think that should answer your questions, mostly anyway. ;) If you need any more help, just ask. 😁

DC

EDIT:

I'm using IVONA 2 Amy as well, for that exact same reason! ;)
Hi and thanks for taking time to give me this. I would prefer to do it in the VA but I dont know how you got that code in there. When I go into the "other" tab in the add a command or edit command in VA I get lots of choises. Im wondering which one you use to enter that code in the sequence window. Could be any of them except the "sound." I know how to use the sound option from the "other" tab and link it to a file or have it play random files but not how to get into that sequence window and copy your code in there. I would prefer to do this in VA to have it play random files rather than 1 specific file all the time. Maybe theres a way to do that in the speech responder too. Anything I can do in the VA I would think is maybe best for me, then again im so noob at this I hardly know whats best. I entered your code in the speech responder script and it works fine but as I said I would prefer it in VA.

regarding your explanation on the music script in speech responder, the "<add your code here>," would that be : {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)} as it was in the "jumped" script?

Anyway, thanks a lot for explaining this and you are nearly there to get this basic stuff for you but for me advanced science into my brain. Hey, I lay bricks for a living and that is a completely different world lol. Who ever came up with the phrase "learn to code" must have been someone interacting with me at some point.
 
Hi and thanks for taking time to give me this. I would prefer to do it in the VA but I dont know how you got that code in there. When I go into the "other" tab in the add a command or edit command in VA I get lots of choises. Im wondering which one you use to enter that code in the sequence window. Could be any of them except the "sound." I know how to use the sound option from the "other" tab and link it to a file or have it play random files but not how to get into that sequence window and copy your code in there. I would prefer to do this in VA to have it play random files rather than 1 specific file all the time. Maybe theres a way to do that in the speech responder too. Anything I can do in the VA I would think is maybe best for me, then again im so noob at this I hardly know whats best. I entered your code in the speech responder script and it works fine but as I said I would prefer it in VA.
No problem. Personally I prefer doing it all in EDDI script as I find that easier for me. Maybe I've just not used VA enough, but I find that more complicated and difficult to do the things I want to achieve. So I am much better with EDDI script than I am with VA commands. 😕

Well, to get the code I showed you, when you click 'Other', you need to select 'Advanced' and then 'Begin a Conditional (If Statement) Block', and select 'Single Condition'. This will open up a window where you can enter the {TXT:...} variables. Along the top are the variable types, and 'Text' is the one you need. In the first box 'Variable Name / Token' you need to add {TXT:System name}. The second box needs to be 'Equals', then select the 'Another variable' button and enter {TXT:Home system} in the box next to that. Click OK and the code will appear in the main window. You will see the 'Begin...' part and the 'End Condition'.

To add the rest of the code, select 'Other' -> 'Advanced' -> 'Add Else If to Condition Block' -> 'Single Condition', then enter the variables like in my previous example (the System allegiance ones), but this time for the third box, select the 'Text' button and add the superpower name as plain text. Repeat this for each of the 'Else If' conditions you want to add. Finally, if you want something to happen when none of the above conditions are met, then instead of 'Add Else If to Condition Block', use 'Add Else to Condition Block' to put the 'Else' in at the end, but before the 'End Condition'. You should then have your VA command looking much the same as my example. After all of that, you can then add whatever you need to each If and Else If section to play your music or random sounds.

regarding your explanation on the music script in speech responder, the "<add your code here>," would that be : {Play('F:\\Downloads\\Sounds\\MP3\\imperial_march.mp3', false, 100)} as it was in the "jumped" script?
Ah, yes, sorry. I was being lazy and taking a shortcut by not specifying any code there. 😅 You could put that Play() line there, or the whole code block I gave for 'Jumped', as it should also work just as well there too.

Anyway, thanks a lot for explaining this and you are nearly there to get this basic stuff for you but for me advanced science into my brain. Hey, I lay bricks for a living and that is a completely different world lol. Who ever came up with the phrase "learn to code" must have been someone interacting with me at some point.
You're welcome. 🙂 I really enjoy being able to help others out with EDDI, and sometimes VA too. I used to be a field service engineer for a computer company but I suffered a stroke about 12 years ago and lost about 70% of my slight, so couldn't do that job anymore (as I can't drive now). Now I'm back in a job using computers, but nothing like what I had before.

Good luck with your coding, and as always, if you have any questions, just ask. 😁 Once you get the hang of EDDI, you'll wonder how you ever played Elite without it! ;)

EDIT: Clarified what to put for the Else If sections.
 
Last edited:
If you want to do things with EDDI and VA then you really should read this https://github.com/EDCD/EDDI/wiki/VoiceAttack-Integration

And just to correct the VA example given above you should end up with this;

Code:
Begin Text Compare : [System name] Equals [Home name]

And in the above linked web site you'll see each variable prefixed with either TXT, INT, DEC or BOOL these just indicate the test you need to do. So for a boolean variable you'd use something like;
Code:
Begin Boolean Compare : [variable name] Equals True
An integer compare
Code:
Begin Integer Compare : [variable name] Is Less Than 10

When you add an If statement via the Other -> Advanced -> Begin a Conditional (If statement) Block -> Single Condition on this dialogue you click the Tab for the type of test you wish to do; Small Integer - Text - True/False (Boolean) - Integer - Decimal - Date/Time - Device State

If you wish to write the value of a variable to the VA log then you'd use the {TXT:System name} or {BOOL:My Variable} in the text string so that the value is parsed correctly for display, for example;
Code:
Write [Blue] 'Entered {TXT:System name}' to log
Write [Orange] 'My Boolean Var is: {Bool:My Variable}' to log
 
If you want to do things with EDDI and VA then you really should read this https://github.com/EDCD/EDDI/wiki/VoiceAttack-Integration

And just to correct the VA example given above you should end up with this;

Code:
Begin Text Compare : [System name] Equals [Home name]

And in the above linked web site you'll see each variable prefixed with either TXT, INT, DEC or BOOL these just indicate the test you need to do. So for a boolean variable you'd use something like;
Code:
Begin Boolean Compare : [variable name] Equals True
An integer compare
Code:
Begin Integer Compare : [variable name] Is Less Than 10

When you add an If statement via the Other -> Advanced -> Begin a Conditional (If statement) Block -> Single Condition on this dialogue you click the Tab for the type of test you wish to do; Small Integer - Text - True/False (Boolean) - Integer - Decimal - Date/Time - Device State

If you wish to write the value of a variable to the VA log then you'd use the {TXT:System name} or {BOOL:My Variable} in the text string so that the value is parsed correctly for display, for example;
Code:
Write [Blue] 'Entered {TXT:System name}' to log
Write [Orange] 'My Boolean Var is: {Bool:My Variable}' to log
Yeah, you're right. See? I said I wasn't that great with VA! 😂 I need to use it more to get more experience. 😁
 
Thanks guys, ive got so much to read over and over again and i find it almost more fun than playing the game. I want to close with 3 questions.
1. If I want to use EDDI scripts for my musics, is there a code for having it play random files from a specific folder?
2. Is there a way to mute my ingame stock music while it plays my soundfiles?
3. The thread for eddi scripts and voiceattack commands, are those scripts shared still valid even if they were made for earlier iterations of EDDI?
Thanks again.
 
Thanks guys, ive got so much to read over and over again and i find it almost more fun than playing the game. I want to close with 3 questions.
1. If I want to use EDDI scripts for my musics, is there a code for having it play random files from a specific folder?
2. Is there a way to mute my ingame stock music while it plays my soundfiles?
3. The thread for eddi scripts and voiceattack commands, are those scripts shared still valid even if they were made for earlier iterations of EDDI?
Thanks again.
That's funny, because I like to program EDDI more than I like to play Elite too! 😂

1. I'm not aware of any specific command that would do this. However, it is possible to create a list in EDDI of all the file names in the folder, then getting EDDI to pick one at random to play. The downside to this is that you would need to manually keep the list updated in the script if you add or remove files from the folder. I don't know of any way for EDDI to read the folder contents, unless you use VA to do that part and then pass the list over to EDDI first (but we know how good/bad my VA knowledge is! lol!). If you're going to do that part in VA, then you may as well do it all in VA instead.

2. I've had a quick look at the Elite controls, but I can't find anything that would allow you to toggle the music on/off while in-game. If there were (or is, and I just didn't find it) then you could use VA to activate that key when needed, like just before/after the music file is played. But my guess is that there is no way to achieve this (although I would be happy to be proved wrong).

3. I think most of them will still be ok, but as the game has been updated and changed over the years, EDDI has had to change along with it, so there will probably be some things that no longer work the way they used to (or at all). For example, there has been a recent (undocumented?) change in the way the game handles system permit missions, and this has rendered some of EDDI's default code redundant and not working (but nothing so bad that you would notice much), and it'll be 'fixed' in a future update to EDDI. You could try any code or scripts you find and see what happens, as you are unlikely to 'break' anything. 🙂

EDIT: Following on from question 1, I've had a quick play around with creating a script to do the random playing in EDDI. I have found that while I can get it to work just as I had expected, EDDI plays the file before it does anything else with the script, so any speech that should come before it, will come after the file has finished playing. This isn't very good for playing music, as music files normally play for many seconds, to a couple of minutes, during which EDDI seems to freeze until the file has finished playing. So you will be much better off doing all that part in VA.
 
Last edited:
Why testing the reportsystem.security variable fails, in this code?
Code:
reportsystem.security is '{reportSystem.security}'
{if reportsystem.security = "Alto": TRUE
|else: FALSE
}
Output:
reportsystem.security is 'Alto' FALSE

I'm pretty sure that the problem is me being dumb, but that's the reason i don't see what i'm doing wrong....
 
Why testing the reportsystem.security variable fails, in this code?
Code:
reportsystem.security is '{reportSystem.security}'
{if reportsystem.security = "Alto": TRUE
|else: FALSE
}
Output:
reportsystem.security is 'Alto' FALSE

I'm pretty sure that the problem is me being dumb, but that's the reason i don't see what i'm doing wrong....
Hmm, well I've just tried this code:
Code:
{set reportSystem to SystemDetails("Kokobii")}

       {if reportSystem.security = "High":
            {OneOf("a highly policed", "a well regulated")}
        |elif reportSystem.security = "Low":
            {OneOf("a poorly policed", "a poorly secured")}
        |elif reportSystem.security = "Anarchy":
            {OneOf("an unpoliced", "an unsecured")}
        |else:
            {reportSystem.security}
        }
...and it's reporting "medium" as the security level for Kokobii, which is correct according to EDDB. You do have the uppercase/lowercase letters in reportsystem wrong though. The one inside { } has a capital S, the others do not, so it's probably that. ☺️
 
Do you know that there's a SublimeText3 syntax highlighter for Cottle/EDDI on GitHub?
I posed some questions in the Sublime forum about how to build it, some experts build it, and the end result is that now it is "official" and installable as a Package :)

Thought you guys may like to know it.
 
Hello everyone ...
Question to the specialists: How can I recognise when a self-generated variable ( SetState() ) is updated by ED ?
OK, one case is clear, when an EDDI event script is triggered by ED and the state-variables are contained there.
But I have noticed that state-variables are updated although they are not present in the corresponding script.
Example replenish ammunition:
In the Ship loadout script, state-variables are set for ammunition. When the script is triggered, these are updated.
But they are also updated when you select the corresponding function in the station main menu or immediately after docking
or in the "Equipment" menu. In the Journal.log you will only find the ED event "BuyAmmo" but not "Loadout".
The EDDI event "Ship restocked" is triggered by "BuyAmmo", but no state-variables are defined there (yet).

Many greetings and a happy first advent from ...

nepomuk

Translated with www.DeepL.com/Translator (free version)
 
Top Bottom