Page 52 of 52 FirstFirst ... 47505152
Results 766 to 778 of 778

Thread: EDDI Scripts and EDDI enabled VA Commands Thread

  1. #766
    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.

  2. #767
    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?

  3. #768
    Originally Posted by Zev Woundurlust View Post (Source)
    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}}
        }
    }

  4. #769
    Originally Posted by Kenjiro View Post (Source)
    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.

  5. #770
    Originally Posted by Zev Woundurlust View Post (Source)
    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...

  6. #771
    Originally Posted by Kenjiro View Post (Source)
    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.

  7. #772
    Originally Posted by Hoodathunk View Post (Source)
    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

  8. #773
    Originally Posted by Hoodathunk View Post (Source)
    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')}
    }

  9. #774
    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}
      }
    }
    }
    }

  10. #775
    Originally Posted by Zev Woundurlust View Post (Source)
    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.

  11. #776
    Originally Posted by Darkcyde View Post (Source)
    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.

  12. #777
    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.

  13. #778
    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?

Page 52 of 52 FirstFirst ... 47505152