Release EDDI Scripts and EDDI enabled VA Commands Thread

Plugged in your code and works as expected. You da man.

I did however encounter an unexpected anomaly. Settlements with + or ++ or (or more) after them get read out as "Cenker Gateway Plus Plus"
I'd like to remove (filter) out the occurrences of "+" whether its one, two, three or more?

Ah yeah, sorry about that. I rarely go to settlements with security, so I'd forgotten about those. I had meant to do something about removing them from my original script too, but just forgot.

Anyway, it's an easy fix. Replace your Settlement Approached script with the following:-
Code:
{set settlement to event.name}
 
{while slice(settlement, len(settlement)-1) = "+" || slice(settlement, len(settlement)-1) = " ":
    {set settlement to slice(settlement, 0, len(settlement)-1)}
}

{SetState('settlement_approached', settlement)}
{SetState('settlement_approach_time', SecondsSince(0))}
While I've not tested in game (I've only tested it by faking a settlement name), that should do the trick! :D

-=] Darkcyde [=-

EDIT: I've tested it in game now, and it works fine. :)
 
Last edited:
Very good .. you are correct. +5 points. Now, for the next question on your test. :D

What would it look like to have the Fuel Check script be quiet until fuel was down to 20% OR I'd not make it to the next scoopable star/station with fueling service? if that is even possible?

I'm using pretty much the stock fuel check script save for the last few lines.
With Amy telling every single stop how much fuel I had was getting annoying. I only needed to know when my fuel was below a point where I should be concerned. Let's say, below 20%

Everytime I modified a few of the percentages or tried to bypass them, it broke the script. What I ended up with was the last line where is normally says "
|else:
{shipsfuel} {OneOf(currentpercent, "at maximum")}, {title}
I replaced it with
|else:
{OneOf("and systems are nominal sir", "and no additional issues to report sir")}
 
In the `Nav beacon scan` event, there is a variable `event.numbodies` that you can use to count down until the nav beacon scan speech has all been suppressed. You'll need to set a state variable to this quantity for VoiceAttack, then subtract from the variable value and suppress speech while that state variable is greater than zero. Once it hits zero, you'll know that the nav beacon scans are done. (Note that this is the same method EDDI uses natively in the Speech responder).

Thanks Tkael, I will have to PM you or enlist the help of someone willing to talk me through that as unfortunately that's beyond my skill set having never played around with code before discovering EDDI.

Also nice work CMDRs Tacyon and Darkcyde, a very nice script you've come up with there.
 
What would it look like to have the Fuel Check script be quiet until fuel was down to 20% OR I'd not make it to the next scoopable star/station with fueling service? if that is even possible?

The Fuel Check at 20% only is quite easy, just delete the ELIF parts after the 25% section and change the number to 20, like this:-
Code:
{_ Fuel Check _}
{_ Report fuel level _}

{if ship.name = state.eddi_fuelcheck_shipname:
    {if state.eddi_context_fuel_used > state.eddi_fuelcheck_maxfuel:
        {SetState('eddi_fuelcheck_maxfuel', state.eddi_context_fuel_used)}
    }
|else:
    {SetState('eddi_fuelcheck_maxfuel', state.eddi_context_fuel_used)}
    {SetState('eddi_fuelcheck_shipname', ship.name)}
}

{set maxfuel to state.eddi_fuelcheck_maxfuel}
{set fuelremaining to state.eddi_context_fuel_remaining}
{set maxjump to fuelremaining/maxfuel}
{set currentfuel to round(fuelremaining / ship.fueltanktotalcapacity * 100, 0)}
{set shipsfuel to:
   {Occasionally(2, "{ShipName()}'s" )} Fuel
   {OneOf("levels", "tanks", "reserves")} {Occasionally(2, "are")} {Occasionally(2, "now")}
}
{set currentpercent to: 
   at {currentfuel} percent {Occasionally(2, "capacity")}
}
{set title to Occasionally(3,"{F('Honorific')}")}

{if maxjump < 0.5:
   Danger!
   {shipsfuel} depleted!
   {Pause(500)}
   Running on reserves. Shutdown of non-essential systems is advised!
   {Pause(500)}
   Emergency transponder standing by, {title}
|elif maxjump < 1.25:
   {OneOf("Warning:", "Caution:", "Danger:", "Attention:")}
   {shipsfuel} {OneOf("dangerously low", "almost depleted")}.
   {OneOf("Please refuel", "Refueling is strongly recommended")}, {title}
|elif currentfuel < 20:
   {OneOf("Warning:", "Caution:", "Danger:", "Attention:")}
   {shipsfuel} {OneOf("below 20%", "{currentpercent}" )}, {title}
|else:
   {OneOf("and systems are nominal sir", "and no additional issues to report sir")}
}
This is of course assuming you still want to be informed of the danger level and "out of fuel" messages. If not, just make it {if currentfuel <20:... and delete the maxjump parts before that.

As for being able to tell you that you don't have enough fuel to make the next scoopable star or station, that is outside of EDDI's capability at the moment. At least, as far as I am aware anyway. It would involve EDDI knowing your plotted route, with all stops, and knowing which of those stars are scoopable or have stations in them.

While I do have a route plotting system in my personality, that was created by Hoodathunk (I think. My memory is a bit crap), I don't think it could be made to do what you are asking. It only plots final destination, and doesn't care about the stops in between. As far as I know, there is no way to tell what stops a route will be made up of, and that's the important part. If there was a way to know what systems were in a route, the rest would be easy. Sorry. :(

-=] Darkcyde [=-

Also nice work CMDRs Tacyon and Darkcyde, a very nice script you've come up with there.
Thank you! :D
 
I figured that might be the case since the mentioned parameter would hall have to be known. I just wasn't sure if they were hiding someone I wasn't aware of.

The last'ist line where I changed it to "{OneOf("and systems are nominal sir", "and no additional issues to report sir")}" was just because I couldn't finger out how to shut her up about the fuel.

Can I remove my "{OneOf("and systems are nominal sir", "and no additional issues to report sir")}" and make it ....

{_ Fuel Check _}
{_ Report fuel level _}


{if ship.name = state.eddi_fuelcheck_shipname:
{if state.eddi_context_fuel_used > state.eddi_fuelcheck_maxfuel:
{SetState('eddi_fuelcheck_maxfuel', state.eddi_context_fuel_used)}
}
|else:
{SetState('eddi_fuelcheck_maxfuel', state.eddi_context_fuel_used)}
{SetState('eddi_fuelcheck_shipname', ship.name)}
}


{set maxfuel to state.eddi_fuelcheck_maxfuel}
{set fuelremaining to state.eddi_context_fuel_remaining}
{set maxjump to fuelremaining/maxfuel}
{set currentfuel to round(fuelremaining / ship.fueltanktotalcapacity * 100, 0)}
{set shipsfuel to:
{Occasionally(2, "{ShipName()}'s" )} Fuel
{OneOf("levels", "tanks", "reserves")} {Occasionally(2, "are")} {Occasionally(2, "now")}
}
{set currentpercent to:
at {currentfuel} percent {Occasionally(2, "capacity")}
}
{set title to Occasionally(3,"{F('Honorific')}")}


{if maxjump < 0.5:
Danger!
{shipsfuel} depleted!
{Pause(500)}
Running on reserves. Shutdown of non-essential systems is advised!
{Pause(500)}
Emergency transponder standing by, {title}
|elif maxjump < 1.25:
{OneOf("Warning:", "Caution:", "Danger:", "Attention:")}
{shipsfuel} {OneOf("dangerously low", "almost depleted")}.
{OneOf("Please refuel", "Refueling is strongly recommended")}, {title}
|else currentfuel < 20:
{OneOf("Warning:", "Caution:", "Danger:", "Attention:")}
{shipsfuel} {OneOf("below 20%", "{currentpercent}" )}, {title}
}
Seems to be that would be missing the "if none of these ... do this condition".

This is where this logic seems to escape me on these. :|
 
I figured that might be the case since the mentioned parameter would hall have to be known. I just wasn't sure if they were hiding someone I wasn't aware of.

The last'ist line where I changed it to "{OneOf("and systems are nominal sir", "and no additional issues to report sir")}" was just because I couldn't finger out how to shut her up about the fuel.

Can I remove my "{OneOf("and systems are nominal sir", "and no additional issues to report sir")}" and make it ....
[...]
Seems to be that would be missing the "if none of these ... do this condition".

This is where this logic seems to escape me on these. :|

Almost right. :) The last |else currentfuel < 20: needs to be |elif currentfuel < 20:. If you are having a condition check, it still needs to be an ELIF. Use ELSE by itself (so |else: ) to be used when all previous ELIF conditions are not met, and you still want something to be spoken anyway. With this |elif currentfuel < 20:, you won't hear anything at all now, until you get below 20% fuel remaining.

-=] Darkcyde [=-
 
I can't get the docked event to not read off an Independent station as a none allegiance. Here is my code:

Code:
{if event.allegiance != "none" || event.allegiance != "None":  {event.allegiance}  
|else:
  Independent
}

Does anyone have any ideas?

Also, with RC5, has anyone else noticed that state variables set in EDDI are not being passed to Voiceattack?
 
I can't get the docked event to not read off an Independent station as a none allegiance. Here is my code:

Code:
{if event.allegiance != "none" || event.allegiance != "None":  {event.allegiance}  
|else:
  Independent
}

Does anyone have any ideas?

Also, with RC5, has anyone else noticed that state variables set in EDDI are not being passed to Voiceattack?

As for your station allegiance, I think it should be something like this:-
Code:
{if event.allegiance && event.allegiance != "None":
    {event.allegiance}
|elif event.allegiance = "None":
    Independent
}
Looking at the similar code in the FSD Engaged event, I think event.allegiance should be one of "Federation", "Empire", "Alliance", and "None". I've just tried this at Levi-Montalcini Gateway station in Timbalderis, and it's working.

I've not played properly since rc5 came out, so I can't say about the state variables being passed to VA.

-=] Darkcyde [=-
 
Last edited:
Hello all. I'm trying to get EDDI to round to different decimal amounts depending on how small the value is.

If event.earthmass is < .01 I want it to round to 4 decimals, if no I want it to round to 2 decimals.

Here is my code:

Code:
with a radius of {round(event.radius / 1000, 0)} kilometers and a relative earthmass of 
{if event.earthmass < ".01":
{round(event.earthmass, 4)}.
|else:
{round(event.earthmass, 2)}.
}

EDDI always rounds to 4 decimals no matter if event.earthmass is larger then .01. If I remove the quotes from .01 I get an error of expected expression found. I'm not sure what I'm doing wrong.
 
Hello all. I'm trying to get EDDI to round to different decimal amounts depending on how small the value is.

If event.earthmass is < .01 I want it to round to 4 decimals, if no I want it to round to 2 decimals.

Here is my code:

Code:
with a radius of {round(event.radius / 1000, 0)} kilometers and a relative earthmass of 
{if event.earthmass < ".01":
{round(event.earthmass, 4)}.
|else:
{round(event.earthmass, 2)}.
}

EDDI always rounds to 4 decimals no matter if event.earthmass is larger then .01. If I remove the quotes from .01 I get an error of expected expression found. I'm not sure what I'm doing wrong.

Hi JRohrer,

You need to make that 0.01 and remove the quotes.

You need the zero at the start of the number or EDDI gets confused as to what you are trying to achieve.

With the quotes, EDDI is checking the string ".01" against a number, which will always execute the |else: code.

-=] Darkcyde [=-
 
Hi JRohrer,

You need to make that 0.01 and remove the quotes.

You need the zero at the start of the number or EDDI gets confused as to what you are trying to achieve.

With the quotes, EDDI is checking the string ".01" against a number, which will always execute the |else: code.

-=] Darkcyde [=-

Thank you! I figured that the quotes were wrong, but I didn't realize that I needed the 0.01. The error message was throwing me off on not using the quotes.
 
Yes, skipping the zero before the decimal point will upset many computer languages. It's also bad form in human notation and I'm not sure why people do it.

Putting a literal in quotes will always make it a string type rather than a numeric type.
 
I have another script that I can't figure out why it doesn't work:

Code:
{if reportsystem.power && reportsystem.powerstate:  This station and system is {reportsystem.powerstate} by {reportsystem.power}.


  {if resportsystem.power = "Li Yong-Rui" && reportsystem.powerstate = "Control" || reportsystem.powerstate = "Exploited":
    Note: {event.station} offers a fifteen percent discount on ships and outfitting.
  |elif reportsystem.power = "Denton Patreus" && reportsystem.powerstate = "Control":
    Note: {event.station} offers a ten percent discount on Imperial Ships.
  |elif reportsystem.power = "Zacary Hudson:" && reportsystem.powerstate = "Control":
    Note: {event.station} offers a ten percent discount on weapons.
  |elif reportsystem.power = "Edmund Mahon:" && reportsystem.powerstate = "Control":
    Note: {event.station} offers a twenty percent discount on Cargo Racks and Hull Renforcement Packages.
  }
}

The fist part on reporting the reportsystem powerstate and reportsystem power works as expected. The second part does not work. No matter what the reportsystem.power is it always resolves the first line. I don't understand why this happens. I'm checking if the reportsystem.power equals Li Yong-Rui AND if reportsystem.powerstate equals Control, OR Expansion. It acts like it's only checking if reportsystem.powerstate equals Control or Expansion, and ignoring the first part.

This is the result I get:

Code:
This station and system is Exploited by Arissa Lavigny-Duval. Note: G-Mahoney-1 offers a fifteen percent discount on ships and outfitting.

The discount line should not be read out because reportsystem.power = Arissa Lavigny-Duval. What am I doing wrong?
 
Is there a way to have EDDI report when a specific time in game has passed? I'm interested in creating a script that will check what time it is in game time, and then report when a time has passed. I want to know when the in game time has passed 16.55 to report when the BGS tick has completed.
 
Is there a way to have EDDI report when a specific time in game has passed? I'm interested in creating a script that will check what time it is in game time, and then report when a time has passed. I want to know when the in game time has passed 16.55 to report when the BGS tick has completed.
Not really... EDDI's events typically focus around interfacing with the information from the game rather than with your system's clock. There are quite a few alarm clock style applications that can fill the niche you are asking about though.
 
Guys, anyone else having problems with the EDDI/VA Galnet related commands?

My EDDI as the Galnet monitor plugin enabled and I also checked the "Read Galnet articles when logged out". On the Speech Responder, all Galnet related eventes are also checked.

However, when I issue galnet commands on VA to read the Galnet news all I get is "There is no unread news in that category". If I try the "Is there any news?" command, it tells me "you have 16 unread news itens".

Any clues/tips?
 
Guys, anyone else having problems with the EDDI/VA Galnet related commands?

My EDDI as the Galnet monitor plugin enabled and I also checked the "Read Galnet articles when logged out". On the Speech Responder, all Galnet related eventes are also checked.

However, when I issue galnet commands on VA to read the Galnet news all I get is "There is no unread news in that category". If I try the "Is there any news?" command, it tells me "you have 16 unread news itens".

Any clues/tips?

Known issue. When FDev revamped their feed it broke the categorization that EDDI performs. See https://github.com/EDCD/EDDI/issues/599.
I've generated a fix but it needs a little more polish before we incorporate it.

Until this fix is incorporated, you'll probably find most (or all) of the news under the "Article" category.
 
Top Bottom