Release EDDI Scripts and EDDI enabled VA Commands Thread

Code:
{OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}

{if event.bodytype = 'Planet':


    {OneOf("near", "close to", "in the vicinity of")}


    {for body in system.bodies:
        {if body.name = event.body:
            the
            {if body.gravity >= 4:
               {OneOf("super-high gravity", "super heavy gravity", "extreme gravity", "extremely high gravity")}
            |elif body.gravity >= 2:
               high gravity
            |elif body.gravity > 0.5:
               {_ do nothing _}
            |elif body.gravity <= 0.5:
               low gravity
            }
        }
    }

For some reason and its driving me insane but whenever I drop near a planet after orbital cruise and glide it always states "extremely high gravity" no matter what even if the planet has 0.06 gravity. Can anyone figure this out?
This is for the "Entered normal space" script
 
For some reason and its driving me insane but whenever I drop near a planet after orbital cruise and glide it always states "extremely high gravity" no matter what even if the planet has 0.06 gravity. Can anyone figure this out?
This is for the "Entered normal space" script

Without diving too deeply, using a 'for loop', iterating through the system bodies is not the way to go. 'BodyDetails()' is your friend. This is my 'Entered normal space' script:

Code:
{OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}

{if event.bodytype = 'Planet':
    {OneOf("near", "close to", "in the vicinity of")} planet {P(event.body)}
    {Pause(1000)}
    {set body to BodyDetails(event.body, event.system)}
    {if !body.name || body.name = "":
        Planetary approach data not available.
    |else:
        {if body.landable:
            {set gravity to round(body.gravity,2)}
            {if gravity > 4:
                Danger! {P(body.name)} is an extremely high gravity world, at {gravity} G.
            |elif gravity > 2:
                Caution! {P(body.name)} is a high gravity world, at {gravity} G.
            |elif gravity > 0.5:
                Warning! {P(body.name)} is a medium gravity world, at {gravity} G.
            |else:
                {P(body.name)} is a low gravity world, at {gravity} G.
            }
        }
    }

|elif event.bodytype = 'Star':
    {OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}
|elif event.bodytype = 'Station':
    {OneOf("near", "close to", "in the vicinity of")} {P(event.body)}
|elif event.bodytype = 'PlanetaryRing':
    Planetary Ring {P(token(event.body," Ring",0))}
}.

There are numerous specialized functions for getting access to systems, bodies, stations, materials, etc. Check out the 'Help' button when editing a personality script.
 
Last edited:
Two questions, but I'll ask the 2nd in it's own post.

1) This pertains to EDDI only. I'm using the stock docking report script save a change to the wait time - mine is set to 25000 to give enough time for the station to finish their speech. However EDDI just can't wait, she [EDDI] talks over the station the second the docking request granted to pad "X" is on screen. I've increased the wait time to 35000 with NO change.

What needs to be reset or changed to make this work again? This is a recent development.
Some voices respect the speech tags that EDDI uses more than others. You might find that using a different voice or re-enabling phonetic speech (which removes speech tags if it's disabled) may help with this issue.
 
Without diving too deeply, using a 'for loop', iterating through the system bodies is not the way to go. 'BodyDetails()' is your friend. This is my 'Entered normal space' script:

Code:
{OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}

{if event.bodytype = 'Planet':
    {OneOf("near", "close to", "in the vicinity of")} planet {P(event.body)}
    {Pause(1000)}
    {set body to BodyDetails(event.body, event.system)}
    {if !body.name || body.name = "":
        Planetary approach data not available.
    |else:
        {if body.landable:
            {set gravity to round(body.gravity,2)}
            {if gravity > 4:
                Danger! {P(body.name)} is an extremely high gravity world, at {gravity} G.
            |elif gravity > 2:
                Caution! {P(body.name)} is a high gravity world, at {gravity} G.
            |elif gravity > 0.5:
                Warning! {P(body.name)} is a medium gravity world, at {gravity} G.
            |else:
                {P(body.name)} is a low gravity world, at {gravity} G.
            }
        }
    }

|elif event.bodytype = 'Star':
    {OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}
|elif event.bodytype = 'Station':
    {OneOf("near", "close to", "in the vicinity of")} {P(event.body)}
|elif event.bodytype = 'PlanetaryRing':
    Planetary Ring {P(token(event.body," Ring",0))}
}.

There are numerous specialized functions for getting access to systems, bodies, stations, materials, etc. Check out the 'Help' button when editing a personality script.
Sweet, thank you very much. I'll give this a try when I get off work.
 
Ok I got the gravity bit working now I just want to refine this scrip for Entering Normal Space. I don't want her to say the entire name of the planet that I'm in the vicinity of because it gets quite annoying when I'm exploring and some planets have REALLY long names.
Here is what I got for Entered normal space.
Code:
{_ Context }
{SetState("eddi_context_last_subject", "fsd")}
{SetState("eddi_context_last_action", "disengage")}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_body_name', event.body)}
{SetState('eddi_context_body_system', event.system)}




{SetState("type", event.bodytype)}
{SetState("body", event.body)}


{if state.eddi_context_interdicted != "yes":
{Pause(1000)}


{OneOf("{ShipName()} has", "")} {OneOf("left supercruise", "{OneOf(\"entered\", \"returned to\", \"dropped to\")} normal space")}


{if event.bodytype = 'Planet':   
    {OneOf("near", "close to", "in the vicinity of")} planet {P(event.body)}
    {Pause(1000)}
    {set body to BodyDetails(event.body, event.system)}
    {if !body.name || body.name = "":
        Planetary approach data not available.
    |else:
        {if body.landable:
            {set gravity to round(body.gravity,2)}
            {if gravity > 4:
                Danger! Extremely high gravity detected, at {gravity} G.
            |elif gravity > 2:
                Caution! High gravity detected, at {gravity} G.
            |elif gravity > 1:
                Warning! Medium gravity detected, at {gravity} G's.
            |else:
                Low gravity detected, at {gravity} G's.
            }
        }
    }
   
|elif event.bodytype = "Star":
    {OneOf("near", "close to", "in the vicinity of")} star {P(event.body)}


|elif event.bodytype = "Station":
    {OneOf("near", "close to", "in the vicinity of")} 
    {P(event.body)}
    {Pause(1000)}
    {F("Cargo legality check")}
    {F("MissionStoreCheckStation")}
    
|elif event.bodytype = "PlanetaryRing":
         Planetary Ring {P(token(event.body," Ring",0))}
}
}
{SetState("eddi_context_interdicted", "no")}

Everything works fine I just want her to say either the shorter name of the planet or just the planet type "high-metal content world" etc... I've tried everything I can think of but cannot get it to work. Thanks in advance,
 
Everything works fine I just want her to say either the shorter name of the planet or just the planet type "high-metal content world" etc... I've tried everything I can think of but cannot get it to work. Thanks in advance,

Not at my dev machine right now but in 2.4.6-b2 I made a change that should help you. From the change log:

'Body scanned' leaves naming the body in question to 'Body report', which no longer repeats the base system name if it doesn't have to.

Hope this helps, or at least gives you some code to steal from.
 
Not at my dev machine right now but in 2.4.6-b2 I made a change that should help you. From the change log:



Hope this helps, or at least gives you some code to steal from.

I actually made a separate script that I borrowed from another script that shortens the body name. Some reason when I tried to use the code within any script that I wanted it to just say the short body name it wouldn't work. But now since I made it separate and just call on the script {F("Short body name")} whenever I want it to say the short name it works perfectly. Here is the script,
Code:
{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
{if !reportbody.name || reportbody.name = "": {set reportbody to BodyDetails(state.eddi_context_body_name)} }


{if !reportbody.name || reportbody.name = "":
    I'm not sure which body you are asking about.
|else:
    {set shortBodyName to reportbody.name}
    {set systemName to state.eddi_context_body_system}
    {set sysNameLen to len(systemName)}
    {if len(shortBodyName) > sysNameLen && eq(systemName, slice(shortBodyName, 0, sysNameLen)):
        {set shortBodyName to cat("Body", Spacialise(slice(shortBodyName, sysNameLen)))}
    }


    {shortBodyName}
}

Definitely makes it explorer friendly
 
Now on to my next question. Is there a way to make a script where it will add up the values of the bodies you scanned and it will report to you the total value of credits you earned when you leave that system? Like when you high wake out if you scanned any bodies with a DSS it will give you total credits earned like "Total earned from scanned bodies: 400,000 credits". I think this will be greatly beneficial to explorers if so.
 
Now on to my next question. Is there a way to make a script where it will add up the values of the bodies you scanned and it will report to you the total value of credits you earned when you leave that system? Like when you high wake out if you scanned any bodies with a DSS it will give you total credits earned like "Total earned from scanned bodies: 400,000 credits". I think this will be greatly beneficial to explorers if so.
Yes, you can use the SetState function to set up a script that totals up estimated scan values and reports them to you.
https://github.com/EDCD/EDDI/blob/master/SpeechResponder/Help.md#setstate
 
I actually made a separate script that I borrowed from another script that shortens the body name. Some reason when I tried to use the code within any script that I wanted it to just say the short body name it wouldn't work. But now since I made it separate and just call on the script {F("Short body name")} whenever I want it to say the short name it works perfectly. Here is the script,
Code:
{_ Fetch from context }
{set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_body_system)}
{if !reportbody.name || reportbody.name = "": {set reportbody to BodyDetails(state.eddi_context_body_name)} }


{if !reportbody.name || reportbody.name = "":
    I'm not sure which body you are asking about.
|else:
    {set shortBodyName to reportbody.name}
    {set systemName to state.eddi_context_body_system}
    {set sysNameLen to len(systemName)}
    {if len(shortBodyName) > sysNameLen && eq(systemName, slice(shortBodyName, 0, sysNameLen)):
        {set shortBodyName to cat("Body", Spacialise(slice(shortBodyName, sysNameLen)))}
    }


    {shortBodyName}
}

Definitely makes it explorer friendly

Hehe that was my original script from which I derived the fix in 2.4.6-b2. Glad it works for you.
 
Awesome. However I have no idea what I'm doing when it comes to scripting, could someone point me in the right direction or help me create this script? I've just been copying and pasting other scripts and seeing what works through trial and error.
The example in the link from the wiki is almost exactly what you need. By clicking on the `Variables` button in the `Body scanned` script, you can learn that variable you need to accumulate is called `event.estimatedvalue`. You would accumulate it exactly like the linked wiki describes.

The code to capture and accumulate the value might look like
Code:
{SetState("systemvalue", state.systemvalue + event.estimatedvalue)}
And would be placed in your `Body scanned` script.

The subsequent code to retrieve the value would simply be
Code:
{state.systemvalue}
and could be placed wherever you wished. (in the `FSD engaged` script to report the value as you move to the next system perhaps?)

You would also want to zero the `systemvalue` variable for each new system you visited, probably during the `Jumped` event. I'll let you figure out that bit on your own, but the answer uses code that is similar to what is already given above. ;-)
 
well!i need some help whit EDDI.
the variable called {material.location} im looking for a documentation for it so i can call out something else instead how it is reporting to me.Someone enlight me where can i do that or should i have to get all data materials one by one and check what will be the output...Thank you guys.
 
well!i need some help whit EDDI.
the variable called {material.location} im looking for a documentation for it so i can call out something else instead how it is reporting to me.Someone enlight me where can i do that or should i have to get all data materials one by one and check what will be the output...Thank you guys.
That data comes from this repo: https://github.com/EDCD/EDDP (there are no guarantees that the data, or it's source, will not be changing in the future)
 
Last edited:
Hi guys!
i`ve updated EDDI to v 3.0.1-b1.Since that update the "Insurace Check" script is silent.Im not sure it is just me or someone else as well however even the Basic EDDI personality script also silent,anyway here is "my" script.

{if cmdr.credits && cmdr.insurance && ship.value:


{set insurance to round(ship.value * cmdr.insurance / 100)}


{set covereds to round((cmdr.credits / insurance) - 0.5)}


{if covereds = 0:
figyelem: {Pause(500)} Nincs elég kredited egyetlen egy ribájra sem.
|elif covereds = 1:
figyelem: {Pause(500)} Csak egy ribájra van elegendő kredited
|elif covereds < 4:
Összesen {covereds} ribájra van elegendő kredited.
}


|else:


Nem tudom kiszámítani jelenleg,hány ribájra van elegendő {OneOf("kreditünk","kredited","kreditje")}.


{if !cmdr.credits: Credit balance could not be accessed.}
{if !cmdr.insurance: Insurance rate could not be accessed.}
{if !ship.value: Ship value could not be accessed.}


}
 
Hi guys!
i`ve updated EDDI to v 3.0.1-b1.Since that update the "Insurace Check" script is silent.Im not sure it is just me or someone else as well however even the Basic EDDI personality script also silent,anyway here is "my" script.

{if cmdr.credits && cmdr.insurance && ship.value:


{set insurance to round(ship.value * cmdr.insurance / 100)}


{set covereds to round((cmdr.credits / insurance) - 0.5)}


{if covereds = 0:
figyelem: {Pause(500)} Nincs elég kredited egyetlen egy ribájra sem.
|elif covereds = 1:
figyelem: {Pause(500)} Csak egy ribájra van elegendő kredited
|elif covereds < 4:
Összesen {covereds} ribájra van elegendő kredited.
}


|else:


Nem tudom kiszámítani jelenleg,hány ribájra van elegendő {OneOf("kreditünk","kredited","kreditje")}.


{if !cmdr.credits: Credit balance could not be accessed.}
{if !cmdr.insurance: Insurance rate could not be accessed.}
{if !ship.value: Ship value could not be accessed.}


}
There is no error here. The default script only speaks when you have less than 4 insurance rebuys remaining.

If I wanted to revise the script to occasionally tell me how many insurance rebuys I had remaining (regardless of my credit balance), I might revise the default script like this:
Code:
{set insurance to round(ship.value * cmdr.insurance / 100)}


{set covereds to round((cmdr.credits / insurance) - 0.5)}


{if covereds = 0:
  Danger: you do not have enough credits to cover your insurance excess.
|elif covereds = 1:
  Caution: you only have enough credits to cover a single insurance excess.
|elif covereds < 4:
  Note: you only have enough credits to cover {covereds} insurance excesses.
|else:
  {Occasionally(5, "You have enough credits to cover {covereds} insurance excesses.")}
}
Note that "{Occasionally(5..." will trigger about 1/5 of the time. This number can be adjusted up or down according to your preference.
 
Thank you Tkael for the insight! I got the total system scanned value working. I placed what you recommended in my 'Body Scanned' event here
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'body')}
{SetState('eddi_context_last_action', 'scan')}
{SetState('eddi_context_body_system', system.name)}
{SetState('eddi_context_body_name', event.name)}
{SetState('eddi_context_last_scan_estimated_value', event.estimatedvalue)}
[B]{SetState("systemvalue", state.systemvalue + event.estimatedvalue)}[/B]


{Pause(1000)}


Scan {OneOf("complete", "completed", "finished")}.


{F("Body report")}


{F("Report last scan value")}

I also added it to the 'Star scanned' event to add in the value of the star.
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'star')}
{SetState('eddi_context_last_action', 'scan')}
{SetState('eddi_context_star_system', system.name)}
{SetState('eddi_context_star_star', event.name)}
{SetState('eddi_context_last_scan_estimated_value', event.estimatedvalue)}
[B]{SetState("systemvalue", state.systemvalue + event.estimatedvalue)}[/B]




{Pause(1000)}


Scan of {event.stellarclass}-class star {OneOf("complete", "completed", "finished")}.


{F("Star report")}


{F("Report last scan value")}

Then placed to call the value in the 'FSD engaged' event here
Code:
{_ Context }
{SetState('eddi_context_last_subject', 'fsd')}
{SetState('eddi_context_last_action', 'engage')}
{SetState('eddi_context_system_name', event.system)}
{SetState('eddi_context_system_system', event.system)}
{SetState('eddi_context_fsd_target', event.target)}


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


    {set system to SystemDetails(event.system)}


    {_ Wait for the FSD countdown and initial jump}
    {Pause(5000)} 
    
    {OneOf("Destination locked","Jump in progress","Destination obtained")}.
[B]    {if state.systemvalue = 0:[/B]
[B]        {Pause(10)}[/B]
[B]    |elif state.systemvalue > 1:[/B]
[B]    The last system scanned value {Humanise(state.systemvalue)} credits.[/B]
[B]    }[/B]
    You are now {OneOf("heading to", "on route to", "travelling to", "in transit to")} the {P(system.name)} system.


Then I zeroed out the systemvalue in the 'Jumped' event here.
Code:
{_ Context }
{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_ship_fuelremaining', event.fuelremaining)}
{SetState('eddi_context_ship_fuelused', event.fuelused)}
[B]{SetState("systemvalue", state.systemvalue = 0)}[/B]


{_ Check fuel levels _}
{F("JumpFuel")}


{_ Report system state _}
{set statereport to F("System state report")}
{if statereport:
    {Pause(2000)}
    {statereport}
}

Works perfectly so whenever I scan something it will tell me how much I made when I leave the system and if I don't scan anything it won't say anything at all. :) Cheers!
 
Back
Top Bottom