EDCD / EDDI

Companion application for Elite Dangerous
Other
444 stars 81 forks source link

"Body X report" script error in 3.3.4-b1 with TEST and VA #1104

Closed hoksilato2 closed 5 years ago

hoksilato2 commented 5 years ago

EDDI version in which issue found

EDDI 3.3.4-b1

Steps to reproduce

  1. Test the three "Body X report" scripts or launch command with VoiceAttack

Expected

no error script in use test button or with VA command.

Observed

This is the result of script when use TEST button or launch with VoiceAttack: There is a problem with the: Body report script. Object reference not set to an instance of an object.

If I put the function of this scripts into "Body scanned" script then works ok.

{F("Body report")}
{F("Body atmosphere report")}
{F("Body volcanism report")}
{F("Body materials report")}

I restart game, VoiceAttack, and EDDI standalone with same result.

With default EDDI personality I have the same result too :(

hoksilato2 commented 5 years ago

ticket edited.

Sometimes works and sometimes not work. I don't perceive what acts as a switch EDDI-logs.zip

hoksilato2 commented 5 years ago

Today works ok... I'm confused. I'm testing. Next week will close this issue if not happen it anymore.

Darkcyde13 commented 5 years ago

Sounds very much like the same problems experienced in issue #1102 .

Tkael commented 5 years ago

From eddi4.log...

2019-01-19T18:29:21 [Warning] JournalMonitor:ParseJournalEntry EDDI has no handler for event type 'FSSAllBodiesFound'./r/nRaw event:/r/n{ "timestamp":"2019-01-19T18:29:21Z", "event":"FSSAllBodiesFound", "SystemName":"Swoidai IO-O d7-26", "SystemAddress":904971389379, "Count":2 } 
2019-01-19T18:30:27 [Warning] EDDNResponder:CheckLocationData The EDDN responder is in an invalid state and is unable to send messages. {"systemName":"Swoidai XP-D b32-1","systemAddress":null,"systemX":null,"systemY":null,"systemZ":null,"stationName":null,"marketId":null,"invalidState":true} Event: {"timestamp":"2019-01-19T18:30:27Z","event":"Scan","ScanType":"AutoScan","BodyName":"Swoidai XP-D b32-1 A","BodyID":2,"Parents":[{"Null":1},{"Null":0}],"DistanceFromArrivalLS":0.0,"StarType":"M","StellarMass":0.269531,"Radius":278216960.0,"AbsoluteMagnitude":10.571976,"Age_MY":1456,"SurfaceTemperature":2436.0,"Luminosity":"Va","SemiMajorAxis":849596096.0,"Eccentricity":0.011204,"OrbitalInclination":23.474224,"Periapsis":51.388332,"OrbitalPeriod":101770.179688,"RotationPeriod":137382.546875,"AxialTilt":0.0}
2019-01-19T18:34:17 [Warning] ScriptResolver:resolveScript Failed to resolve the: Body report script. System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
   en EddiSpeechResponder.ScriptResolver.<>c__DisplayClass13_1.<buildStore>b__51(Body v)
   en System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   en EddiSpeechResponder.ScriptResolver.<>c.<buildStore>b__13_28(IList`1 values)
   en Cottle.Functions.NativeFunction.<>c__DisplayClass13_0.<.ctor>b__0(IList`1 v, IStore s, TextWriter o)
   en Cottle.Functions.NativeFunction.Execute(IList`1 arguments, IStore store, TextWriter output)
   en Cottle.Documents.Simple.Evaluators.InvokeEvaluator.Evaluate(IStore store, TextWriter output)
   en Cottle.Documents.Simple.Nodes.AssignNodes.ValueAssignNode.Evaluate(IStore store, TextWriter output)
   en Cottle.Documents.Simple.Nodes.AssignNode.Render(IStore store, TextWriter output, Value& result)
   en Cottle.Documents.Simple.Nodes.CompositeNode.Render(IStore store, TextWriter output, Value& result)
   en Cottle.Documents.Simple.Nodes.IfNode.Render(IStore store, TextWriter output, Value& result)
   en Cottle.Documents.Simple.Nodes.CompositeNode.Render(IStore store, TextWriter output, Value& result)
   en Cottle.Documents.SimpleDocument.Render(IStore store, TextWriter writer)
   en Cottle.Documents.AbstractDocument.Render(IStore store)
   en EddiSpeechResponder.ScriptResolver.resolveScript(String script, BuiltinStore store, Boolean master, Script scriptObject) 

Would you please send a copy of your journal log entries between these timestamps? A location related event appears to have been missed and the error may have affected both the EDDN responder and the BodyReport() script, but it wasn't logged. It was probably the FSDJump to Swoidai XP-D b32-1.

Tkael commented 5 years ago

It also looks like you are starting to scan bodies very quickly after EDDI is launched. Is that accurate? If so, does the problem subside if you launch EDDI a few minutes before beginning your play session?

hoksilato2 commented 5 years ago

Journal.190119172632.01.log

I was trying a lot with scripts. It's possible but not always. @Darkcyde13 with you script "Body Name Tidy" I always have the error. But I understand that's not a priority. Maybe I need change some other scripts :)

Darkcyde13 commented 5 years ago

@hoksilato2 Yeah, I've made some improvements to combat that error. If you're using my script, try this version:-

{_ Body Name Tidy _}
{_ Tidy up body names _}
{_ If the body name contains the system name, it is removed _}
{_ Adds Star, Planet, or Moon depending on body location within the system _}
{_ Corrects pronunciation of letters in body names. No more 'hour' for 'h' with some TTS voices _}
{_ Returns 'body' and 'body_type 'for use in other scripts _}

{if len(reportbody.shortname) = 0:
    {if event:
        {if !event.name:
            {_ For events that have different variables _}
            {set reportbody to BodyDetails(event.body, event.system)}
        |else:
            {set reportbody to BodyDetails(event.name, system.name)}
        }
    |elif reportbody.stellarclass:
        {set reportbody to BodyDetails(state.eddi_context_star_name, state.eddi_context_star_system)}
    |else:
        {set reportbody to BodyDetails(state.eddi_context_body_name, state.eddi_context_system_system)}
    }
}

{set body to reportbody.name}
{set system to reportbody.systemname}

{if body = system:
    {set body to "The primary star"}
    {set body_type to "Star"}

|elif find(body, system) > -1:

    {set parent to split(body, " ")}
    {set p_body to parent[len(parent)-2]}
    {set parent to join(except(parent, [len(parent)-1:"", len(parent)-1:""]), " ")}

    {if (parent != system) && len(p_body) = 1:
        {set parent to BodyDetails(parent, system).type}
    }

    {_ Remove system name from the body name _}
    {if reportbody.shortname:
        {set body to reportbody.shortname}
    |else:
        {set body to slice(body, len(system)+1)}
    }

    {set type to reportbody.type}
    {set body_type to type}

    {_ Remove Ring designation if it's a ring _}
    {if find(body, "Ring") > -1:
        {set body to split(body, " ")}
        {set body to join(except(body, [len(body)-1:"", len(body)-2:""]), " ")}
    }

    {_ Replacing spaces with dashes makes all letters spoken as alphabetic letters _}
    {set body to ucase(join(split(body, " "), "-"))}

    {if find(body, "+") > -1:
        {_ For scans that list two planets. Probably redundant with the new scanning. _}
        {set body to List(split(body, "+"))}
        {set body_type to "Planets"}
    |elif type = "Planet" && (parent = "Planet" || ord(slice(body, len(body)-1)) > 64):
        {set body_type to "Moon"}
    }

    {set body to cat(body_type, "-", body)}
}
hoksilato2 commented 5 years ago

Thank you! But, in the same EDDI sesión I have the same error:

There is a problem with the: Body Name Tidy script. Referencia a objeto no establecida como instancia de un objeto.

Is that error but in spanish:

There is a problem with the: Body Name Tidy script. Object reference not set to an instance of an object.

I supose, that my .NET Framework is in spanish or something like that :-P

Darkcyde13 commented 5 years ago

Unfortunately it's not a fool-proof way of stopping the error. I've found that on some occasions, the body and star system don't match (a completely different body, from a different system) and this also causes the error. But the above should help reduce the number of times you hear it.

hoksilato2 commented 5 years ago

I'm testing. Thank you Dark. You have an awesome EDDI Personality :)