Release EDDI Scripts and EDDI enabled VA Commands Thread

Okay i'm having this issue now! EDDI only speaks my ships names letter by letter , spelling them out! I already tried to delete shipmonitor.json, enable and disable the shipyard plug in but nothing seems to resolve this! Any tips? Big thx cmdrs o7
 
Okay i'm having this issue now! EDDI only speaks my ships names letter by letter , spelling them out! I already tried to delete shipmonitor.json, enable and disable the shipyard plug in but nothing seems to resolve this! Any tips? Big thx cmdrs o7

I've had similar problems with a few of my scripts. It seem to be the P() function reading out letters when it doesn't understand a word. I've just removed the P() and I get back the correct pronunciations.
 
I've had similar problems with a few of my scripts. It seem to be the P() function reading out letters when it doesn't understand a word. I've just removed the P() and I get back the correct pronunciations.

Worked like a charm! Thanks once more Darkcyde! Best regards cmdr o7
 
Back last year I got some major help with a script I was trying to write to calculate the distance to a destination system after every jump. Link to that post below.

https://forums.frontier.co.uk/showt...ion-and-more?p=4950508&viewfull=1#post4950508

I've come back to this script and found its not working in giving me the distance to the system i have set

I'm guessing with the updates to EDDI this may have been broken long ago as I haven't used it for a long time.

Basically I want to be able to set a destination system and have it calculate that distance after every jump.
 
Hi everyone,

Is there someone who can tell me if it is possible to change the TTS Voice in EDDI mid-script. So that the message send by "A" has voice "1", and the message send by "B" uses voice "2" and so on? I know that I can do it from VA with the "say,script,voice". But doing it in the event saves me a lot of time and effort.

Code:
{_ Context }
{SetState('eddi_context_last_subject', 'message')}
{SetState('eddi_context_last_action', 'receive')}
{SetState('eddi_context_message_name', event.from)}
{SetState('eddi_context_message_content', event.message)}

{if event.player = true:
    {if event.message = "o7":
        {event.from} salutes
        {if event.channel = "player":
            you
        }.
    |else:
        Message received from {event.source} {event.from}.  Message reads: {event.message}.
    }
|elif event.source != "Station":
    Message received from {event.source} {event.from}.  Message reads: {event.message}.
|elif event.source = "A":
    Message received from {event.source} {event.from}.  Message reads: {event.message}.
|elif event.source = "B":
    Message received from {event.source} {event.from}.  Message reads: {event.message}.
|elif event.source = "C":
}

Tnx
 
Hi DeeM77,

you'll have to make it with VA:


speech


This function uses EDDI's voice to read a Speech Responder script. The name of the script should be a text variable with the name 'Script'.
If you want to use a different voice to the standard one then you can set the name of the voice you want to use in a text variable with the name 'Voice'. Note that when you set this variable it will continue to be used until you unset it, at which point EDDI will use the voice configured in its text-to-speech settings.
To use this function in your own commands use the 'Execute an external plugin function' command with the plugin context set to 'speech'.

Use setstate() in EDDI message received event to store the necessary variables like this, and create a new script in EDDI (called 'message received 2', or something like that), based on the rest of the original script, and using these state variables instead the 'event.' ones:

{SetState('eddi_context_last_subject', 'message')}
{SetState('eddi_context_last_action', 'receive')}
{SetState('eddi_context_message_name', event.from)}
{SetState('eddi_context_message_content', event.message)}
{SetState('eddi_context_message_player', event.player)}
{SetState('eddi_context_message_channel', event.channel)}
{SetState('eddi_context_message_source', event.source)}

Then, depending on the content of the variable 'eddi_context_message_source', you can make a script in VA connected to the EDDI message received event with ifs, using the 'say' plugin command to call the 'message received 2' EDDI script with the desired voice.

If you have a list about male-female names of NPCs in Elite, maybe you can make an array and make this script even more sophisticated :)

Hope, this helps!
 
Hi DeeM77,

you'll have to make it with VA:



Use setstate() in EDDI message received event to store the necessary variables like this, and create a new script in EDDI (called 'message received 2', or something like that), based on the rest of the original script, and using these state variables instead the 'event.' ones:



Then, depending on the content of the variable 'eddi_context_message_source', you can make a script in VA connected to the EDDI message received event with ifs, using the 'say' plugin command to call the 'message received 2' EDDI script with the desired voice.

If you have a list about male-female names of NPCs in Elite, maybe you can make an array and make this script even more sophisticated :)

Hope, this helps!

Thank you, this will help for sure.:)

Someone pointed me to https://github.com/EDCD/EDDI/issues/105. Until its implemented I will use your solution.
 
Does anyone known if it is possible to have a readout of the utility slots? I know the commands for compartments and hardpoints. I'd like to build a script for my scanners.

I already found "Ship utility slots:
Code:
{INT:Ship utility slots}
but I'm looking for a command like
Code:
{BOOL:Ship utility slot x occupied} and {TXT:Ship utility slot n module}
 
Last edited:
Does anyone known if it is possible to have a readout of the utility slots? I found the commands for compartments and hardpoints. I'd like to build a script for my scanners.
Utility slots are size 0 hardpoints, so it sounds like you are already pretty much there. . ;-)
If you're running the latest beta, you can use something like the following to get a list of your installed modules read out to you:
Code:
{set utilities to []}
{for hp in ship.hardpoints:
   {if hp.size = 0:
      {set utilities to cat(utilities, [hp.module.name]) }
   }
}


{ShipName()} is equipped with the following utilities:
{List(utilities)}
 
Last edited:
Utility slots are size 0 hardpoints, so it sounds like you are already pretty much there. . ;-)
If you're running the latest beta, you can use something like the following to get a list of your installed modules:
Code:
{set utilities to []}
{for hp in ship.hardpoints:
   {if hp.size = 0:
      {set utilities to cat(utilities, [hp.module.name]) }
   }
}


{ShipName()} is equipped with the following utilities:
{List(utilities)}

Ah there they are, so in VA I use
Code:
{TXT:Ship tiny hardpoint n module}

Tnx Tkael :)
 
Last edited:
Okay i'm having this issue now! EDDI only speaks my ships names letter by letter , spelling them out! I already tried to delete shipmonitor.json, enable and disable the shipyard plug in but nothing seems to resolve this! Any tips? Big thx cmdrs o7

Just noticed this I had the same problem but found a different solution, have you typed your ships name in all uppercase letters. I know that is how they appear in the naming section of livery but it is logging upper and lower case letters still, so :

Ark - will say Ark
ARK will say A R K

So either type your ship's name in all lowercase or be very precise initial capital and lowercase the normal way.
 
Ok So using VA and Eddi to vary info on FSD, I have this as main FSD engaged script:

Code:
{_ Context }{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'engage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_system_system', event.system)}
{SetState('eddi_context_fsd_target', event.target)}


{if event.target = 'Hyperspace':
    {_ Rewrite context to represent a jump }
    {SetState('eddi_context_last_subject', 'jump')}
    {SetState('eddi_context_last_action', 'start')}


    {set system to SystemDetails(event.system)}


    {_ Wait for the FSD countdown and initial jump}
    {Pause(6000)}


   {if state.jumpingdetails= "full":
      {F("FSD full")}
   |else:
      {F("FSD min")}
   }
}

My VA looks like this (only FSD full setstate included):

Code:
Set Text [Script] to 'Full Jumping info Commander'Execute external plugin, 'EDDI 2.4.6-b1'
Set Text [jumpdetails] to 'full'
Set Text [State variable] to 'jumpdetails'
Execute external plugin, 'EDDI 2.4.6-b1'
Pause 1 second
Write '[Blue] {TXT:EDDI state jumpdetails}' to log

Where am I going wrong? None of it works either full or min?

Thanks for everything.
 
It seems that your VA script is using 'jumpdetails' for the state variable, but your FSD Engaged script is using 'jumpINGdetails'. So, it should always execute the 'FSD min' script. Make sure your FSD min script is named correctly, as it is case sensitive, and either add 'ing' to your VA script variable, or remove it from the FSD Event script variable.
 
It seems that your VA script is using 'jumpdetails' for the state variable, but your FSD Engaged script is using 'jumpINGdetails'. So, it should always execute the 'FSD min' script. Make sure your FSD min script is named correctly, as it is case sensitive, and either add 'ing' to your VA script variable, or remove it from the FSD Event script variable.


Bingo Thanks Darkcyde!
 
Morning folks, I'm trying to make a script to calculate the distance to a system I choose. So anytime I jump it says or I can ask EDDI "Distance to destination system!" and EDDI replies with that system is 123 light years away. I had a script like this before but its broken.

in EDDI jumped script
{_ Caluation of destination system}


{if state.destinationexploration:
{set dest to SystemDetails(state.destinationexploration)}


{set diff_x to sub(dest.x, system.x)}
{set diff_y to sub(dest.y, system.y)}
{set diff_z to sub(dest.z, system.z)}


{set pow_x to pow(diff_x, 2)}
{set pow_y to pow(diff_y, 2)}
{set pow_z to pow(diff_z, 2)}


{set distance to add(pow_x, pow_y)}
{set distance to add(distance, pow_z)}
{set distance to pow(distance, 0.5)}
{set distance to round(distance, 1)}


{SetState('distance', distance)}
}

in Voice Attack
Set Text [destination] to 'SOL'
Set Text [State variable] to 'destination'
Execute external plugin, 'EDDI 2.4.6-b1' and wait for return
(plugin context "setstate"
Text variables "State variable")

in addition I would love to be able to have multiple destinations calculated so I can have the distance to any system by just saying "Distance to Sol" "Distance to WYRD" in VA
 
Morning folks, I'm trying to make a script to calculate the distance to a system I choose. So anytime I jump it says or I can ask EDDI "Distance to destination system!" and EDDI replies with that system is 123 light years away. I had a script like this before but its broken.
...
in addition I would love to be able to have multiple destinations calculated so I can have the distance to any system by just saying "Distance to Sol" "Distance to WYRD" in VA

Hi BumbleB,

I used to use that calculation myself, but I was introduced to an 'undocumented' command called 'Distance()'.

Set your current system and destination system, then use Distance to get the distance between them. Like so:-
Code:
{set curr to SystemDetails("Leesti")}
{set dest to SystemDetails("Sol")}
{set distance to round(Distance(curr.x, curr.y, curr.z, dest.x, dest.y, dest.z), 2)}

This will set the variable 'distance' to the numerical value in light years to two decimal places. So, in the above example, 'distance' is set to '111.03'. Then all you need to do is use VA to set the destination you want a distance for, and have your script use your current system to start the measure from.

If you need any further help with this, then I'll see what I can do for you. :)

o7

-=] Darkcyde [=-
 
Morning folks, I'm trying to make a script to calculate the distance to a system I choose. So anytime I jump it says or I can ask EDDI "Distance to destination system!" and EDDI replies with that system is 123 light years away.

Typically I just set that as my home system in EDDI, or set it as my destination in Captain's Log if I'm using that as an overlay.

I had a script like this before but its broken.

Broken how? Need more info to advise.

I can offer some micro-optimisations and readability improvements based on the principles of
  • the arithmetic operators +, -, * etc generally make for more readable script than the corresponding functions
  • x * x is far more efficient than pow(x, 2)
  • passing a larger formula "across the boundary" is generally faster than passing lots of fragments back and forth
That said, performance gains can differ greatly depending on your system.

Code:
{_ Calculate distance to destination system}

{if state.destinationexploration:
{set dest to SystemDetails(state.destinationexploration)}

{set dx to dest.x - system.x}
{set dy to dest.y - system.y}
{set dz to dest.z - system.z}

{set distance to round(pow(dx * dx + dy * dy + dz * dz, 0.5), 1)}

{SetState('distance', distance)}
}

in addition I would love to be able to have multiple destinations calculated so I can have the distance to any system by just saying "Distance to Sol" "Distance to WYRD" in VA

I tend to use the EDSM bot in one of the exploration Discord servers for that, but that does mean alt-tabbing out of the game and that's bad enough even if you aren't in VR. So I can definitely see the use case. Thing is, the selection of destinations would probably need to be set up in advance -- full speech recognition for all systems is a tall order.

Thoughts welcomed.
 
No idea, and unfortunately I can't remember which kind soul told me about it, otherwise I'd give them all the credit. :/ It could have even been Cmdr McDonald himself.

Wait, I found it. ScriptResolver.cs line 660.
Code:
            store["Distance"] = new NativeFunction((values) =>
            {
                return (decimal)Math.Round(Math.Sqrt(Math.Pow((double)(values[0].AsNumber - values[3].AsNumber), 2)
                                                                      + Math.Pow((double)(values[1].AsNumber - values[4].AsNumber), 2)
                                                                      + Math.Pow((double)(values[2].AsNumber - values[5].AsNumber), 2)), 2);
            }, 6);

Best to call that. The C# compiler is probably doing a good job of optimising it, and if not, I can help it without disturbing any Cottle scripts.
 
Back
Top Bottom