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 likeThis 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 likeThis is the script number {this.scriptIndex}
in it and hear it?
Or a script name variable?
Hmm, if you are going to add these lines manually to each script anyway, why not just simply add a number yourself? Or just sayDoes it have to be "listen" ? You could trace the call of the script in the EDDI.log e.g. with {Log("EDDI Event: Docked")}.
This is the 'Docked' event script.
? Would that not be more descriptive to identify what scripts are being executed? 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 )Hmm, if you are going to add these lines manually to each script anyway, why not just simply add a number yourself? Or just sayThis 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.
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)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.
((EDDI docked))
script in EDDI's Speech Responder but instead a command in VoiceAttack called ((EDDI docked))
.((EDDI docked))
at the appropriate moment and after writing the appropriate variables to VoiceAttack.{Play()}
function from the scripts inside EDDI's Speech Responder.There is an (undocumented)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++
{event.type}
variable which should give the script name.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.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
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.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.
((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.{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.{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)}
}
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: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?
So you could add something like this: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.
{if event.musictrack = "DestinationFromHyperspace":
<add your code here>
}
I'm using IVONA 2 Amy as well, for that exact same reason!Im using a free trial of the ai speech voice amy and it almost sounds like its a game voice.
THIS IS GREAT.There is an (undocumented){event.type}
variable which should give the script name.
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.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 theJumped
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:
The information on all the variables is available from the 'Variables' button when editing a script.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)} }
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:
This will do whatever you add, when the music changes to the track played after you complete a jump (exit from hyperspace).Code:{if event.musictrack = "DestinationFromHyperspace": <add your code here> }
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!![]()
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.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.
Ah, yes, sorry. I was being lazy and taking a shortcut by not specifying any code there.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?
You're welcome.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.
Begin Text Compare : [System name] Equals [Home name]
Begin Boolean Compare : [variable name] Equals True
Begin Integer Compare : [variable name] Is Less Than 10
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!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;
An integer compareCode:Begin Boolean Compare : [variable name] Equals True
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
That's funny, because I like to program EDDI more than I like to play Elite too!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.
reportsystem.security is '{reportSystem.security}'
{if reportsystem.security = "Alto": TRUE
|else: FALSE
}
reportsystem.security is 'Alto' FALSE
Hmm, well I've just tried this code:Why testing the reportsystem.security variable fails, in this code?
Output:Code:reportsystem.security is '{reportSystem.security}' {if reportsystem.security = "Alto": TRUE |else: FALSE }
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....
{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}
}
reportsystem
wrong though. The one inside { } has a capital S, the others do not, so it's probably that. I told it was me being dumb!You do have the uppercase/lowercase letters inreportsystem
wrong though