Release EDDI 3.3 - Bring your cockpit to life

I always feel so lost:
what data the Ship FSD event contains?

My goal is to get warned about the destination star being scoopable while i still can abort the jump.
In the FSD Engaged event, i have this part of code which gives me "special advises":

Code:
        {if reportSystem.name = homesystem.name:
            Coming Home!.
        |else:
            {set scoopables to ['O', 'B', 'A', 'F', 'G', 'K', 'M']}
            {if slice(event.stellarclass, 0, 1) = 'D':
                White Dwarf.
            |elif event.stellarclass = 'N':
                Neutron Star.
            |elif event.stellarclass = 'H':
                Black Hole.
            |elif find(scoopables, event.stellarclass) = -1:
               Non scoopable star.
            }
        }


How could i get the stellarclass(es) of the nextsystem in the Ship FSD script?
 
I always feel so lost:
what data the Ship FSD event contains?

My goal is to get warned about the destination star being scoopable while i still can abort the jump.
In the FSD Engaged event, i have this part of code which gives me "special advises":

Code:
        {if reportSystem.name = homesystem.name:
            Coming Home!.
        |else:
            {set scoopables to ['O', 'B', 'A', 'F', 'G', 'K', 'M']}
            {if slice(event.stellarclass, 0, 1) = 'D':
                White Dwarf.
            |elif event.stellarclass = 'N':
                Neutron Star.
            |elif event.stellarclass = 'H':
                Black Hole.
            |elif find(scoopables, event.stellarclass) = -1:
               Non scoopable star.
            }
        }


How could i get the stellarclass(es) of the nextsystem in the Ship FSD script?
Try this...
Code:
{if event.fsd_status = "charging" && len(nextsystem.systemname) > 0:
    {set reportSystem to SystemDetails(nextsystem.systemname)}

    {for compartment in ship.compartments:
        {if compartment.module.basename = "FuelScoop":
            {set scoop to true}
        }
    }

    {if scoop && !reportSystem.scoopable: Caution.  There are no scoopable stars in the destination system.}
}
When you start to charge your FSD, and if you have a fuel scoop installed, this should tell you if the destination system does not have a scoopable star in it. I'm now going to try this out for myself... ;)

Edit: To answer the first part of your question, when you edit the script, click the Variables button and then scroll all the way to the bottom of the window that opens. The section at the end has all the variables for that particular event. In this case it is only the fsd_status variable.

Edit 2: Testing and working perfectly in the few systems I've tried it in. :)

Edit 3: Added an extra check to make sure the next system exists, otherwise this could say no scoopable stars when you charge to enter in-system supercruise. I've also noticed that if you untarget the star system, it will still be considered as selected until your next jump.
 
Last edited:
This is my curred Ship FSD script:
it SHOULD tells if there's secondary scoopable stars (if the primary is not) and if there's "special" stars.
Code:
{set MainStarScoopable to false}
{set FoundScoopable to false}

{if event.fsd_status = 'charging':
    {if len(nextsystem.systemname) > 0:
        {set reportSystem to SystemDetails(nextsystem.systemname) }
        {if reportSystem.name = homesystem.name:
            Stiamo tornando a casa.
        |else:

            {for compartment in ship.compartments:
                {if compartment.module.basename = "FuelScoop":
                    {set scoop to true}
                }
            }

            {if scoop && !reportSystem.scoopable:
                {OneOf(
                    "Non sarà possibile rifornirsi nel sistema",
                    "Rifornimento non possibile",
                    "Impossibile rifornirsi"
                )}.
            }
            {for aBody in reportSystem.bodies:
                {if aBody.bodyType.invariantName = 'Star':
                    {if slice(aBody.stellarclass, 0, 1) = 'D':        Attenzione: nana bianca rilevata.
                    |elif aBody.stellarclass = 'N':                 Attenzione: stella di neutroni rilevata.
                    |elif aBody.stellarclass = 'H':                    Attenzione: buco nero rilevato.
                    |elif scoop && aBody.scoopable:
                        {if aBody.mainstar:
                            {_ this is "normal", no speak }
                            {set MainStarScoopable to true}
                            {set FoundScoopable to true}
                        |else:
                            {set FoundScoopable to true}
                        }
                    }
                }
            }
            {if scoop && FoundScoopable && !MainStarScoopable:
                Potremo rifornirci ad una stella secondaria.
            }
        }
    } {_systemname > 0}
}


Should work, but i'm between two arms of the galaxy so it is a bit hard to debug it fully.
 
The system Oodgolf CQ-G d10-3 return 0 bodies, and system.scoopable=false. But the game already know the star is a F.
Another app i'm using identify it as a scoopable system.
What is happening? What am i doing wrong?
 
The system Oodgolf CQ-G d10-3 return 0 bodies, and system.scoopable=false. But the game already know the star is a F.
Another app i'm using identify it as a scoopable system.
What is happening? What am i doing wrong?
Hmm, I just checked EDSM (where EDDI gets data from if you haven't scanned it) and there is only the main star.

I tried {SystemDetails("Oodgolf CQ-G d10-3").scoopable} and it says 'true'.
I tried {SystemDetails("Oodgolf CQ-G d10-3").totalbodies} and it says 'zero', but that's because I have not scanned it myself (you have to do a discovery scan to get the number of bodies). Using .bodies will not give a number, as that variable is an array of the bodies in the system. You would have to use .bodies[0].name just to get the name of the first body (the star).

What is the code you are using to get those results?
 
What is the code you are using to get those results?
Code:
{set DebugSystem to SystemDetails("Eifaif WQ-B b47-0")}
{if len(DebugSystem.systemname) > 0:
    The System {DebugSystem.systemname} is {if !DebugSystem.scoopable: not} scoopable.
    Num of bodies: {len(DebugSystem.bodies)}:
    {for aBody in DebugSystem.bodies:
        {if aBody.bodyType.invariantName = 'Star':
            {if aBody.mainstar:
                The main star
            |else:
                The star
            }
            {aBody.shortname}, class {aBody.stellarclass}
            {if aBody.scoopable: is scoopable}.
        |else:
            {aBody.bodyType.invariantName} {aBody.shortname}.
        }
    }
}

It now gives me 3 bodies, and being scoopable, but i entered in that system then, so perhaps it depends on this.... still, a system shouldn't have at least 1 body (the main star in the map)?

I'll report back if it will happens again (two times, today, but the first one i wasn't ready to dig in it, as i was still writing the Ship FSD script).
 
Code:
{set DebugSystem to SystemDetails("Eifaif WQ-B b47-0")}
{if len(DebugSystem.systemname) > 0:
    The System {DebugSystem.systemname} is {if !DebugSystem.scoopable: not} scoopable.
    Num of bodies: {len(DebugSystem.bodies)}:
    {for aBody in DebugSystem.bodies:
        {if aBody.bodyType.invariantName = 'Star':
            {if aBody.mainstar:
                The main star
            |else:
                The star
            }
            {aBody.shortname}, class {aBody.stellarclass}
            {if aBody.scoopable: is scoopable}.
        |else:
            {aBody.bodyType.invariantName} {aBody.shortname}.
        }
    }
}

It now gives me 3 bodies, and being scoopable, but i entered in that system then, so perhaps it depends on this.... still, a system shouldn't have at least 1 body (the main star in the map)?

I'll report back if it will happens again (two times, today, but the first one i wasn't ready to dig in it, as i was still writing the Ship FSD script).
Hmm, that is strange. Well, I just tried your script, and again with the first system you mentioned above too (Oodgolf CQ-G d10-3), and they both worked as expected. I also tested them out with my 'System Exploration Report' script, and that confirms I've not been to either of those systems, so EDDI must be getting the data from EDSM for me.
 
ok, when that will happen again i'll try to log everything i can, before and after going in the system.
If you all have any suggestion about how to "dump" all the relevant infos, i'm willing to follow :)
 
ok, when that will happen again i'll try to log everything i can, before and after going in the system.
If you all have any suggestion about how to "dump" all the relevant infos, i'm willing to follow :)
Systems are defined as scoopable by whether they contain a scoopable body. I suspect the answer here is that we do not create a body for the main star when you target the system (since we lack a name for the main star and since the body name acts as our primary identifier). I think I'll add a secondary identifier based on whether the body is a main star (which should allow us to add an un-named main star to the system).

The short term solution will need to be be to capture event.starclass from the Next jump event (using SetState()) and to react to that in your Ship FSD script.
 
Last edited:
These two lines:
Code:
{set DebugSystem to SystemDetails("Eifaif WQ-B b47-0")}
{dump(DebugSystem)}
makes EDDI hangs for about 20 seconds, and then it crashes silently (nothing written in the log or output file).

I understand that's a lot to dump, but perhaps it shouldn't crash :)
 
There's a way to add a newline in what Log() outputs?

I tried {Log("NewLine\n\rNewLine")} but it doesn't works.
I've just investigated this, as I like a challenge, and I had no idea if I could get it to work. 😊
It seems it's not too difficult after all. Try this code: {Log(cat("test", char("10"), "code"))}
The char("10") is ASCII code for a new line feed. By using it with cat() it gets converted to the line feed before being sent to the log, making it work:
Code:
2022-05-13T23:48:05 [Info] Log:function test
code
I first tried {Log("test{char('10')}code")}, but this only sends that line to the log, without converting the ASCII first.

I'm not sure how useful you may find this, but at least you can get it to work. 👍

Edit: I just realised you can do something similar for the speecresponder.out file. Adding a {char("10")} to your script will put the line feed into the output.
Code:
Some test
{char("10")}
code
Some test code becomes:
Code:
Some test 
 code
 
Last edited:
There's a way to add a newline in what Log() outputs?

I tried {Log("NewLine\n\rNewLine")} but it doesn't works.
I'm afraid that the dump() method doesn't appear to be capable of rendering complex object values.
Try reflection instead?

Example (with some filtering to clean up the outputs):
Code:
{set Reflect(obj) to:
    {for key, value in obj:
        {if find(key, "k__BackingField") = -1 && find(key, "_") != 0:
            {if type(value) = "map":
                {_ This is a key, value object that should probably be inspected separately }
                {_ Careful with looping - it is possible to crash the program if you loop too much and consume too many resources from your PC}
                {PrintValue(key, value, "object")}
            |else:
                {PrintValue(key, value, type(value))}
            }
        }
    }
}

{set PrintValue(key, value, valueType) to:
    {if value:
        {key}: {value} ({valueType})
        {char("10")}    
    }
}

{set DebugSystem to SystemDetails("Eifaif WQ-B b47-0")}
{Reflect(DebugSystem)}
{Reflect(DebugSystem.bodies)}
{Reflect(DebugSystem.bodies[0])}
 
Last edited:
Top Bottom