Release EDDI Scripts and EDDI enabled VA Commands Thread

Commodity collected script.

In my never ending quest to extract as much information out of EDDI I came up with the following edit to the Commodity Collected Event. This is what fires off when you collect a commodity in your ship or SRV.

This script will say the commodity collect, if it's stolen, and then will report the Category and Average selling price of the Commodity. Getting the price info was tricky as there is no station that buys everything. I added conditions for each of the economy types, and then add stations selling the commodity's that aren't listed in the main stations.

I hope someone else likes this script as much as I do.

That's pretty good Zev! :) Now, I hope you don't mind a little suggestion? This is just my personal opinion, so dismiss it if you wish, but I'm a bit of a 'neat freak' with my scripting and the multiple nested IF/ELSE statements didn't 'feel' quite right. I gave the script a quick once-over and came up with the below. I think it takes about the same time to process, but (to me at least) looks a bit tidier.

Code:
{_ Commodity collected}{_ Triggered when you pick up a commodity in your ship or SRV}


{_ Context }
{SetState('eddi_context_last_subject', 'commodity')}
{SetState('eddi_context_last_action', 'collect')}
{SetState('eddi_context_cargo_name', event.commodity)}


{OneOf("Cargo","Commodity")}
{OneOf("container","canister")}

{if event.commodity:
    of {event.commodity},
}

collected.

{if event.stolen:
    Warning this item is marked as stolen.
}


{_ High Tech_Refinery}
{set marketcommodity to CommodityMarketDetails((event.commodity), "Fowler Orbital", "Dvorsi")}

{if !marketcommodity.avgprice:
    {_ Industrial}  
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Crossfield Terminal", "Gubian")}
}

{if !marketcommodity.avgprice: 
    {_ Agriculture}   
    {set marketcommodity to CommodityMarketDetails((event.commodity), "van Vogt City", "Maunggu")}
}

{if !marketcommodity.avgprice: 
    {_ Extraction} 
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Comper Dock", "Bactondinks")}  
}

{if !marketcommodity.avgprice: 
    {_ Military}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Clebsch Survey", "Ombikio")}  
}

{if !marketcommodity.avgprice: 
    {_ Service}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Bell Terminal", "Achenar")}  
}

{if !marketcommodity.avgprice: 
    {_ Terraforming}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Morgan Terminal", "Maunggu")}  
}

{if !marketcommodity.avgprice: 
    {_ Tourism}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Fort Lawrence", "Exioce")}  
}

{if !marketcommodity.avgprice: 
    {_ Colony}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Severin Terminal", "Dvorsi")}  
}

{if !marketcommodity.avgprice: 
    {_ Combat Stabilisers}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Helin Dock", "Njiri")}  
}

{if marketcommodity.avgprice: 
    {marketcommodity.name} is classified as {marketcommodity.category}
    with an average selling price of {marketcommodity.avgprice} credits.
}
I think it probably does slightly more 'processing' to achieve the same result, but I think it looks easier to read.

Well, use if you like, or don't. :D I'm glad you're taking the time to share your creations with everyone.

-=] Darkcyde [=-
 
That's pretty good Zev! :) Now, I hope you don't mind a little suggestion? This is just my personal opinion, so dismiss it if you wish, but I'm a bit of a 'neat freak' with my scripting and the multiple nested IF/ELSE statements didn't 'feel' quite right. I gave the script a quick once-over and came up with the below. I think it takes about the same time to process, but (to me at least) looks a bit tidier.

Code:
{_ Commodity collected}{_ Triggered when you pick up a commodity in your ship or SRV}


{_ Context }
{SetState('eddi_context_last_subject', 'commodity')}
{SetState('eddi_context_last_action', 'collect')}
{SetState('eddi_context_cargo_name', event.commodity)}


{OneOf("Cargo","Commodity")}
{OneOf("container","canister")}

{if event.commodity:
    of {event.commodity},
}

collected.

{if event.stolen:
    Warning this item is marked as stolen.
}


{_ High Tech_Refinery}
{set marketcommodity to CommodityMarketDetails((event.commodity), "Fowler Orbital", "Dvorsi")}

{if !marketcommodity.avgprice:
    {_ Industrial}  
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Crossfield Terminal", "Gubian")}
}

{if !marketcommodity.avgprice: 
    {_ Agriculture}   
    {set marketcommodity to CommodityMarketDetails((event.commodity), "van Vogt City", "Maunggu")}
}

{if !marketcommodity.avgprice: 
    {_ Extraction} 
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Comper Dock", "Bactondinks")}  
}

{if !marketcommodity.avgprice: 
    {_ Military}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Clebsch Survey", "Ombikio")}  
}

{if !marketcommodity.avgprice: 
    {_ Service}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Bell Terminal", "Achenar")}  
}

{if !marketcommodity.avgprice: 
    {_ Terraforming}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Morgan Terminal", "Maunggu")}  
}

{if !marketcommodity.avgprice: 
    {_ Tourism}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Fort Lawrence", "Exioce")}  
}

{if !marketcommodity.avgprice: 
    {_ Colony}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Severin Terminal", "Dvorsi")}  
}

{if !marketcommodity.avgprice: 
    {_ Combat Stabilisers}
    {set marketcommodity to CommodityMarketDetails((event.commodity), "Helin Dock", "Njiri")}  
}

{if marketcommodity.avgprice: 
    {marketcommodity.name} is classified as {marketcommodity.category}
    with an average selling price of {marketcommodity.avgprice} credits.
}
I think it probably does slightly more 'processing' to achieve the same result, but I think it looks easier to read.

Well, use if you like, or don't. :D I'm glad you're taking the time to share your creations with everyone.

-=] Darkcyde [=-

Thank you very much for the code advise. I knew the code was sloppy. While making the script I was concerned that the checks might be missed and I'd get blank values. At one point I considered scrapping the CommodityMarketDetails function entirely and just making a massive list of ALL commodities and avg prices. Thankfully lazyness talked me out of it. My mind didn't reach the point of checks and one speech line. Code syntax is the death of me LOL.
 
Thank you very much for the code advise. I knew the code was sloppy. While making the script I was concerned that the checks might be missed and I'd get blank values. At one point I considered scrapping the CommodityMarketDetails function entirely and just making a massive list of ALL commodities and avg prices. Thankfully lazyness talked me out of it. My mind didn't reach the point of checks and one speech line. Code syntax is the death of me LOL.

Hehe! I know what you mean.

Well, in my never-ending quest for efficiency, I've now shortened the whole script to this :-

Code:
{_ Commodity collected}
{_ Triggered when you pick up a commodity in your ship or SRV}

{_ Context }
{SetState('eddi_context_last_subject', 'commodity')}
{SetState('eddi_context_last_action', 'collect')}
{SetState('eddi_context_cargo_name', event.commodity)}

{OneOf("Cargo","Commodity")}
{OneOf("container","canister")}

{if event.commodity:
    of {event.commodity},
}
collected.

{if event.stolen:
    Warning this item is marked as stolen.
}

{_ High Tech_Refinery, Industrial, Agriculture, Extraction, Military}
{_ Service, Terraforming, Tourism, Colony, Combat Stabilisers}

{set stations to ["Fowler Orbital", "Crossfield Terminal", "van Vogt City", "Comper Dock", "Clebsch Survey", "Bell Terminal", "Morgan Terminal", "Fort Lawrence", "Severin Terminal", "Helin Dock"]}
{set systems to ["Dvorsi", "Gubian", "Maunggu", "Bactondinks", "Ombikio", "Achenar", "Maunggu", "Exioce", "Dvorsi", "Njiri"]}
{set pos to 0}

{while pos < 10):
    {set marketcommodity to CommodityMarketDetails(event.commodity, stations[pos], systems[pos])}
    {if marketcommodity.avgprice: {set pos to 10} }
    {set pos to pos + 1}
}

{if marketcommodity.avgprice: 
    {marketcommodity.name} is classified as {marketcommodity.category}
    with an average selling price of {marketcommodity.avgprice} credits.
}
It's way more efficient and seems to execute much faster (the other version took a couple of seconds to process), although it can be just as slow if the commodity isn't for sale at any of the stations.

It sets up the stations and systems as arrays, and then cycles through each one in the same order you have them. When it gets a valid price, it then carries on with the script as normal.

Granted, this is still kinda 'theory' as I've not actually tested it in game (I'm out of the bubble at the moment), although I have tested it by hard-coding the commodity (to "Gold" and "Explosives") and it did work perfectly. If you could test this for me in game, I'd be very grateful. :) I'm interested to see if my 'theory' is valid! ;)

-=] Darkcyde [=-
 
Last edited:
Hehe! I know what you mean.

Well, in my never-ending quest for efficiency, I've now shortened the whole script to this :-

Code:
{_ Commodity collected}
{_ Triggered when you pick up a commodity in your ship or SRV}

{_ Context }
{SetState('eddi_context_last_subject', 'commodity')}
{SetState('eddi_context_last_action', 'collect')}
{SetState('eddi_context_cargo_name', event.commodity)}

{OneOf("Cargo","Commodity")}
{OneOf("container","canister")}

{if event.commodity:
    of {event.commodity},
}
collected.

{if event.stolen:
    Warning this item is marked as stolen.
}

{_ High Tech_Refinery, Industrial, Agriculture, Extraction, Military}
{_ Service, Terraforming, Tourism, Colony, Combat Stabilisers}

{set stations to ["Fowler Orbital", "Crossfield Terminal", "van Vogt City", "Comper Dock", "Clebsch Survey", "Bell Terminal", "Morgan Terminal", "Fort Lawrence", "Severin Terminal", "Helin Dock"]}
{set systems to ["Dvorsi", "Gubian", "Maunggu", "Bactondinks", "Ombikio", "Achenar", "Maunggu", "Exioce", "Dvorsi", "Njiri"]}
{set pos to 0}

{while pos < 10):
    {set marketcommodity to CommodityMarketDetails(event.commodity, stations[pos], systems[pos])}
    {if marketcommodity.avgprice: {set pos to 10} }
    {set pos to pos + 1}
}

{if marketcommodity.avgprice: 
    {marketcommodity.name} is classified as {marketcommodity.category}
    with an average selling price of {marketcommodity.avgprice} credits.
}
It's way more efficient and seems to execute much faster (the other version took a couple of seconds to process), although it can be just as slow if the commodity isn't for sale at any of the stations.

It sets up the stations and systems as arrays, and then cycles through each one in the same order you have them. When it gets a valid price, it then carries on with the script as normal.

Granted, this is still kinda 'theory' as I've not actually tested it in game (I'm out of the bubble at the moment), although I have tested it by hard-coding the commodity (to "Gold" and "Explosives") and it did work perfectly. If you could test this for me in game, I'd be very grateful. :) I'm interested to see if my 'theory' is valid! ;)

-=] Darkcyde [=-

That array is very sexy. Setting up array's is way above my pay grade LOL. Question, when using the array above and adding stations, is the only thing that needs to be done is add the station name to the array, and increase the pos number by one correct?

I'll change my script to use the array and let you know how it works.
 
That array is very sexy. Setting up array's is way above my pay grade LOL. Question, when using the array above and adding stations, is the only thing that needs to be done is add the station name to the array, and increase the pos number by one correct?

I'll change my script to use the array and let you know how it works.

Yep, that's right. You can just add more stations and systems to each array (make sure each station has a corresponding system, even if it's repeated), and then increase the pos number to be 1 more than the number of stations/systems in the array list. When it gets a valid average price, or counts pos to 10, it quits the WHILE loop, so any additional stations will not get checked. This way, the minimum number of checks are performed to get a valid price.

I'd say you've probably covered almost all market types with the list already, but be aware that adding more can potentially increase processing time if the commodity isn't in any market (and the loop will have to go through all stations in the list).

Aaaannddd, here I've updated it again (already!). :D This time it automatically gets the length of the array, so no need to update a POS number manually, just add more stations/systems and that's all you need to change. :D
Code:
{_ Commodity collected}
{_ Triggered when you pick up a commodity in your ship or SRV}

{_ Context }
{SetState('eddi_context_last_subject', 'commodity')}
{SetState('eddi_context_last_action', 'collect')}
{SetState('eddi_context_cargo_name', event.commodity)}

{OneOf("Cargo","Commodity")}
{OneOf("container","canister")}

{if event.commodity:
    of {event.commodity},
}
collected.

{if event.stolen:
    Warning this item is marked as stolen.
}

{_ High Tech_Refinery, Industrial, Agriculture, Extraction, Military}
{_ Service, Terraforming, Tourism, Colony, Combat Stabilisers}

{set stations to ["Fowler Orbital", "Crossfield Terminal", "van Vogt City", "Comper Dock", "Clebsch Survey", "Bell Terminal", "Morgan Terminal", "Fort Lawrence", "Severin Terminal", "Helin Dock"]}
{set systems to ["Dvorsi", "Gubian", "Maunggu", "Bactondinks", "Ombikio", "Achenar", "Maunggu", "Exioce", "Dvorsi", "Njiri"]}
{set pos to 0}

{while pos < len(stations):
    {set marketcommodity to CommodityMarketDetails(event.commodity, stations[pos], systems[pos])}
    {if marketcommodity.avgprice: {set pos to len(stations)} }
    {set pos to pos + 1}
}

{if marketcommodity.avgprice: 
    {marketcommodity.name} is classified as {marketcommodity.category}
    with an average selling price of {marketcommodity.avgprice} credits.
}
This is the stuff I love to do. Thank you for the opportunity to do so! :D

-=] Darkcyde [=-
 
Hi,

if it happens, that at the FSD engaged event, the 5 sec pause occasionally disappears, and EDDI starts to talk during the countdown, remove all the P() functions from the script like this:

{P(reportsystem.name)} -> {reportsystem.name}

I'm using Ivona Kimberly, this solved the problem. In my case, pause disappeared when entered systems, like Col 123-45 b67-8. In case of systems, like Rhea, the pause was there.
Now, the timing is always right :).

By the way, if you are using Ivona voices, there is an update, just start the MiniSpeech software for installing the new versions. My Kimberly and Russell was just updated.

Best regards!
 
By the way, if you are using Ivona voices, there is an update, just start the MiniSpeech software for installing the new versions. My Kimberly and Russell was just updated.
Best regards!


Yeah I get no internet connection, so no update ..weird
..
 
Last edited:
By the way, if you are using Ivona voices, there is an update, just start the MiniSpeech software for installing the new versions. My Kimberly and Russell was just updated.

My Ivona install says there is no update. There hasn't been one for over a year for me. But then, I do have the last standalone download you could get before Ivona changed the way they distribute their voices.
 
I'm looking for a script modification to cut down on the amount of unnecessary radio chatter unless it's directed to me. Also to clear the waves for the addon that adds background ship to ship radio chatter that sounds real. (leading and trailing static, mics getting keyed up etc. - don't recall its name)

I found this but it appears to squelch ALL NPC traffic regardless if it's directed at me or not.

So to summarize:
EDDI not to read inbound messages unless its "DIRECT" (to me)
EDDI not to read NPC to NPC radio traffic.

If you know the life like radio chatter addon I mentioned.... that'd save me some research.
 
I'm looking for a script modification to cut down on the amount of unnecessary radio chatter unless it's directed to me. Also to clear the waves for the addon that adds background ship to ship radio chatter that sounds real. (leading and trailing static, mics getting keyed up etc. - don't recall its name)

I found this but it appears to squelch ALL NPC traffic regardless if it's directed at me or not.

So to summarize:
EDDI not to read inbound messages unless its "DIRECT" (to me)
EDDI not to read NPC to NPC radio traffic.

If you know the life like radio chatter addon I mentioned.... that'd save me some research.

This has been a part of my personality for quite some time now. You're not the first to ask for something like this. I too was fed up with all the irrelevant chatter, so I made this version of the 'Message Received' event script...
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)}

{_ Setup channel list to speak. Only messages received on these channels will be spoken _}
{_ Options: direct, friend, local, multicrew, npc, player, voicechat, wing _}
{set channellist to ["direct", "friend", "multicrew", "npc", "player", "voicechat", "wing"]}

{_ Setup sender list to speak. Only messages FROM these will be spoken _}
{_ Messages from Players will always be spoken _}
{_ Options: Ambushed pilot, Bounty hunter, Capital ship, Cargo hunter _}
{_ Civilian pilot, Commander, Cruise liner, Escort, Exploration convoy _}
{_ Hitman, Messenger, Military, Miner, NPC, Passenger hunter, Passenger liner _}
{_ Pirate, Police, Propagandist, Protester, Refugee, Rival power's agent _}
{_ Search and rescue, Starship One, Station, Wedding convoy, Wing mate _}
{set senderlist to ["Bounty hunter", "Military", "Pirate", "Police"]}


{if event.player = true:
    {if event.message = "o7":
        {event.from} salutes
        {if event.channel = "player":
            you
        }.
    |else:
        {event.source} {event.from} sends: {event.message}.
    }
|elif find(channellist, event.channel) > -1 && find(senderlist, event.source) > -1:
    From {event.from}: {event.message}.
}
Configure it to your preferences by adding or removing the items to the 'channellist' and 'senderlist'. You will only hear messages that are from both, or from real players.

o7

-=] Darkcyde [=-
 
I'm looking for a script modification to cut down on the amount of unnecessary radio chatter unless it's directed to me. Also to clear the waves for the addon that adds background ship to ship radio chatter that sounds real. (leading and trailing static, mics getting keyed up etc. - don't recall its name)

I found this but it appears to squelch ALL NPC traffic regardless if it's directed at me or not.

So to summarize:
EDDI not to read inbound messages unless its "DIRECT" (to me)
EDDI not to read NPC to NPC radio traffic.

If you know the life like radio chatter addon I mentioned.... that'd save me some research.

The G19S App will realistically read out radio chatter, and will add traffic control. G19S will read out all messages, though. You can turn off reading out messages if you want.
https://forums.frontier.co.uk/showt...on-app-(with-simulated-space-traffic-control)
 
Searching for a way to somewhat summarize mission cargo, and calculate it against available cargo space.
It's for easy use of delivery/fetch missions BEFORE you actually got the cargo.

Like 'Calculate necessary cargo' command, and it should return the free space summing up all cargo which would be necessary to fulfill your 5 fetch missions you already accepted.

Wouldn't be surprised if one actually has already done this...?
 
Searching for a way to somewhat summarize mission cargo, and calculate it against available cargo space.
It's for easy use of delivery/fetch missions BEFORE you actually got the cargo.

Like 'Calculate necessary cargo' command, and it should return the free space summing up all cargo which would be necessary to fulfill your 5 fetch missions you already accepted.

Wouldn't be surprised if one actually has already done this...?

Cargo Monitor properties makes the solution rather trivial. If you've noticed in the Cargo Monitor tab, there's a column titled 'Need' that does just that.

You can total them up with a simple script...

Code:
{set need to 0}
{for cargo in inventory:
    {set need to need + cargo.need}
}


I'll leave you guys to figure out the rest. ;)
 
Cargo Monitor properties makes the solution rather trivial. If you've noticed in the Cargo Monitor tab, there's a column titled 'Need' that does just that.

You can total them up with a simple script...

Code:
{set need to 0}
{for cargo in inventory:
    {set need to need + cargo.need}
}


I'll leave you guys to figure out the rest. ;)

Wow dude, excuse me for being that dumb... :D
I just came back to the game recently, i do have the newest EDDI beta installed but haven't catched up on the changes. Been quite some changelogs, impressing ones at that!
Thanks for the nudge, mate!
o7
 
Wow dude, excuse me for being that dumb... :D
I just came back to the game recently, i do have the newest EDDI beta installed but haven't catched up on the changes. Been quite some changelogs, impressing ones at that!
Thanks for the nudge, mate!
o7

Lol, no, 'dumb' is not a word I would use. Truth be told, I failed to include the 'need' property in the 'Cargo' section of the Variables window, so this one's on me. [where is it]

Fixed for next beta release.
 
Hi,

for some time now, I have a problem with the script "System state report". It always reports what is in the "|else" branch at the bottom, no matter what the system state is.

Here is the script I use. It is triggered with the FSD engaged event/script.

Code:
{_ Fetch from context }
{set reportsystem to SystemDetails(state.eddi_context_system_system)}


{if !reportsystem.name || reportbody.name = "":
    Bitte das Sternen System spezifizieren.
|else:
    Dieses System
    {if reportsystem.state = "Rückzug"             || reportsystem.state = "Retreat"   : ist im Rückzug.
    |elif reportsystem.state = "Krieg"                || reportsystem.state = "War"       : ist im Kriegszustand. Vorsicht ist geboten!
    |elif reportsystem.state = "Aufschwung"     || reportsystem.state = "Boom"      : ist im Aufschwung. Hier könnten sich gute Geschäfte ergeben.
    |elif reportsystem.state = "Bürgerkrieg"     || reportsystem.state = "Civil War" : macht einen Bürgerkrieg durch. Vorsicht ist geboten!
    |elif reportsystem.state = "Zivile Unruhen" || reportsystem.state = "Civil Unrest"    : befindet sich in Aufruhr. Vorsicht ist geboten
    |elif reportsystem.state = "Hungersnot"     || reportsystem.state = "Famine"    : durchleidet eine Hungersnot. Vorsicht ist geboten!
    |elif reportsystem.state = "Abriegelung"    || reportsystem.state = "Lockdown"  : ist gegenwärtig abgeriegelt. Vorsicht ist geboten
    |elif reportsystem.state = "Ausbruch"        || reportsystem.state = "Outbreak"  : versucht den Ausbruch einer Seuche zu verhindern. Vorsicht ist geboten!
    |elif reportsystem.state = "Expansion"      || reportsystem.state = "Expansion" : bereitet eine Expansion in ein weiteres System vor.
    |elif reportsystem.state = "Pleite"              || reportsystem.state = "Bust"      : ist pleite.
    |elif reportsystem.state = "Wahlen"           || reportsystem.state = "Election"  : wählt eine neue Führung
    |elif reportsystem.state = "Investition"       || reportsystem.state = "Investment": investiert zur Zeit in seine Infrastruktur.
    |else:
     meldet keinen besonderen Zustand.
    }
}

I also tried the original script, the one that comes with EDDI and it is the same thing.
Anybody else has this problem? Any help is appreciated.
I use version EDDI v.3.1.0-b1 and I play ED in german language.

Thanks
 
Top Bottom