EDCD / EDDI

Companion application for Elite Dangerous
Other
454 stars 82 forks source link

Guardian sites in 'Entered normal space' #2132

Closed Darkcyde13 closed 3 years ago

Darkcyde13 commented 3 years ago

What's Wrong (please be as specific as possible)

Expected

Speech to say "... left supercruise near to Guardian Structure".

Observed

Speech says "... left supercruise near to Unknown Station, Guardian Structure".

Steps to reproduce

  1. Exit supercruise near to a Guardian surface site.
  2. Listen to the 'Entered normal space' event speech.

Configuration

My Investigation

Investigation Notes

Yesterday I decided to try for some Guardian modules and headed to a Guardian site. When dropping from supercruise near a Guardian site, the 'Entered normal space' event script says "... left supercruise near to Unknown Station, Guardian Structure".

The IF statement on line 44 checks for "Unknown" only, and thus fails in this instance as the invariantName is "Unknown Station", not just "Unknown". For this situation, I think it would be better to check with a find(), or if this is the only time 'unknown' will be in a station type, then simply add the word station to the check, like these:

{if find(station.Model.invariantName, "Unknown") = -1:
{if station.Model.invariantName = "Unknown Station":

I think the former would be the best choice, as this covers anything "Unknown" that may be encountered. With this in place, the speech is now "... left supercruise near to Guardian Structure", which sounds much better.

EDDI Logs

N/A

Player journals

N/A

Tkael commented 3 years ago

I fetched some player journals (which are probably representative though it would be helpful if you can confirm) to examine for this ticket.

{ "timestamp":"2020-10-20T04:45:38Z", "event":"ApproachSettlement", "Name":"$Ancient_Small_001:#index=1;", "Name_Localised":"Guardian Structure", "SystemAddress":2656344967507, "BodyID":8, "BodyName":"NGC 2451A Sector IR-W d1-77 AB 1 a", "Latitude":23.313747, "Longitude":156.011536 }
{ "timestamp":"2020-10-20T04:46:11Z", "event":"ApproachBody", "StarSystem":"NGC 2451A Sector IR-W d1-77", "SystemAddress":2656344967507, "Body":"NGC 2451A Sector IR-W d1-77 AB 1 a", "BodyID":8 }
{ "timestamp":"2020-10-20T04:46:50Z", "event":"ApproachSettlement", "Name":"$Ancient_Small_001:#index=1;", "Name_Localised":"Guardian Structure", "SystemAddress":2656344967507, "BodyID":8, "BodyName":"NGC 2451A Sector IR-W d1-77 AB 1 a", "Latitude":62.745335, "Longitude":43.220318 }
{ "timestamp":"2020-10-20T04:46:52Z", "event":"SupercruiseExit", "StarSystem":"NGC 2451A Sector IR-W d1-77", "SystemAddress":2656344967507, "Body":"NGC 2451A Sector IR-W d1-77 AB 1 a", "BodyID":8, "BodyType":"Planet" }

Since "BodyType" is "Planet", script lines 37-54 appear to be appropriate. Line 41 should, however, be returning null since the system should contain only dockable stations and we shouldn't be able to find a "Guardian Structure" station. This should result in line 42 returning false and in bypassing script lines 43-48.

In the context of my player journals, line 42 should be the equivalent of

{set station to StationDetails("Guardian Structure", "NGC 2451A Sector IR-W d1-77")}

which using data from EDSM returns null and does not trigger my test

{if station:
  Failed.
}

My ultimate questions then are "Why did EDDI apparently think that you were approaching a dockable station?" and "Is there some error that can allow a Guardian Structure to be added to system.stations?"

Are you using default scripts for Settlement approached and Entered normal space?

Darkcyde13 commented 3 years ago

I wasn't when I ran my tests, however, the changes I've made in them are minor, and would not make them function any differently.

For reference, here's my section of 'Entered normal space':

    {OneOf("near", "close to", "in the vicinity of")}
    {set time to SecondsSince(0) - state.eddi_context_approach_time}
    {if time < 60:
        {set settlement to state.eddi_context_last_settlement}
        {set station to StationDetails(settlement, event.systemname)}
        {if station:
            {SetState('eddi_context_body_name', settlement)}
            {if station.Model.invariantName != "Unknown":
                {P(station.model, "station")},
            }
            {P(settlement, "station")}
            {station_notifications}
        |else:
            {P(settlement, "station")}.
        }
    |else:
        {event.bodytype)} {P(reportBody.shortname, "body")}.
    }

I have made a couple of more significant changes, but only after this part, so they have no effect on this issue.

And here's my 'Settlement approached':

{_ Context _}
{SetState('eddi_context_last_subject', 'settlement')}
{SetState('eddi_context_last_action', 'approach')}
{SetState('eddi_context_last_settlement', event.name)}
{SetState('eddi_context_approach_time', SecondsSince(0))}

{set settlement to event.name}

{_ Remove + signs from settlement name _}
{set cur to find(settlement, "+")}
{if cur > -1:
    {set settlement to slice(settlement, 0, cur)}
}

{SetState('eddi_context_last_settlement', settlement)}

I've returned to the bubble now, but as I have just got my Guardian FSD Booster, I'll go back there and run some more tests, both with my scripts and the defaults.

Darkcyde13 commented 3 years ago

OK, so I've headed back to the Guardian Structure in Synuefe NL-N C23-4, planet B 3.

I set EDDI back to the default personality, flew to the planet and exited supercruise over the site. EDDI read out:

returned to normal space close to Unknown Station, Guardian Structure. Glide mode engaged. Planet B 3 is a low gravity world, at 0.30 G. Glide completed.

I then went back to my personality, and tried again. This time adding the line Invariant name: {station.Model.invariantName}. just after that section of code. This is what I got:

left supercruise in the vicinity of Unknown Station, Guardian Structure Invariant name: Unknown Station. Glide initiated. B 3 is a low gravity world, at 0.30 G. Glide completed.

So it seems that the invariantName is "Unknown Station" and thus doesn't equal "Unknown" on line 44, which makes line 45 be read out.

Here are the Journal entries that cover all the above testing. Timestamps 20:27 & 20:28 are when I was using the EDDI default, and timestamps 20:31 are using my personality.

{ "timestamp":"2021-03-15T20:27:34Z", "event":"ApproachSettlement", "Name":"$Ancient_Small_005:#index=1;", "Name_Localised":"Guardian Structure", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":-34.833324, "Longitude":132.893524 }
{ "timestamp":"2021-03-15T20:27:36Z", "event":"ApproachSettlement", "Name":"$Ancient:#index=2;", "Name_Localised":"Ancient Ruins (2)", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":-30.544333, "Longitude":-24.205053 }
{ "timestamp":"2021-03-15T20:27:36Z", "event":"ApproachSettlement", "Name":"$Ancient:#index=3;", "Name_Localised":"Ancient Ruins (3)", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":0.666933, "Longitude":-36.821075 }
{ "timestamp":"2021-03-15T20:27:36Z", "event":"ApproachSettlement", "Name":"$Ancient:#index=1;", "Name_Localised":"Ancient Ruins (1)", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":48.175247, "Longitude":-48.364517 }
{ "timestamp":"2021-03-15T20:27:58Z", "event":"ApproachBody", "StarSystem":"Synuefe NL-N c23-4", "SystemAddress":1184840454858, "Body":"Synuefe NL-N c23-4 B 3", "BodyID":18 }
{ "timestamp":"2021-03-15T20:28:55Z", "event":"ApproachSettlement", "Name":"$Ancient_Small_005:#index=1;", "Name_Localised":"Guardian Structure", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":-34.833328, "Longitude":132.893524 }
{ "timestamp":"2021-03-15T20:28:58Z", "event":"SupercruiseExit", "StarSystem":"Synuefe NL-N c23-4", "SystemAddress":1184840454858, "Body":"Synuefe NL-N c23-4 B 3", "BodyID":18, "BodyType":"Planet" }
{ "timestamp":"2021-03-15T20:28:58Z", "event":"Music", "MusicTrack":"Exploration" }
{ "timestamp":"2021-03-15T20:31:06Z", "event":"StartJump", "JumpType":"Supercruise" }
{ "timestamp":"2021-03-15T20:31:07Z", "event":"ApproachSettlement", "Name":"$Ancient_Small_005:#index=1;", "Name_Localised":"Guardian Structure", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":-34.833328, "Longitude":132.893524 }
{ "timestamp":"2021-03-15T20:31:07Z", "event":"ApproachSettlement", "Name":"$Ancient:#index=1;", "Name_Localised":"Ancient Ruins (1)", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":48.175247, "Longitude":-48.364521 }
{ "timestamp":"2021-03-15T20:31:07Z", "event":"ApproachSettlement", "Name":"$Ancient:#index=2;", "Name_Localised":"Ancient Ruins (2)", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":-30.544327, "Longitude":-24.205044 }
{ "timestamp":"2021-03-15T20:31:07Z", "event":"ApproachSettlement", "Name":"$Ancient:#index=3;", "Name_Localised":"Ancient Ruins (3)", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":0.666937, "Longitude":-36.821083 }
{ "timestamp":"2021-03-15T20:31:11Z", "event":"SupercruiseEntry", "StarSystem":"Synuefe NL-N c23-4", "SystemAddress":1184840454858 }
{ "timestamp":"2021-03-15T20:31:11Z", "event":"Music", "MusicTrack":"Supercruise" }
{ "timestamp":"2021-03-15T20:31:16Z", "event":"ApproachSettlement", "Name":"$Ancient_Small_005:#index=1;", "Name_Localised":"Guardian Structure", "SystemAddress":1184840454858, "BodyID":18, "BodyName":"Synuefe NL-N c23-4 B 3", "Latitude":-34.833328, "Longitude":132.893524 }
{ "timestamp":"2021-03-15T20:31:17Z", "event":"SupercruiseExit", "StarSystem":"Synuefe NL-N c23-4", "SystemAddress":1184840454858, "Body":"Synuefe NL-N c23-4 B 3", "BodyID":18, "BodyType":"Planet" }
{ "timestamp":"2021-03-15T20:31:17Z", "event":"Music", "MusicTrack":"Exploration" }

I must admit, I didn't fly very far away when I jumped back into supercruise, but I did stay in it for a few seconds. I thought this would be enough time for the settlement approached to trigger again, which it does appear to have.

Tkael commented 3 years ago

Found the issue. We were generating a station from the "ApproachSettlement" event after all (even though it wasn't appropriate to do so).

Also, I agree that line 44 of the script needs revision.