Release EDDI Scripts and EDDI enabled VA Commands Thread

Ah ok, thanks for the reply.

Yesterday, I tried again the "read latest news" (or something like that) and EDDI read something for me. O.O

Gotta love computers, huh? *LOL*
 
body materials percentage

Hi all,

I'm looking for some help with an EDDI script. I've got a quick 'materials report' (I modified the default body scanned report to make it quicker and removed a lot).

my code works (yay :D ), but I'd like an extra piece of information included. I could probably build a huge if/else statement to cover it or send info to Voice Attack but I'm hoping for a more elegant and simple solution.

Currently it reports on 'great materials' and advises the percentage of each material found on the body. So for example it may say " there is a 1.4% composition of tellurium and a 1.9% composition of arsenic"

What I'm try to add is for it to say "there is a 1.4% composition of tellurium, the maximum percentage found is 1.7% ..." , then carry on to the next material.

So, all I'm really looking for is the maximum percentage found for any material.

From what I can tell the 'great materials' percentage is resolved from within MaterialDetails(material.material).greatpctbody, but I have been unable to get EDDI to say the percentage.


Any help much appreciated. Code snippets below - not the full script, but the important parts relating to my question. If anyone wants the full script I'm happy to post it up.

Code that sets great materials:

Code:
 {set goodmaterials to []}
        {set greatmaterials to []}
        {for material in reportbody.materials:
            {if material.percentage >= MaterialDetails(material.material).greatpctbody:
                {set greatmaterials to cat(greatmaterials, [material])}
            |elif material.percentage >= MaterialDetails(material.material).goodpctbody:
                {set goodmaterials to cat(goodmaterials, [material])}
            }
        }

Code that checks if there's nothing useful:

Code:
{if len(greatmaterials) = 0 
{OneOf("no materials of note", "nothing worthwhile here")}}


Code that says material percentage and type of material:

Code:
{if len(greatmaterials) > 0:
 there is 
            {if len(greatmaterials) = 1:
               {Humanise (greatmaterials[0].percentage)} percent composition of {greatmaterials[0].material} 
            |elif len(greatmaterials) = 2:
               {Humanise (greatmaterials[0].percentage)} percent composition of {greatmaterials[0].material}  and  {Humanise (greatmaterials[1].percentage)} percent composition of {greatmaterials[1].material}
            |else: 

...continues on......

Thanks in advance from out near Sagittarius A*
 
Hi all,

I'm looking for some help with an EDDI script. I've got a quick 'materials report' (I modified the default body scanned report to make it quicker and removed a lot).

my code works (yay :D ), but I'd like an extra piece of information included. I could probably build a huge if/else statement to cover it or send info to Voice Attack but I'm hoping for a more elegant and simple solution.

Currently it reports on 'great materials' and advises the percentage of each material found on the body. So for example it may say " there is a 1.4% composition of tellurium and a 1.9% composition of arsenic"

What I'm try to add is for it to say "there is a 1.4% composition of tellurium, the maximum percentage found is 1.7% ..." , then carry on to the next material.

So, all I'm really looking for is the maximum percentage found for any material.

From what I can tell the 'great materials' percentage is resolved from within MaterialDetails(material.material).greatpctbody, but I have been unable to get EDDI to say the percentage.


Any help much appreciated. Code snippets below - not the full script, but the important parts relating to my question. If anyone wants the full script I'm happy to post it up.

Code that sets great materials:

Code:
 {set goodmaterials to []}
        {set greatmaterials to []}
        {for material in reportbody.materials:
            {if material.percentage >= MaterialDetails(material.material).greatpctbody:
                {set greatmaterials to cat(greatmaterials, [material])}
            |elif material.percentage >= MaterialDetails(material.material).goodpctbody:
                {set goodmaterials to cat(goodmaterials, [material])}
            }
        }

Code that checks if there's nothing useful:

Code:
{if len(greatmaterials) = 0 
{OneOf("no materials of note", "nothing worthwhile here")}}


Code that says material percentage and type of material:

Code:
{if len(greatmaterials) > 0:
 there is 
            {if len(greatmaterials) = 1:
               {Humanise (greatmaterials[0].percentage)} percent composition of {greatmaterials[0].material} 
            |elif len(greatmaterials) = 2:
               {Humanise (greatmaterials[0].percentage)} percent composition of {greatmaterials[0].material}  and  {Humanise (greatmaterials[1].percentage)} percent composition of {greatmaterials[1].material}
            |else: 

...continues on......

Thanks in advance from out near Sagittarius A*
{MaterialDetails()} returns a generalized material definition - the percentage from the specific body is not carried over.
So while you can use {MaterialDetails()} to categorize materials, it needs to be kept distinct from the event material so that you can access the percentage via the original event collection... {event.materials}.
 
Does the stations array have the type of station stored? For example, Outposts, and Starports? If so, how would I list the number Outposts, Starports, Planetary outposts, and Planetary ports? Working with array's is the one thing in cottle that I can never wrap my head around.
 
Guys, I am trying to make my VA script/profile a bit less dependent on EDDI' speech Responder. I wrote LESS dependent, not INdependent ;)

With that in mind, I would like VA to be able to get the whole text from an EDDI event and read it to me, instead of telling ED to read it.

For example, there is the 'System report' script in EDDI. When it is executed it would read something like "Gura is an Empire system with a population of 300 souls, allied with Satan. Bearers of the evil flame is the controlling faction".

Is there any way I can make VA set that text to a variable, so it can read it for me, instead of having to use EDDI to read it?
 
Does the stations array have the type of station stored? For example, Outposts, and Starports? If so, how would I list the number Outposts, Starports, Planetary outposts, and Planetary ports? Working with array's is the one thing in cottle that I can never wrap my head around.

The system object has built-in lists of planetary and orbital stations. Check out the 'System report' script on how to use those. If you're looking for Starports vs Outposts, etc you will have to roll your own.

Just off the top of my head, for current star system (have NOT tested it)...

Code:
{set starport to 0}
{set outpost to 0}
{set p_port to 0}
{set p_outpost to 0}

{for station in system.stations:
    {if station.model && station.model != "":
        {if find(station.model, "Starport") > -1: {set starport to starport + 1}}
        {if find(station.model, "Outpost") > -1: {set outpost to outpost + 1}}
        {if find(station.model, "Planetary Outpost") > -1: {set p_outpost to p_outpost + 1}}
        {if find(station.model, "Planetary Port") > -1: {set p_port to p_port + 1}}
    }
}
 
Guys, I am trying to make my VA script/profile a bit less dependent on EDDI' speech Responder. I wrote LESS dependent, not INdependent ;)

With that in mind, I would like VA to be able to get the whole text from an EDDI event and read it to me, instead of telling ED to read it.

For example, there is the 'System report' script in EDDI. When it is executed it would read something like "Gura is an Empire system with a population of 300 souls, allied with Satan. Bearers of the evil flame is the controlling faction".

Is there any way I can make VA set that text to a variable, so it can read it for me, instead of having to use EDDI to read it?

There is an option in EDDI to output all spoken text to the speechresponder.out file. You might be able to have voiceattack parse this file and read out the latest entry. I have no idea how you would do that though.
 
There is an option in EDDI to output all spoken text to the speechresponder.out file. You might be able to have voiceattack parse this file and read out the latest entry. I have no idea how you would do that though.

Interesting approach, but it would be better if there was one that doesn't require changing anything on EDDI.

I say this because some other people download my VA profile and they might not be willing to mess with EDDI's settings.

Thanks for the tip. If every thing else fails... ;)
 
Guys, I am trying to make my VA script/profile a bit less dependent on EDDI' speech Responder. I wrote LESS dependent, not INdependent ;)

With that in mind, I would like VA to be able to get the whole text from an EDDI event and read it to me, instead of telling ED to read it.

For example, there is the 'System report' script in EDDI. When it is executed it would read something like "Gura is an Empire system with a population of 300 souls, allied with Satan. Bearers of the evil flame is the controlling faction".

Is there any way I can make VA set that text to a variable, so it can read it for me, instead of having to use EDDI to read it?

Yes, you could write a script that would save another script to a text variable, and then set the text to a state variable.

For example:

Code:
{set systemreport to F("System report")}
{if systemreport:
    {SetState('systemreport', systemreport)}
}

You would call this script from VA and the text would be in {TXT:EDDI state systemreport}.

But, to be blunt, I'm having a problem wrapping my head around why you would want to do this. First, you're still dependent on EDDI creating the text in the first place. Why do you want VA to speak it? EDDI excels at creating text from FDev data and speaking it... that's what it does. VA excels at 'doing things'. You use each to what it does best.
 
Yes, you could write a script that would save another script to a text variable, and then set the text to a state variable.

For example:

Code:
{set systemreport to F("System report")}
{if systemreport:
    {SetState('systemreport', systemreport)}
}

You would call this script from VA and the text would be in {TXT:EDDI state systemreport}.

But, to be blunt, I'm having a problem wrapping my head around why you would want to do this. First, you're still dependent on EDDI creating the text in the first place. Why do you want VA to speak it? EDDI excels at creating text from FDev data and speaking it... that's what it does. VA excels at 'doing things'. You use each to what it does best.

Well, right now my main motivation comes from an issue I reported on EDDI's site. Randomly, VA asking EDDI to say things has been crashing my VA. VA error log says something like "the selected voice couldn't be found". However, it's the same voice VA uses (when EDDI plugin is disabled) and EDDI uses when I open it without opening VA. It's been hard to have VA+EDDI running without a crash for 30min :(

Thanks for the suggestion. If I get EDDI plugin to stop crashing VA, I won't need it :D
 
The system object has built-in lists of planetary and orbital stations. Check out the 'System report' script on how to use those. If you're looking for Starports vs Outposts, etc you will have to roll your own.

Just off the top of my head, for current star system (have NOT tested it)...

Code:
{set starport to 0}
{set outpost to 0}
{set p_port to 0}
{set p_outpost to 0}

{for station in system.stations:
    {if station.model && station.model != "":
        {if find(station.model, "Starport") > -1: {set starport to starport + 1}}
        {if find(station.model, "Outpost") > -1: {set outpost to outpost + 1}}
        {if find(station.model, "Planetary Outpost") > -1: {set p_outpost to p_outpost + 1}}
        {if find(station.model, "Planetary Port") > -1: {set p_port to p_port + 1}}
    }
}

Thank you for this! Just what I was looking for. I noticed that the outpost's value was not accurate (showing more or less outposts in system then really were). So I came up with this. Seems to work well, and gives me a good idea of what is in the system when I jump in.

Code:
{set starport to 0}
{set outpost to 0}
{set p_port to 0}
{set p_outpost to 0}


{for station in reportsystem.stations:
    {if station.model && station.model != "":
        {if find(station.model, "Starport") > -1: {set starport to starport + 1}}
        {if find(station.model, "Outpost") > -1: {set outpost to outpost + 1}}
        {if find(station.model, "Planetary Outpost") > -1: {set p_outpost to p_outpost + 1}}
        {if find(station.model, "Planetary Port") > -1: {set p_port to p_port + 1}}
    }
}
       


{if starport || outpost || p_outpost || p_port:


{if len(reportsystem.orbitalstations) = 1:
   There is {OneOf("a single", "a lone", "just one", "one")} orbital station
     {if starport = 1:
       , a starport,
     }
|else:
    There are {len(reportsystem.orbitalstations)} orbital stations
       {if starport:
         , {starport} of these are starports,
       }
}  
  
{if (p_outpost || p_port) && (starport || outpost):
  {if p_outpost = 1:
    , there is also
  |else:
    , there are also
  }
|elif p_outpost || p_port: 
  There is
}


{if p_outpost:
   {if p_outpost = 1:
     a single planetary outpost
   |elif p_outpost > 1:
     {p_outpost} planetary outposts
   }
   {if p_port:
     , and
   }
}
{if p_port:
  {if p_port = 1:
   a single planetary port
   |elif p_outpost > 1:
   {p_port} planetary ports
   }
}


in {OneOf("this system", "{event.system}")}. 
}

I've extensively edited my jumped script to provide all sorts of info when I enter a system. Here is my jumped script in it's entirety:

Code:
{_ Fetch from context }
{set reportsystem to SystemDetails(event.system)}
{SetState('eddi_context_last_subject', 'jump')}
{SetState('eddi_context_last_action', 'complete')}
{SetState('eddi_context_system_name', system.name)}
{SetState('eddi_context_system_system', system.name)}
{SetState('eddi_context_fuel_remaining', event.fuelremaining)}
{SetState('eddi_context_fuel_used', event.fuelused)}


{if state.discovery_scanner = 0:
  {Occasionally(6, "Note: no discovery scanner currently eqquiped.")}
}


{if event.population:
    {event.system} is
        {if event.allegiance = "Federation":
            a Federation
        |elif event.allegiance = "Empire":
            an Empire
        |elif event.allegiance = "Alliance":
            an Alliance
        |elif event.allegiance = "Independent":
            an Independent
        }
        {if event.government:
            {event.government} government
        |else:
          system
        }
        {OneOf("of", "with a population of", "home to", "supporting")} {Humanise(event.population)} {OneOf("people", "souls")}
        
{if system.power && system.powerstate:
       


{if system.power = "Arissa Lavigny-Duval": 
   {if system.powerstate = "Control":
    Note: Bounties redeemed in {event.system} are twenty percent more and fines and bounties incurred are doubled because it is {system.powerstate} by {system.power}.
   }
   {if system.powerstate = "Exploited":
  Note: Bounties redeemed in {event.system} are twenty percent more because it is {system.powerstate} by {system.power}. 
   }  


|elif system.power = "Aisling Duval": 
   This system is {system.powerstate} by {system.power}.


|elif system.power = "Archon Delaine": 
   {if system.powerstate = "Control":
    Note: Security level is reduced by half and black markets are opened in {event.system} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile.
   }
  {if system.powerstate = "Exploited":
  Note: Security level is reduced by half in {event.system} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile. 
  }


|elif system.power = "Denton Patreus":
    This system is {system.powerstate} by {system.power}.


|elif system.power = "Edmund Mahon:"
    This system is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.   
     
|elif system.power = "Felicia Winters":
    {if system.powerstate = "Control": 
    Note: Security levels are increased by twenty percent in {event.system} because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile.
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Empire":
    This system is {system.powerstate} by {system.power}.  Warning! This system is hostile. 
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Federation": 
      Note: Security levels are increased by twenty percent in {event.system} because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile.
    }  
    {if system.powerstate = "Exploited" && event.allegiance = "Alliance":
    This system is {system.powerstate} by {system.power}.  Warning! This system is hostile.
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Independent":
     Note: Security levels are increased by twenty percent in {event.system} because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile.
    }


|elif system.power = "Li Yong-Rui"
     This system is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.  
 
|elif system.power = "Pranav Antal": 
   {if system.powerstate = "Control":
    Note: Fines and bounties incurred are doubled in {event.system} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.
   }
   {if system.powerstate = "Exploited":
  Note: Fines and bounties incurred are fifty percent more in {event.system} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.
   }  


|elif system.power = "Zachary Hudson":
    {if system.powerstate = "Control": 
    Note: The Security level in {event.system} is increased by thirty percent because it is {system.powerstate} by {system.power}.  Warning! This system is hostile.
    }
    {if system.powerstate = "Exploited" && (event.allegiance = "Empire" || event.allegiance = "Alliance" || event.allegiance ="Independent"):
    Note: The Security level in {event.system} is reduced by fourty percent because it is {system.powerstate} by {system.power}.  Warning! This system is hostile. 
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Federation":
    Note: The security level in {event.system} is increased by twenty percent because it is {system.powerstate} by {system.power}.  Warning! This system is hostile.
    }
           
|elif system.power = "Zemina Torval": 
   This system is {system.powerstate} by {system.power}.


|elif system.power = "Yuri Grom": 
   {if system.powerstate = "Control":
    Note: Bounties redeemed in {event.system} are twenty percent more because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile, but is allied with the Empire.
   }
   {if system.powerstate = "Exploited":
  Note: Bounties redeemed in {event.system} are twenty percent more because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile, but is allied with the Empire.
   }  
 


}      




}


{if event.faction:
          {P(event.faction)} is the controlling {OneOf("power", "faction")}




{if system.state && system.state != "None":
 
,in a state of {system.state}.
|elif reportsystem.state && reportsystem.state != "None":


,in a state of {reportsystem.state}.
|elif event.factionstate && event.factionstate != "None":


,in a state of {event.factionstate}.
|else:
.
}




}
{if event.economy:
         The primary economy here is {event.economy}.
}


{set starport to 0}
{set outpost to 0}
{set p_port to 0}
{set p_outpost to 0}


{for station in reportsystem.stations:
    {if station.model && station.model != "":
        {if find(station.model, "Starport") > -1: {set starport to starport + 1}}
        {if find(station.model, "Outpost") > -1: {set outpost to outpost + 1}}
        {if find(station.model, "Planetary Outpost") > -1: {set p_outpost to p_outpost + 1}}
        {if find(station.model, "Planetary Port") > -1: {set p_port to p_port + 1}}
    }
}
       


{if starport || outpost || p_outpost || p_port:


{if len(reportsystem.orbitalstations) = 1:
   There is {OneOf("a single", "a lone", "just one", "one")} orbital station
     {if starport = 1:
       , a starport,
     }
|else:
    There are {len(reportsystem.orbitalstations)} orbital stations
       {if starport:
         , {starport} of these are starports,
       }
}  
  
{if (p_outpost || p_port) && (starport || outpost):
  {if p_outpost = 1:
    , there is also
  |else:
    , there are also
  }
|elif p_outpost || p_port: 
  There is
}


{if p_outpost:
   {if p_outpost = 1:
     a single planetary outpost
   |elif p_outpost > 1:
     {p_outpost} planetary outposts
   }
   {if p_port:
     , and
   }
}
{if p_port:
  {if p_port = 1:
   a single planetary port
   |elif p_outpost > 1:
   {p_port} planetary ports
   }
}


in {OneOf("this system", "{event.system}")}. 
}      


   
The security level of {OneOf("this system", "{event.system}")} is 
{if event.security = "GAlAXY_MAP_INFO_state_anarchy":
  Anarchy.
|else:
  {event.security}.
}


|else:
 {if lastsystem.population && !event.population:
      {OneOf("{event.system} is not populated","There is no human presence in {event.system}", "Humans have yet to colonise {event.system}")}.
  }
}




{_ event.distance equals event.distance}


The last jump of {round(event.distance,1)} light years from {lastsystem.name} used {round(event.fuelused,2)} tons of fuel.


{if state.fuel_scoop != 1:
{F('Fuel check')}
}
 
Last edited:
I've created some scripts that I find very useful and thought I'd share them with the great EDDI community:

Material Collected:
I edited the base script to report on the rarity of the collected material, and also tell me how many of the material I now have after picking it up:
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'material')}
{SetState('eddi_context_last_action', 'collect')}
{SetState('eddi_context_material_name', event.name)}


{set matis to MaterialDetails(event.name)}
{if matis.rarity.name = "very common":
  {set rarity to 1}
|elif matis.rarity.name = "common":
  {set rarity to 2}
|elif matis.rarity.name = "standard":
  {set rarity to 3}
|elif matis.rarity.name = "rare":
  {set rarity to 4}
|elif matis.rarity.name = "very rare":
  {set rarity to 5}
}


{OneOf("{P(matis.name)} {OneOf('Received','Collected','Ob-tained')}",
       "{OneOf('Received','Collected','Ob-tained')} {P(matis.name)}")}.


{if matis.category.name = "Data":
            {Occasionally(2,"This is")} a level {rarity} {OneOf("data set","set of data","data scan")}.
  


|elif matis.category.name = "Element":
  {Occasionally(2,"This is")} a level {rarity} {OneOf("element","raw element","raw material")}.


|elif matis.category.name = "Manufactured":
    {Occasionally(2,"This is")} a level {rarity} {OneOf("manufactured material","manufactured item")}.


}


{_ Function to obtain a material from inventory}
{set _inventory(required) to:
    {for material in materials:
        {if material.material = required:
            {return material}
        }
    }
}


{set material to matis.name}
{if material:
    {_ Fetch full material details }
    {set material to MaterialDetails(material)}
 
    
}




{set inventory to _inventory(material.name)}


{if inventory && inventory.amount > 0:
    {if inventory.amount = 1:
      {inventory.amount} unit of {inventory.material} now in inventory.
    |else:
      {inventory.amount} units of {inventory.material} now in inventory.
    }
|else:
    You have no {inventory.material} on board.
}

Ship targeted:
I've edited the base script to tell me if a targeted ship is wanted, and then to tell me the difference between it's combat rating and my own. I also have it setup by default to tell me the combat rating difference of any ship if have targeted regardless if it is wanted. This can get too chatty in high target situations, so I have a voice attack command that will set a state variable to optionally turn off the non wanted target readout.

Code:
{_ Ship targeted }
{_ Triggered when the player selects a target }


{_ event Parameters:   targetlocked - bool (ie false when losing target) }
{_ If target locked:   name (of ship), scanstage (ie 0, 1, 2, 3) }
{_ If Scan stage >= 1: name (of pilot), rank (of pilot) }
{_ If scan stage >= 2: shieldhealth, hullhealth (both 0-100) }
{_ If scan stage >= 3: faction, legalstatus (ie clean, wanted, etc), bounty (if appicable), }
{_                     subsystem (ie FSD, power plant, etc), subsystemhealth (0-100) }


{_ Context }
{SetState('eddi_context_last_subject', 'ship')}
{SetState('eddi_context_last_action', 'targeted')}


{if event.rank = "Harmless":
  {set rank to 0}
|elif event.rank = "Mostly Harmless":
  {set rank to 1}
|elif event.rank = "Novice":
  {set rank to 2}
|elif event.rank = "Competent":
  {set rank to 3}
|elif event.rank = "Expert":
  {set rank to 4}
|elif event.rank = "Master":
  {set rank to 5}
|elif event.rank = "Dangerous":
  {set rank to 6}
|elif event.rank = "Deadly":
  {set rank to 7}
|elif event.rank = "Elite":
  {set rank to 8}
}




{if event.targetlocked && event.scanstage > 2 && !event.subsystem:
    {set legalstatus to event.legalstatus}
    {if legalstatus = "Wanted" || legalstatus = "Wanted Enemy" || legalstatus = "Warrant":
        Bounty detected on {event.name}.
      {if rank > cmdr.combatrating.rank:
       {set rankdif to (rank - cmdr.combatrating.rank)}
       Note: Target's combat rating of {event.rank} is {rankdif} higher then current combat rating of {cmdr.combatrating.name}.   
      |elif rank = cmdr.combatrating.rank:
         Note: Target's combat rating of {event.rank} is equal to current combat rating of {cmdr.combatrating.name}
      |elif rank < cmdr.combatrating.rank:
{set rankdif to (cmdr.combatrating.rank - rank)}
         Note: Target's combat rating of {event.rank} is {rankdif} lower then current combat rating of {cmdr.combatrating.name}
      }
|else: 


{if state.verbosetarget != 0:
 {if rank > cmdr.combatrating.rank:
       {set rankdif to (rank - cmdr.combatrating.rank)}
       Note: Target {event.name}'s combat rating of {event.rank} is {rankdif} higher then current combat rating of {cmdr.combatrating.name}.   
   }
 {if rank = cmdr.combatrating.rank:
         Note: Target {event.name}'s combat rating of {event.rank} is equal to current combat rating of {cmdr.combatrating.name}
  }


{if rank < cmdr.combatrating.rank:
{set rankdif to (cmdr.combatrating.rank - rank)}
         Note: Target {event.name}'s combat rating of {event.rank} is {rankdif} lower then current combat rating of {cmdr.combatrating.name}
  }
}
}
}
 
I've extensively edited my jumped script to provide all sorts of info when I enter a system. Here is my jumped script in it's entirety:

Nice Zev! Just a quick note though, the section for Yuri Grom won't work because the EDDP server that provides this information was made by the original EDDI author before Yuri was added to the game, and hasn't been updated since they left EDDI in new hands. I believe the EDDI team do not have access to it to update it. Thus, EDDI doesn't know about Yuri, and entering his space just leaves {system.power} blank.

I'd guess this may also be the reason why the number of stations in a system is also incorrect in many cases. As I understand it, the current developers are looking into alternatives for the EDDP server, so hopefully that will be sorted in the near future.
 
Nice Zev! Just a quick note though, the section for Yuri Grom won't work because the EDDP server that provides this information was made by the original EDDI author before Yuri was added to the game, and hasn't been updated since they left EDDI in new hands. I believe the EDDI team do not have access to it to update it. Thus, EDDI doesn't know about Yuri, and entering his space just leaves {system.power} blank.

I'd guess this may also be the reason why the number of stations in a system is also incorrect in many cases. As I understand it, the current developers are looking into alternatives for the EDDP server, so hopefully that will be sorted in the near future.

Yeah I'm anxiously awaiting the updates to the EDDP lookups to make some of the data more accurate. The Yuri Grom script does work most of the time. I have had it correctly read off information in Grom controlled space, but I have noticed many times when the powerplay info is wrong. It seems to be right more times then it is wrong, so I'm ok with it for now.
 
Re Yuri Grom, this is issue #802.

We're on it, but we have finite resources, so please be patient. We are actively looking into an alternative server that looks promising.

Long story short, we are looking to migrate away from the EDDP server.
 
I always struggle with extracting information from module variables. Is it possible for anyone to provide a code template on how to extract information of module objects?
 
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.

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:
  {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
|else:
  {_ Industrial}  
  {set marketcommodity to CommodityMarketDetails((event.commodity), "Crossfield Terminal", "Gubian")}
    {if marketcommodity.avgprice: 
      {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
    |else:
  {_ Agriculture}   
      {set marketcommodity to CommodityMarketDetails((event.commodity), "van Vogt City", "Maunggu")}  
        {if marketcommodity.avgprice: 
          {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
        |else:
   {_ Extraction} 
          {set marketcommodity to CommodityMarketDetails((event.commodity), "Comper Dock", "Bactondinks")}  
           {if marketcommodity.avgprice: 
            {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
           |else:
   {_ Military}
      {set marketcommodity to CommodityMarketDetails((event.commodity), "Clebsch Survey", "Ombikio")}  
        {if marketcommodity.avgprice: 
          {marketcommodity.name} has an average selling price of {marketcommodity.avgprice} credits.
        |else:
   {_ Service}
      {set marketcommodity to CommodityMarketDetails((event.commodity), "Bell Terminal", "Achenar")}  
        {if marketcommodity.avgprice: 
          {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
        |else:
   {_ Terraforming}
      {set marketcommodity to CommodityMarketDetails((event.commodity), "Morgan Terminal", "Maunggu")}  
        {if marketcommodity.avgprice: 
          {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
        |else:
   {_ Tourism}
      {set marketcommodity to CommodityMarketDetails((event.commodity), "Fort Lawrence", "Exioce")}  
        {if marketcommodity.avgprice: 
          {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
        |else:
   {_ Colony}
      {set marketcommodity to CommodityMarketDetails((event.commodity), "Severin Terminal", "Dvorsi")}  
        {if marketcommodity.avgprice: 
          {marketcommodity.name} is classified as {marketcommodity.category} with an average selling price of {marketcommodity.avgprice} credits.
        |else:
{_ 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.
        
}
}
}
}
}
}
}
}
}
}
 
Jumped script.

I've tinkered with my Jumped script even more. It now reports if an engineer is located in a system, and I figured out how to get it to report the correct number of Outposts, Starports, Planet Outposts, and Planet Ports in a system.

Enjoy!

Code:
{_ Fetch from context }{set reportsystem to SystemDetails(event.system)}
{SetState('eddi_context_last_subject', 'jump')}
{SetState('eddi_context_last_action', 'complete')}
{SetState('eddi_context_system_name', system.name)}
{SetState('eddi_context_system_system', system.name)}
{SetState('eddi_context_fuel_remaining', event.fuelremaining)}
{SetState('eddi_context_fuel_used', event.fuelused)}


{if state.discovery_scanner = 0:
  {Occasionally(6, "Note: no discovery scanner currently eqquiped.")}
}


{if event.population:
    {P(event.system)} is
        {if event.allegiance = "Federation":
            a Federation
        |elif event.allegiance = "Empire":
            an Empire
        |elif event.allegiance = "Alliance":
            an Alliance
        |elif event.allegiance = "Independent":
            an Independent
        }
        {if event.government:
            {event.government} government
        |else:
          system
        }
        {OneOf("of", "with a population of", "home to", "supporting")} {Humanise(event.population)} {OneOf("people", "souls")}
        
{if system.power && system.powerstate:
       
{_ system.power equals system.power}
{_ system.powerstate equals system.powerstate}
{_ reportsystem.power equals reportsystem.power}
{_ reportsystem.powerstate equals reportsystem.powerstate}


{if event.system = "Gateway":
  {P(event.system)} is the home system of Edmund Mahon.
|elif event.system = "Kamadhenu":
  {P(event.system)} is the home system of Arissa Lavigny Duval.
|elif event.system = "Rhea":
  {P(event.system)} is the home system of Felicia Winters.
|elif event.system = "Cubeo":
  {P(event.system)} is the home system of Aisling Duval.
|elif event.system = "Clayakarma":
  {P(event.system)} is the home system of Yuri Grom.
|elif event.system = "Nanomam":
  {P(event.system)} is the home system of Zachary Hudson.
|elif event.system = "Polevnic":
  {P(event.system)} is the home system of Pranav Antal.
|elif event.system = "Eotienses":
  {P(event.system)} is the home system of Denton Patreus.
|elif event.system = "Lembava":
  {P(event.system)} is the home system of Li Yong Rui.
|elif event.system = "Synteini":
  {P(event.system)} is the home system of Zeminia Torval.
|elif event.system = "Harma":
  {P(event.system)} is the home system of Archon Delaine.
}


{if system.power = "Arissa Lavigny-Duval": 
   {if system.powerstate = "Control":
    Note: Bounties redeemed in {P(event.system)} are twenty percent more and fines and bounties incurred are doubled because it is {system.powerstate} by {system.power}.
   }
   {if system.powerstate = "Exploited":
  Note: Bounties redeemed in {P(event.system)} are twenty percent more because it is {system.powerstate} by {system.power}. 
   }  


|elif system.power = "Aisling Duval": 
   {if system.powerstate = "Control":
    Note: Security level is increased in {P(event.system)} because it is {system.powerstate} by {system.power}.
   |else:
    This system is {system.powerstate} by {system.power}.
   }
|elif system.power = "Archon Delaine": 
   {if system.powerstate = "Control":
    Note: Security level is reduced by half and black markets are opened in {P(event.system)} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile.
   }
  {if system.powerstate = "Exploited":
  Note: Security level is reduced by half in {P(event.system)} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile. 
  }


|elif system.power = "Denton Patreus":
    This system is {system.powerstate} by {system.power}.


|elif system.power = "Edmund Mahon":
    This system is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.   
     
|elif system.power = "Felicia Winters":
    {if system.powerstate = "Control": 
    Note: Security levels are increased by twenty percent in {P(event.system)} because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile.
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Empire":
    This system is {system.powerstate} by {system.power}.  Warning! This system is hostile. 
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Federation": 
      Note: Security levels are increased by twenty percent in {P(event.system)} because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile.
    }  
    {if system.powerstate = "Exploited" && event.allegiance = "Alliance":
    This system is {system.powerstate} by {system.power}.  Warning! This system is hostile.
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Independent":
     This system is {system.powerstate} by {system.power}.  Warning! This system is hostile.    
    }


|elif system.power = "Li Yong-Rui":
     This system is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.  
 
|elif system.power = "Pranav Antal": 
   {if system.powerstate = "Control":
    Note: Fines and bounties incurred are doubled in {P(event.system)} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.
   }
   {if system.powerstate = "Exploited":
  Note: Fines and bounties incurred are fifty percent more in {P(event.system)} because it is {system.powerstate} by {system.power}.  Warning! This system is hostile but neutral with the Empire.
   }  


|elif system.power = "Zachary Hudson":
    {if system.powerstate = "Control": 
    Note: The Security level in {P(event.system)} is increased by thirty percent because it is {system.powerstate} by {system.power}.  Warning! This system is hostile.
    }
    {if system.powerstate = "Exploited" && (event.allegiance = "Empire" || event.allegiance = "Alliance" || event.allegiance ="Independent"):
    Note: The Security level in {P(event.system)} is reduced by fourty percent because it is {system.powerstate} by {system.power}.  Warning! This system is hostile. 
    }
    {if system.powerstate = "Exploited" && event.allegiance = "Federation":
    Note: The security level in {P(event.system)} is increased by twenty percent because it is {system.powerstate} by {system.power}.  Warning! This system is hostile.
    }
           
|elif system.power = "Zemina Torval": 
   This system is {system.powerstate} by {system.power}.


|elif system.power = "Yuri Grom": 
   {if system.powerstate = "Control":
    Note: Bounties redeemed in {P(event.system)} are twenty percent more because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile, but is allied with the Empire.
   }
   {if system.powerstate = "Exploited" && (event.allegiance = "Empire" || event.allegiance = "Alliance"):
  Note: Bounties redeemed in {P(event.system)} are twenty percent more because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile, but is allied with the Empire.
   }
   {if system.powerstate = "Exploited" && event.allegiance = "Independent":  
   Note: Bounties redeemed in {P(event.system)} are twenty percent more and security is increased because it is {system.powerstate} by {system.power}.  Warning!  This system is hostile, but is allied with the Empire.
   }      
}
}
{if event.faction:
          {P(event.faction)} is the controlling {OneOf("power", "faction")}




{if system.state && system.state != "None":
 
,in a state of {system.state}.
|elif reportsystem.state && reportsystem.state != "None":


,in a state of {reportsystem.state}.
|elif event.factionstate && event.factionstate != "None":


,in a state of {event.factionstate}.
|else:
.
}




}
{if event.economy:
         The primary economy here is {event.economy}.
}


{set starport to 0}
{set outpost to 0}
{set p_port to 0}
{set p_outpost to 0}


{for station in reportsystem.stations:
    {if station.model && station.model != "":
        {if find(station.model, "Starport") > -1: {set starport to starport + 1}}
        {_ if find(station.model, "Outpost") > -1: set outpost to outpost + 1}
        {if find(station.model, "Planetary Outpost") > -1: {set p_outpost to p_outpost + 1}}
        {if find(station.model, "Planetary Port") > -1: {set p_port to p_port + 1}}
    }
}
       
 
{if len(reportsystem.orbitalstations) = 1:
   There is {OneOf("a single", "a lone", "just one", "one")} 
      {if len(reportsystem.orbitalstations) != starport:
        {set outpost to 1}         
        Outpost
      |else:
         Starport
      }
|else:
    {if len(reportsystem.orbitalstations) > starport:    
       {set outpost to (len(reportsystem.orbitalstations) - starport)}
    |elif len(reportsystem.orbitalstations) != starport:
       {set outpost to len(reportsystem.orbitalstations)}
    }
    {if outpost != 0:
       {if outpost = 1:
         There is a single Outpost
       |elif outpost > 1:
         There are {outpost} Outposts
       }
       {if starport > 1:
            , and 
       |elif starport = 1:
            , and a single Starport
       }
    }
    {if starport > 1 && outpost < 1:
       There are {starport} starports
    |elif starport != 0 && starport != 1:
       {starport} Starports    
    }       
       
}  
  
{if (p_outpost || p_port) && (starport || outpost):
  {if p_outpost = 1:
    , and there is also
  |else:
    , and there are also
  }
|elif p_outpost || p_port: 
  There is
}


{if p_outpost:
   {if p_outpost = 1:
     a single planetary outpost
   |elif p_outpost > 1:
     {p_outpost} planetary outposts
   }
   {if p_port:
     , and
   }
}
{if p_port:
  {if p_port = 1:
   a single planetary port
   |elif p_outpost > 1:
   {p_port} planetary ports
   }
}


{if event.system = "Khun":
  , The engineer Elvira Martuuk is also located
|elif event.system ="Wyrd":
  , The engineer The Dweller is also located
|elif event.system ="Eurybia":
  , The engineer Liz Ryder is also located  
|elif event.system ="Wolf 397":
  , The engineer Tod "The Blaster" McQuinn is also located
|elif event.system ="Deciat":
  , The engineer Felicity Farseer is also located
|elif event.system ="Giryak":
  , The engineer Juri Ishmaak is also located
|elif event.system ="Yoru":
  , The engineer Zacariah Nemo is also located
|elif event.system ="Laksak":
  , The engineer Lei Cheung is also located
|elif event.system ="Kuwemaki":
  , The engineer Hera Tani is also located
|elif event.system ="Kuk":
  , The engineer Selene Jean is also located
|elif event.system ="Sol":
  , The engineer Colonel Bris Dekker is also located
|elif event.system ="Sirius":
  , The engineer Marco Qwent is also located
|elif event.system ="Meene":
  The engineer Ram Tah is also located
|elif event.system ="Muang":
  , The engineer Broo Tarquin is also located 
|elif event.system ="Leesti":
  , The engineer Didi Vatermann is also located
|elif event.system ="Beta-3 Tucani":
  , The engineer The Sarge is also located
|elif event.system ="Maia":
  , The engineer Professor Palin is also located
|elif event.system ="Shinrarta Dezhra":
  , The engineer Lori Jameson is also located
|elif event.system ="Achenar":
  , The engineer Tiana Fortune is also located
|elif event.system ="Alioth":
  , The engineer Bill Turner is also located
|elif event.system ="Luchtaine":
  , The engineer Mel Brandon is also located
|elif event.system ="Tir":
  , The engineer Marsha Hicks is also located
|elif event.system ="Los":
  , The engineer Etienne Dorn is also located
|elif event.system ="Asura":
  , The engineer Petra Olmanova is also located
}
                    
{if starport || outpost || p_outpost || p_port:
in {OneOf("this system", "{P(event.system)}")}. 
}      


{_ orbital stations equals len(reportsystem.orbitalstations)}
{_ outpost equals outpost}
{_ starport equals starport}
{_ p_outpost equals p_outpost}
{_ p_port equals p_port}


   
The security level of {OneOf("this system", "{P(event.system)}")} is 
{if event.security = "GAlAXY_MAP_INFO_state_anarchy":
  Anarchy.
|else:
  {event.security}.
}


{set system_missions to F("Mission check system")}
{if system_missions:
    {system_missions}
}


|else:
 {if lastsystem.population && !event.population:
      {OneOf("{P(event.system)} is not populated","There is no human presence in {P(event.system)}", "Humans have yet to colonise {P(event.system)}")}.
  }
}




{_ event.distance equals event.distance}


The last jump of {round(event.distance,1)} light years from {P(lastsystem.name)} used {round(event.fuelused,2)} tons of fuel.


{if state.fuel_scoop != 1:
{F('Fuel check')}
}
 
Top Bottom